[Wings] Stop and Kill power actions are silently ignored while a server is starting
Current Behavior
Just to be clear, this is a Wings problem but the wings repo told me to report it here.
Basically if you click Stop or Kill while a server is still in the middle of starting, nothing happens. The panel shows 202 so it looks like it worked, but the action just disappears. Nothing pops up in the panel, no error, nothing. It's actually two different things going on:
Stop - the power endpoint returns 202 before the action actually runs, it happens in a background goroutine. During startup the boot process holds the power lock, so the background stop can't get the lock and just gets dropped. Only trace is this line in the wings log:
- encountered error processing a server power action in the background ...... failed to acquire exclusive lock for power actions
Kill - this one skips the lock completely, so it goes looking for a container to kill, doesn't find one (it's still being created), and does nothing. But it still marks the server as offline even though the boot is still running. Sometimes it also sets off the crash detector:
Server crash was detected but an error occurred while handling it End result either way: the power buttons in the panel show a state the server isn't actually in.
Expected Behavior
Either of these would be fine honestly:
- queue the stop/kill until the boot finishes and then run it, or
- return an error the panel can actually show (like a 409 "server is starting") instead of 202
What I don't expect is the action just vanishing while the API tells me it worked.
Steps to Reproduce
- Start a server that has a slow boot (I used Paper, big jar so startup takes a good 20-30 seconds)
- While it still says Starting, click Stop
- Request goes through with 202, server keeps booting and ends up fully running. The stop never happened, only the lock error in the wings log
- Try the same with Kill during startup - nothing gets killed but the server gets marked offline, and sometimes the crash detector fires too
Panel Version
1.15.1
Wings Version
1.13.3
Games and/or Eggs Affected
Minecraft (Paper). Pretty sure it's not egg specific though, it's just that a slow boot makes it easy to hit. Anything with a noticeable startup window should do it
Docker Image
No response
Error Logs
Is there an existing issue for this?
- I have searched the existing issues before opening this issue. I understand that maintainers may close this issue without communication if I have not provided sufficient information.
Source: pterodactyl/panel