panel icon indicating copy to clipboard operation
panel copied to clipboard

Failed transfer causes server deadlock

Open devnote-dev opened this issue 3 years ago • 8 comments

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?

  • [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.

devnote-dev avatar Oct 30 '22 02:10 devnote-dev

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 avatar Oct 30 '22 13:10 dftzippo

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 avatar Nov 01 '22 21:11 dftzippo

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

dftzippo avatar Nov 01 '22 21:11 dftzippo

@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. 👍

devnote-dev avatar Nov 01 '22 22:11 devnote-dev

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

matthewpi avatar Nov 04 '22 17:11 matthewpi

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

dftzippo avatar Nov 04 '22 17:11 dftzippo

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.

LyrinoxTechnologies avatar Nov 07 '22 18:11 LyrinoxTechnologies

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.

KewaiiGamer avatar Oct 14 '24 13:10 KewaiiGamer