pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.81k stars 1.74k forks source link

Cannot decompress file that is not an archive #5034

Closed EpicPlayerA10 closed 6 months ago

EpicPlayerA10 commented 8 months ago

Current Behavior

When I try to unarchive minecraft log file (example: /logs/2024-03-15-2.log.gz) then it wouldn't work and on the planel it would show this error: image

On wings it will throw this error:

wings[1917041]: 2024/03/15 22:32:22 [Recovery] 2024/03/15 - 22:32:22 panic recovered:
wings[1917041]: runtime error: invalid memory address or nil pointer dereference
wings[1917041]: runtime/panic.go:261 (0x451e97)
wings[1917041]: runtime/signal_unix.go:861 (0x451e65)
wings[1917041]: io/fs/stat.go:25 (0x504716)
wings[1917041]: io/fs/walk.go:118 (0x504c95)
wings[1917041]: github.com/pterodactyl/wings/server/filesystem/compress.go:113 (0xe532a4)
wings[1917041]: github.com/pterodactyl/wings/router/router_server_files.go:450 (0xfde38f)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:158 (0xfe51c8)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:186 (0xfe503c)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:186 (0xfe4dfc)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xfa99dd)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0xfa99a0)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:51 (0xfd75e4)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:42 (0xfd7638)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xfb405c)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:135 (0xfb404a)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:68 (0xfe4686)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xf9db8a)
wings[1917041]: github.com/pterodactyl/wings/router/middleware/middleware.go:33 (0xfe4638)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xfaa839)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0xfaa827)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xfa8a9a)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0xfa872d)
wings[1917041]: github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0xfa825c)
wings[1917041]: net/http/server.go:2938 (0x6ea24d)
wings[1917041]: net/http/server.go:2009 (0x6e6133)
wings[1917041]: runtime/asm_amd64.s:1650 (0x470dc0)

Expected Behavior

Minecraft log file should be unarchived.

Steps to Reproduce

  1. Setup minecraft server and start it
  2. Try to unarchive one of the log files
  3. See the error

Panel Version

1.11.5

Wings Version

1.11.11

Games and/or Eggs Affected

Minecraft (Paper)

Docker Image

ghcr.io/pterodactyl/yolks:java_17

Error Logs

No response

Is there an existing issue for this?

NotGeri commented 7 months ago

I know this hasn't been released yet, but as far as I can tell, the patch introduced in https://github.com/pterodactyl/wings/commit/f1c5bbd42d423986e7017b4f3c43057a1b7d1717 does not work yet

It no longer panics, but it can't cast here: https://github.com/pterodactyl/wings/blob/f1c5bbd42d423986e7017b4f3c43057a1b7d1717/server/filesystem/compress.go#L194-L197

I may be misunderstanding but the Gz doesn't seem to implement Extractor, just Compressor

I will see if I can find out more in the meantime

danny6167 commented 6 months ago

Confirmed this is still not working on the latest release and latest develop branch - Reopening.