Skip to content

Commit 79673ca

Browse files
committed
Don't ever block storing node updates if wings returns an error; closes pterodactyl#2712
1 parent 11054de commit 79673ca

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

app/Services/Nodes/NodeUpdateService.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Str;
66
use Pterodactyl\Models\Node;
7+
use Illuminate\Support\Facades\Log;
78
use GuzzleHttp\Exception\ConnectException;
89
use Illuminate\Database\ConnectionInterface;
910
use Illuminate\Contracts\Encryption\Encrypter;
@@ -90,11 +91,17 @@ public function handle(Node $node, array $data, bool $resetToken = false)
9091

9192
$this->configurationRepository->setNode($node)->update($updated);
9293
} catch (DaemonConnectionException $exception) {
93-
if (! is_null($exception->getPrevious()) && $exception->getPrevious() instanceof ConnectException) {
94-
return [$updated, true];
95-
}
94+
Log::warning($exception, ['node_id' => $node->id]);
9695

97-
throw $exception;
96+
// Never actually throw these exceptions up the stack. If we were able to change the settings
97+
// but something went wrong with Wings we just want to store the update and let the user manually
98+
// make changes as needed.
99+
//
100+
// This avoids issues with proxies such as CloudFlare which will see Wings as offline and then
101+
// inject their own response pages, causing this logic to get fucked up.
102+
//
103+
// @see https://github.com/pterodactyl/panel/issues/2712
104+
return [ $updated, true ];
98105
}
99106

100107
return [$updated, false];

0 commit comments

Comments
 (0)