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.31k stars 1.55k forks source link

Issues when running Wings with Podman #4928

Open RealTriassic opened 7 months ago

RealTriassic commented 7 months ago

Current Behavior

Out of curiosity and boredom, I decided to try Podman with Wings after seeing that some people have gotten it working, but ran into a couple issues that prevent this from working smoothly.

Stacktrace: Error response from daemon: Not Found environment/docker: could not update container github.com/pterodactyl/wings/environment/docker.(Environment).InSituUpdate github.com/pterodactyl/wings/environment/docker/container.go:129 github.com/pterodactyl/wings/server.(Server).SyncWithEnvironment github.com/pterodactyl/wings/server/update.go:51 github.com/pterodactyl/wings/server.(Server).Sync github.com/pterodactyl/wings/server/server.go:200 github.com/pterodactyl/wings/server.(Server).onBeforeStart github.com/pterodactyl/wings/server/power.go:174 github.com/pterodactyl/wings/server.(Server).HandlePowerAction github.com/pterodactyl/wings/server/power.go:131 github.com/pterodactyl/wings/router/websocket.(Handler).HandleInbound github.com/pterodactyl/wings/router/websocket/websocket.go:363 github.com/pterodactyl/wings/router.getServerWebsocket.func3 github.com/pterodactyl/wings/router/router_server_ws.go:85 runtime.goexit runtime/asm_amd64.s:1598


- **Additionally, the server will refuse to boot if the server's OOM killer is not enabled with the following error**

ERROR: [Nov 18 14:50:35.719] failed to handle server crash error=failed to start server after crash detection: environment/docker: failed to attach to container: environment/docker: error while attaching to container: unable to upgrade to tcp, received 409 server=89b3e647-dc1a-4a58-85d8-7e35b7d0ab1c

Stacktrace: unable to upgrade to tcp, received 409 environment/docker: error while attaching to container github.com/pterodactyl/wings/environment/docker.(Environment).Attach github.com/pterodactyl/wings/environment/docker/container.go:61 github.com/pterodactyl/wings/environment/docker.(Environment).Start github.com/pterodactyl/wings/environment/docker/power.go:121 github.com/pterodactyl/wings/server.(Server).HandlePowerAction github.com/pterodactyl/wings/server/power.go:135 github.com/pterodactyl/wings/server.(Server).handleServerCrash github.com/pterodactyl/wings/server/crash.go:90 github.com/pterodactyl/wings/server.(*Server).OnStateChange.func1 github.com/pterodactyl/wings/server/server.go:324 runtime.goexit runtime/asm_amd64.s:1598

environment/docker: failed to attach to container failed to start server after crash detection github.com/pterodactyl/wings/server.(Server).handleServerCrash github.com/pterodactyl/wings/server/crash.go:90 github.com/pterodactyl/wings/server.(Server).OnStateChange.func1 github.com/pterodactyl/wings/server/server.go:324 runtime.goexit runtime/asm_amd64.s:1598


and this is printed to the server's console:

container@pterodactyl~ Error Event [146a8c18-d9b2-4c30-9f94-5f1dee081c9b]: environment/docker: failed to attach to container: environment/docker: error while attaching to container: unable to upgrade to tcp, received 409



### Expected Behavior

If actually supported, which I hope it is, Podman should work with Wings without any issues, just like if you were using Docker.

### Steps to Reproduce

1. Install Wings using the step-by-step tutorial provided [here](https://pterodactyl.io/wings/1.0/installing.html).
2. Make the following changes to your Wings configuration (`config.yml`):
 - `system.enable_log_rotate` **true** -> false
 - `docker.log_config.type` **"local"** -> ""

There might be solutions that don't require disabling logging, but I am not sure.

Noticed in the Discord that you might need to change these too:
 - `system.check_permissions_on_boot` **true** -> false
 - `docker.use_performant_inspect` **true** -> false

I tried with and without the 2 configuration changes above and noticed no difference in functionality, so they may not be needed.

3. Observe the errors I mentioned above in the issue report.

### Panel Version

1.11.5

### Wings Version

1.11.8

### Games and/or Eggs Affected

_No response_

### Docker Image

_No response_

### Error Logs

_No response_

### Is there an existing issue for this?

- [X] I have searched the existing issues before opening this issue.
- [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
- [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
rhatdan commented 5 months ago

You probably have to set the DOCKER_HOST environment variable to point at the podman.sock socket.

RealTriassic commented 5 months ago

You probably have to set the DOCKER_HOST environment variable to point at the podman.sock socket.

This was already done, otherwise servers wouldn't be able to start even with all the workarounds mentioned above.

matthewpi commented 5 months ago

I am aware of the first two parts of this issue (OOM killer and the weird container update errors). I'm unsure why the container update errors out, or what exactly causes it, but everything seems to work fine regardless.

The HTTP 409 error is interesting as it was either fixed in a later Podman release or there was a regression in Wings or the Docker API somewhere.

leonpano2006 commented 4 months ago

I am aware of the first two parts of this issue (OOM killer and the weird container update errors). I'm unsure why the container update errors out, or what exactly causes it, but everything seems to work fine regardless.

The HTTP 409 error is interesting as it was either fixed in a later Podman release or there was a regression in Wings or the Docker API somewhere.

Oom killer is caused by CgroupV2 Disabling OOM killer is not possible at all on cgroupV2 crun will give error