From b2b8177982f8cd2f5750bb1c8543b7d665dc99cd Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 25 Sep 2026 23:25:39 +0200 Subject: [PATCH] fix(proxy): run legacy Traefik label migration outside a transaction In Postgres one failed server update aborts a shared transaction, so all later queries fail and the upgrade stops. Save each server on its own so that one failure affects only that server. Co-Authored-By: Claude Opus 5.5 --- ...09_25_210000_remove_legacy_traefik_dashboard_labels.php | 5 +++++ tests/Feature/Proxy/LegacyTraefikDashboardLabelsTest.php | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/database/migrations/2026_09_25_210000_remove_legacy_traefik_dashboard_labels.php b/database/migrations/2026_09_25_210000_remove_legacy_traefik_dashboard_labels.php index 19a745b614..9bab033205 100644 --- a/database/migrations/2026_09_25_210000_remove_legacy_traefik_dashboard_labels.php +++ b/database/migrations/2026_09_25_210000_remove_legacy_traefik_dashboard_labels.php @@ -6,6 +6,11 @@ use Illuminate\Support\Facades\Log; return new class extends Migration { + /** + * Save each server on its own. In Postgres one failed update aborts a shared transaction and stops the upgrade. + */ + public $withinTransaction = false; + /** * Remove the Traefik dashboard router labels from saved proxy configurations. * Only the database is changed. The proxy shows a restart notice and applies the fix on the next restart. diff --git a/tests/Feature/Proxy/LegacyTraefikDashboardLabelsTest.php b/tests/Feature/Proxy/LegacyTraefikDashboardLabelsTest.php index dd5b9d2bc3..dc8fefc3af 100644 --- a/tests/Feature/Proxy/LegacyTraefikDashboardLabelsTest.php +++ b/tests/Feature/Proxy/LegacyTraefikDashboardLabelsTest.php @@ -141,6 +141,13 @@ test('the migration fixes saved legacy configurations without connecting to serv ->and($caddy->fresh()->proxy->last_saved_proxy_configuration)->toBe('services: {}'); }); +test('the migration saves each server outside one shared transaction', function () { + // In Postgres one failed update aborts a shared transaction, so later servers could not be saved. + $migration = require database_path('migrations/2026_09_25_210000_remove_legacy_traefik_dashboard_labels.php'); + + expect($migration->withinTransaction)->toBeFalse(); +}); + test('the pending proxy notice asks the user to restart the proxy', function () { $team = Team::factory()->create(); $user = User::factory()->create();