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.84k stars 1.75k forks source link

Failed transfer causes server deadlock #4505

Open devnote-dev opened 2 years ago

devnote-dev commented 2 years ago

Current Behavior

When transferring a server, if the connection to the node is interrupted, the transfer fails and the server is completely unusable: it cannot be accessed via the client or admin panel, nor can its state be overridden in the panel. The same occurs when trying to transfer a running server (see #4244). Attempting to change the status of a server in this state results in a HTTP 409 Conflict response.

Expected Behavior

When a server transfer fails, there should be an option to recover the server. The transfer service does not modify the server or its contents meaning that it is still usable (and this can be proved if you manually resolve the state conflict). There should be a dedicated status for when a server is transferring and one for if that transfer fails. The current system relies on the transfer property of a server which isn't a reliable way of tracking a server's transfer progress and doesn't follow existing tracking systems (e.g. server installs, server suspension, etc). It also doesn't allow the server to be transferred again afterwards.

Steps to Reproduce

  1. Initiate the transfer process
  2. Interrupt the node (i.e. terminate its connection, kill it, etc)

or alternatively:

  1. Start a server (preferably a Minecraft server)
  2. Initiate the transfer process

Panel Version

1.10.4

Wings Version

1.7.2

Games and/or Eggs Affected

N/A

Docker Image

N/A

Error Logs

Unavailable

Is there an existing issue for this?

dftzippo commented 2 years ago

Hello! Literally the same thing is happening to me I think. It should be noted that in Pterodactyl Panel 1.10.1 and Wings 1.70 this did not happen to me. I also have this error in Pterodactyl Panel 1.10.4 and Wings 1.7.2. I should also point out that the nodes are on but when it says "Transfer has failed" the red banner appears that it cannot connect to the node. I am attaching an image below. Picsart_22-10-29_08-55-04-413

dftzippo commented 2 years ago

Apparently when you get the transfer failed error Wings crashes and that's why you get the connection error with the node in the panel (that is, the red banner) Picsart_22-11-01_15-50-44-273

dftzippo commented 2 years ago

In fact, do you have any temporary solution to be able to transfer without getting an error in most attempts?

devnote-dev commented 2 years ago

@dftzippo Thanks for the update, based on your logs the issue seems to be coming from archive.go#L85, meaning that at some point in router_transfer.go it fails to stop the ticker in time (or at all), hence the panic.

In fact, do you have any temporary solution to be able to transfer without getting an error in most attempts?

I would need to see the full logs to figure out the cause of the failure, feel free to post them here or message me on Discord. 👍

matthewpi commented 2 years ago

Apparently when you get the transfer failed error Wings crashes and that's why you get the connection error with the node in the panel (that is, the red banner) Picsart_22-11-01_15-50-44-273

This error is fixed by pterodactyl/wings@f577f55

dftzippo commented 2 years ago

In any case, you should modify manually or through a normal wings update

VetheonGames commented 2 years ago

For anyone viewing this, while they are working on the official fix for this, here are instructions for recovering your server from the state (if you don't already know)

USE WITH CAUTION If your server is actually just transferring and not actually stuck this WILL result in file deletion!!

Step 1) log into your pterodactyl database (typically named panel )

Step 2) Navigate to the server_transfers table

Step 3) Find the any row that says NULL in it

Step 4) Delete the row

The transfer has now been aborted and you can restart the transfer.

To ensure it completes, make sure the server is off and Wings won't get interrupted and the panel won't get disconnected from the new node while it's happening.

If your server gets stuck again, repeat these steps.

KewaiiGamer commented 1 month ago

For anyone viewing this, while they are working on the official fix for this, here are instructions for recovering your server from the state (if you don't already know)

USE WITH CAUTION

If your server is actually just transferring and not actually stuck this WILL result in file deletion!! Step 1) log into your pterodactyl database (typically named panel )

Step 2) Navigate to the server_transfers table

Step 3) Find the any row that says NULL in it

Step 4) Delete the row

The transfer has now been aborted and you can restart the transfer.

To ensure it completes, make sure the server is off and Wings won't get interrupted and the panel won't get disconnected from the new node while it's happening.

If your server gets stuck again, repeat these steps.

Don't forget to remove the allocation that was assigned during the transfer with UPDATE allocations SET server_is = NULL WHERE port = <port> AND ip = "IP";

And restart wings afterwards since it will still be locked.