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.51k stars 1.61k forks source link

Wings going into Panic mode when trying to start a server. #2000

Closed MilesMadd closed 4 years ago

MilesMadd commented 4 years ago

I have installed the latest version of wings on the ubuntu machine, and was setting it up with the latest panel version on windows IIS. This was all working. You could make a new server and add and remove files. Now when you attempted to start a server you would get a error on the wings side, so after further investigation I found that it could have something to do the ssl security and tls version. So then I attempted to use the panel & wings without ssl. I got a different error now. So I then installed the panel on the same Ubuntu machine as the wings service. After going to this process, I got the same error as i saw before. Then I thought it might be a faulty wings installation, so i reinstalled wings. Still the same error.

the error:

wingsError

Background (please complete the following information):

Describe the bug Panel: image

docker info image

To Reproduce Steps to reproduce the behavior:

  1. install wings according to the installation
  2. fill the config with:

debug: false uuid: 08f89698-fdb7-44a7-a465-29f372707167 token_id: kV7nf9MZJrxwSr7G token: TE2jSR5rjf0EZS2x2k600EHcxZRCae2HBVCA7rv9e3z7bYdXLhDzlh6Wpw9pkLVZ api: host: 0.0.0.0 port: 8080 ssl: enabled: false cert: /srv/wings/node01.yourdomain.com-chain.pem key: /srv/wings/node01.yourdomain.com-key.pem upload_limit: 100 system: data: /srv/daemon-data archive_directory: /srv/daemon-data/.archives username: pterodactyl timezone_path: /etc/timezone set_permissions_on_boot: true detect_clean_exit_as_crash: false sftp: use_internal: true disable_disk_checking: false bind_address: 0.0.0.0 bind_port: 2022 read_only: false docker: network: interface: 172.18.0.1 name: pterodactyl_nw driver: bridge update_images: true socket: /var/run/docker.sock timezone_path: /etc/timezone disk_check_timeout: 30 throttles: kill_at_count: 5 decay: 10 bytes: 4096 check_interval: 100 remote: 'http://yourdomain.com'

  1. start the wings like this: /srv/wings/wings --config /srv/wings/config.yml
  2. Go to your panel, and create a server and then try to start it. See in the wings the error.

wingsError

Expected behavior 1.) I want to be able to start the server. 2.) It might be handy that the error will be handled properly, instead of going into a Go panic mode.

parkervcp commented 4 years ago

I have questions about the server game you had set and any variables you had for it.

Wings handled the panic just fine and recovered from it, not crashing.

MilesMadd commented 4 years ago

I never said it crashes, just that it goes into panic mode. But anyway here are the server details image image image

MilesMadd commented 4 years ago

But it is also happening when i try and use another egg.

image

parkervcp commented 4 years ago

So the server starts?

MilesMadd commented 4 years ago

No, it just displays that it changed the egg

parkervcp commented 4 years ago

I can reproduce this regularly. I am working on testing with a vanilla egg too.

parkervcp commented 4 years ago
2020/05/07 04:08:49 [Recovery] 2020/05/07 - 04:08:49 panic recovered:
GET /api/servers/041f17fb-df01-475b-b156-aceb8a62d9f0/ws HTTP/1.1
Host: <domain>:8080
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.5
Cache-Control: no-cache
Connection: keep-alive, Upgrade
Cookie: pterodactyl_session=eyJpdiI6IkV5ZTZGQzhaRklLZms2bGlBWGR4Y2c9PSIsInZhbHVlIjoiRUI0a1lzXC93M1dhanlKMGo4VEJlQUltSnRQMkhBMGlPeXFcL0tXN3dZM0J1V3RMRFV4UCtRTlA0STZORnJGMFl5IiwibWFjIjoiN2I0ZTg2NGNjYmZhZTNjZWE3M2JjOTBhM2FlZjRiN2RjMzY5Yzk2YWQ1NTI4ZWMwZWNjN2ZhZjIxN2RlYWNkZSJ9; XSRF-TOKEN=eyJpdiI6IktGdkpKRnpTTE1IbzRSc1dUTHNCaWc9PSIsInZhbHVlIjoiVGg5eWRVXC84bEZMWnVlZisyaWRaaWFQNGFRYWtMNWZ0d0c3ZTFzUUp5aUlvZjMwbjV5QVpUdVY4MUV2bUtCVkkiLCJtYWMiOiI0ZDdjZDU2ZTgxN2I0MjhhZTg5NGVhNjBmMTAwMjRhOTRlMmFjZjMxYTM4MTE1YTkyYTlhZDdjZmU0MjliMDUwIn0%3D; remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6Ik1QQThHRFU2OFwvbXQzazdNVzVCMWhRPT0iLCJ2YWx1ZSI6ImNsc1V1MHFHVk1yVFRjTVMxc2pjYUFHWjhsMUlHTEtZVHpQY1NEajBCdDNVU1RmZXFOSW5RSEpXZ1dBdm1udnBpc2xna01IeHd5R2Y4Nzl5ZzdPMFcrOHdHQklZXC93MFpTTk44QzcyVkprWmxvUEtjdkhmTno5OWpMXC9yTVRIMEdHV29GWjBaZ2Y4Y242QjM4VXZ1aHdYT2oyaEFrSmtpajM4N1FOUlNGYkZZPSIsIm1hYyI6ImJhOWIyNjFiY2EyMzBjZjNhNThjYmQ5MzljYjRmZWRlYmY3YzhlNGM0NGE3NWFlYzVlNWE5MDc2MDkyM2FlZTcifQ%3D%3D
Origin: <domain>
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate
Sec-Websocket-Key: +UlqDfi9znvS1pUIwidlJw==
Sec-Websocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:212 (0x44d319)
/usr/local/go/src/runtime/signal_unix.go:695 (0x44d168)
/go/wings/server/environment_docker.go:206 (0xc62221)
/go/wings/router/websocket/websocket.go:242 (0xc8f068)
/go/wings/router/router_server_ws.go:55 (0xca0ba9)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa51dba)
/go/wings/router/middleware.go:66 (0xc9bc5c)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa51dba)
/go/wings/router/middleware.go:16 (0xc9b6fa)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa51dba)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/recovery.go:83 (0xa6560f)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa51dba)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/logger.go:241 (0xa64740)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa51dba)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:409 (0xa5bca5)
/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:367 (0xa5b37d)
/usr/local/go/src/net/http/server.go:2807 (0x790492)
/usr/local/go/src/net/http/server.go:1895 (0x78be0b)
/usr/local/go/src/runtime/asm_amd64.s:1373 (0x4692b0)

[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 200 with 500
[GIN] 2020/05/07 - 04:08:49 | 500 |  1.686574589s |      172.21.0.1 | GET      "/api/servers/041f17fb-df01-475b-b156-aceb8a62d9f0/ws"
parkervcp commented 4 years ago

This is affecting both stock eggs (minecraft vanilla) and my own (factorio)

Trickfilm400 commented 4 years ago
GET /api/servers/62a1931c-15c7-4469-9d0d-3e148ddaa192/ws HTTP/1.1
Host: <host-url>9999
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Cache-Control: no-cache
Connection: Upgrade
Origin: https://<url>
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits
Sec-Websocket-Key: YVXxuJLgJ2AOrU1pzd3XPQ==
Sec-Websocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/panic.go:82 (0x443050)
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/signal_unix.go:390 (0x442e7f)
/Users/dane/Sites/development/code/wings/server/environment_docker.go:206 (0xc864a8)
/Users/dane/Sites/development/code/wings/router/websocket/websocket.go:242 (0xcb46b7)
/Users/dane/Sites/development/code/wings/router/router_server_ws.go:55 (0xcc6b06)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/Sites/development/code/wings/router/middleware.go:66 (0xcc173f)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/Sites/development/code/wings/router/middleware.go:16 (0xcc11ba)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/recovery.go:83 (0xa72d29)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/logger.go:241 (0xa71e50)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:409 (0xa68fdc)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:367 (0xa686ae)
/usr/local/Cellar/go/1.12.1/libexec/src/net/http/server.go:2774 (0x77fdf7)
/usr/local/Cellar/go/1.12.1/libexec/src/net/http/server.go:1878 (0x77b9e0)
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/asm_amd64.s:1337 (0x45cbf0)

I can reproduce it too, panel version beta 3 wings verion beta3

other nodes in beta1 seems to have no issue

DaneEveritt commented 4 years ago

I cannot reproduce this error with the steps provided. I created new servers while the daemon was running and was able to not only watch the installation process, but also access the websocket once it was created.

I was also able to delete the server from the panel with no issues or panic's thrown.

Please provide a written list of steps needed in order to reproduce this, because with the information given (which is not much) I can't make it happen. For context, providing the error stack is helpful, but it is completely useless without you providing the steps that led up to the crash.

Please also include the output when you start the daemon, just to confirm we're all running the right versions.

Trickfilm400 commented 4 years ago

The panel was installed with beta1, migrated to beta2 and migrated to beta3 The deamon is installed on a Proxmox LXC with docker (still working on two different beta2 nodes) After trying to update one node to beta3 (which failed with the above error, we tried to create a new beta3 node, which failed too, even on different proxmox nodes.

Feel free to ask further questions if I forgot something

MilesMadd commented 4 years ago

I cannot reproduce this error with the steps provided. I created new servers while the daemon was running and was able to not only watch the installation process, but also access the websocket once it was created.

I was also able to delete the server from the panel with no issues or panic's thrown.

Please provide a written list of steps needed in order to reproduce this, because with the information given (which is not much) I can't make it happen. For context, providing the error stack is helpful, but it is completely useless without you providing the steps that led up to the crash.

Please also include the output when you start the daemon, just to confirm we're all running the right versions.

I wasnt talking about the installation process or the delete process, i was talking about the startup or restart of the server.

parkervcp commented 4 years ago

As called out in discord. This is not resolved by a daemon restart. The File Manager is fully functional.

Trickfilm400 commented 4 years ago

I created a new node in the panel and installed a Minecraft paper server with the default egg, the nI tried to start the server. Heres the complete output of wings:

root@gh:/srv/wings# ./wings

                     ____
__ Pterodactyl _____/___/_______ _______ ______
\_____\    \/\/    /   /       /  __   /   ___/
   \___\          /   /   /   /  /_/  /___   /
        \___/\___/___/___/___/___    /______/
                            /_______/ v1.0.0-beta.3

Website: https://pterodactyl.io
Source: https://github.com/pterodactyl/wings

Copyright © 2018 - 2020 Dane Everitt & Contributors

1.5889649713235855e+09  info    cmd/root.go:84  using configuration from path: /var/lib/pterodactyl/config.yml
1.5889649713236408e+09  info    cmd/root.go:102 checking for pterodactyl system user "pterodactyl"
1.588964971324061e+09   info    cmd/root.go:107 configured system user  {"username": "pterodactyl", "uid": "998", "gid": "997"}
1.588964971324102e+09   info    cmd/root.go:110 beginning file permission setting on server data directories
1.588964971324246e+09   info    cmd/root.go:114 finished ensuring file permissions
1.5889649714865358e+09  info    cmd/root.go:202 configuring webserver   {"ssl": true, "host": "0.0.0.0", "port": 8080}
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] OPTIONS /api/system               --> github.com/pterodactyl/wings/router.Configure.func1 (4 handlers)
[GIN-debug] GET    /download/backup          --> github.com/pterodactyl/wings/router.getDownloadBackup (4 handlers)
[GIN-debug] GET    /download/file            --> github.com/pterodactyl/wings/router.getDownloadFile (4 handlers)
[GIN-debug] GET    /api/servers/:server/ws   --> github.com/pterodactyl/wings/router.getServerWebsocket (5 handlers)
[GIN-debug] GET    /api/servers/:server/archive --> github.com/pterodactyl/wings/router.getServerArchive (5 handlers)
[GIN-debug] POST   /api/update               --> github.com/pterodactyl/wings/router.postUpdateConfiguration (5 handlers)
[GIN-debug] GET    /api/system               --> github.com/pterodactyl/wings/router.getSystemInformation (5 handlers)
[GIN-debug] GET    /api/servers              --> github.com/pterodactyl/wings/router.getAllServers (5 handlers)
[GIN-debug] POST   /api/servers              --> github.com/pterodactyl/wings/router.postCreateServer (5 handlers)
[GIN-debug] POST   /api/transfer             --> github.com/pterodactyl/wings/router.postTransfer (5 handlers)
[GIN-debug] GET    /api/servers/:server      --> github.com/pterodactyl/wings/router.getServer (7 handlers)
[GIN-debug] PATCH  /api/servers/:server      --> github.com/pterodactyl/wings/router.patchServer (7 handlers)
[GIN-debug] DELETE /api/servers/:server      --> github.com/pterodactyl/wings/router.deleteServer (7 handlers)
[GIN-debug] GET    /api/servers/:server/logs --> github.com/pterodactyl/wings/router.getServerLogs (7 handlers)
[GIN-debug] POST   /api/servers/:server/power --> github.com/pterodactyl/wings/router.postServerPower (7 handlers)
[GIN-debug] POST   /api/servers/:server/commands --> github.com/pterodactyl/wings/router.postServerCommands (7 handlers)
[GIN-debug] POST   /api/servers/:server/install --> github.com/pterodactyl/wings/router.postServerInstall (7 handlers)
[GIN-debug] POST   /api/servers/:server/reinstall --> github.com/pterodactyl/wings/router.postServerReinstall (7 handlers)
[GIN-debug] POST   /api/servers/:server/archive --> github.com/pterodactyl/wings/router.postServerArchive (7 handlers)
[GIN-debug] GET    /api/servers/:server/files/contents --> github.com/pterodactyl/wings/router.getServerFileContents (7 handlers)
[GIN-debug] GET    /api/servers/:server/files/list-directory --> github.com/pterodactyl/wings/router.getServerListDirectory (7 handlers)
[GIN-debug] PUT    /api/servers/:server/files/rename --> github.com/pterodactyl/wings/router.putServerRenameFile (7 handlers)
[GIN-debug] POST   /api/servers/:server/files/copy --> github.com/pterodactyl/wings/router.postServerCopyFile (7 handlers)
[GIN-debug] POST   /api/servers/:server/files/write --> github.com/pterodactyl/wings/router.postServerWriteFile (7 handlers)
[GIN-debug] POST   /api/servers/:server/files/create-directory --> github.com/pterodactyl/wings/router.postServerCreateDirectory (7 handlers)
[GIN-debug] POST   /api/servers/:server/files/delete --> github.com/pterodactyl/wings/router.postServerDeleteFile (7 handlers)
[GIN-debug] POST   /api/servers/:server/backup --> github.com/pterodactyl/wings/router.postServerBackup (7 handlers)
[GIN-debug] DELETE /api/servers/:server/backup/:backup --> github.com/pterodactyl/wings/router.deleteServerBackup (7 handlers)
[GIN-debug] Listening and serving HTTPS on 0.0.0.0:8080
1.5889649714869885e+09  info    sftp    sftp-server@v1.1.1/server.go:128        sftp subsystem listening for connections        {"host": "0.0.0.0", "port": 2022}
[GIN] 2020/05/08 - 19:09:37 | 202 |   46.713541ms |  <panel-ip> | POST     "/api/servers"
1.5889649878697462e+09  error   installer/installer.go:124      failed to create environment for server {"server": "4d31afb0-789f-40e6-a88b-3232e96dce4d", "error": "Error response from daemon: Minimum memoryswap limit should be larger than memory limit, see usage", "errorVerbose": "Error response from daemon: Minimum memoryswap limit should be larger than memory limit, see usage\ngithub.com/pterodactyl/wings/server.(*DockerEnvironment).Create\n\t/Users/dane/Sites/development/code/wings/server/environment_docker.go:657\ngithub.com/pterodactyl/wings/installer.(*Installer).Execute\n\t/Users/dane/Sites/development/code/wings/installer/installer.go:123\ngithub.com/pterodactyl/wings/router.postCreateServer.func1\n\t/Users/dane/Sites/development/code/wings/router/router_system.go:59\nruntime.goexit\n\t/usr/local/Cellar/go/1.12.1/libexec/src/runtime/asm_amd64.s:1337"}
github.com/pterodactyl/wings/installer.(*Installer).Execute
        /Users/dane/Sites/development/code/wings/installer/installer.go:124
github.com/pterodactyl/wings/router.postCreateServer.func1
        /Users/dane/Sites/development/code/wings/router/router_system.go:59
1.5889649879129016e+09  info    server/install.go:70    beginning installation process for server       {"server": "4d31afb0-789f-40e6-a88b-3232e96dce4d"}
1.5889649905338988e+09  info    server/install.go:347   creating installer container for server process {"server": "4d31afb0-789f-40e6-a88b-3232e96dce4d"}
1.5889649905772047e+09  info    server/install.go:353   running installation script for server in container     {"server": "4d31afb0-789f-40e6-a88b-3232e96dce4d", "container_id": "26f43653a22a91af856d904923e58582fe5d0513ff1965ce77a6619ad197ed99"}
1.5889649943744822e+09  info    server/install.go:76    completed installation process for server       {"server": "4d31afb0-789f-40e6-a88b-3232e96dce4d"}

2020/05/08 19:10:21 [Recovery] 2020/05/08 - 19:10:21 panic recovered:
GET /api/servers/4d31afb0-789f-40e6-a88b-3232e96dce4d/ws HTTP/1.1
Host: gh2.****.de:8080
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Cache-Control: no-cache
Connection: Upgrade
Cookie: experimentation_subject_id=ImY2ZDVlZTUyLWQ1NDQtNDdjMC1iNzE5LTMxMWZlNDExNjQ0MiI%3D--34d54dfea1d7a7d8a2bd4cde04978c31e4294f02
Origin: https://domain.de
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits
Sec-Websocket-Key: CFS6s3HWLdJh5hfTPPGi8w==
Sec-Websocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/panic.go:82 (0x443050)
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/signal_unix.go:390 (0x442e7f)
/Users/dane/Sites/development/code/wings/server/environment_docker.go:206 (0xc864a8)
/Users/dane/Sites/development/code/wings/router/websocket/websocket.go:242 (0xcb46b7)
/Users/dane/Sites/development/code/wings/router/router_server_ws.go:55 (0xcc6b06)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/Sites/development/code/wings/router/middleware.go:66 (0xcc173f)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/Sites/development/code/wings/router/middleware.go:16 (0xcc11ba)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/recovery.go:83 (0xa72d29)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/logger.go:241 (0xa71e50)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/context.go:156 (0xa5ed59)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:409 (0xa68fdc)
/Users/dane/go/pkg/mod/github.com/gin-gonic/gin@v1.6.2/gin.go:367 (0xa686ae)
/usr/local/Cellar/go/1.12.1/libexec/src/net/http/server.go:2774 (0x77fdf7)
/usr/local/Cellar/go/1.12.1/libexec/src/net/http/server.go:1878 (0x77b9e0)
/usr/local/Cellar/go/1.12.1/libexec/src/runtime/asm_amd64.s:1337 (0x45cbf0)

[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 200 with 500
[GIN] 2020/05/08 - 19:10:21 | 500 |   1.48670281s |    <my-ip-addr> | GET      "/api/servers/4d31afb0-789f-40e6-a88b-3232e96dce4d/ws"

Maybe the error from the Docker daemon: Error response from daemon: Minimum memoryswap limit should be larger than memory limit, see usage causes the problem (The testserver was created with 4096 MB ram, Allocated swap 0 and 4GB of disk space, the proxmox lxc has 8G root disk, 4GB RAM and 4.5GB swap)

docker ps -a

root@gh:/srv# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
b4a37254f538        hello-world         "/hello"            13 minutes ago      Exited (0) 13 minutes ago                       modest_austin
root@gh:/srv#

(the hello-world docker runs successfully with docker run hello-world, but no other docker containers are created, but downloaded)

root@gh:/srv# docker image ls
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
alpine                     3.9                 78a2ce922f86        2 weeks ago         5.55MB
quay.io/pterodactyl/core   java                561f7d202979        7 weeks ago         303MB
hello-world                latest              bf756fb1ae65        4 months ago        13.3kB
root@gh:/srv#
parkervcp commented 4 years ago

@MilesMadd can you run a few commands please? sudo docker info sudo snap list

MilesMadd commented 4 years ago

image

parkervcp commented 4 years ago

To be sure that it wasn't an issue I have disabled selinux and firewalld on my CentOS 8 test box and this is still an issue.

DaneEveritt commented 4 years ago

@Trickfilm400 thanks for the detailed info! What I believe is happening is that the Execute() step throws an error creating the container, but the install process is still executed and a server is created.

What then happens is that you connect to the socket and attempt to start it, at which point wings makes the (incorrect) assumption that there is a container already existing.

https://github.com/pterodactyl/wings/blob/7bba1d4fd6abf602ca3389e366ad24c9cc296893/server/environment_docker.go#L200-L210

As you can see in this block of code, I check for a client.IsErrNotFound() when inspecting the container. This is good! However, I don't actually do anything after that check to create the container, so the c.State.Running causes the nil-pointer panic because c is nil at this point when the container doesn't exist.

Edit: This is actually easily replicated by stopping the server, and deleting the container. Wings cannot properly recover from that state when the server is started this way with the code fixes below.

DaneEveritt commented 4 years ago

Tenatively closing this as @parkervcp was able to confirm it is fixed. Going to go ahead and release a new build to avoid the constant crashing for y'all.

DaneEveritt commented 4 years ago

This is released in 1.0.0-beta.4.

https://github.com/pterodactyl/wings/releases/tag/v1.0.0-beta.4