From e5cc07593887a86933a28c9001622a328f30661c Mon Sep 17 00:00:00 2001 From: jwed Date: Sun, 24 May 2026 20:43:10 -0400 Subject: [PATCH] fix(banded ssid): treat "PPSK not on this band" as a quiet skip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sibling-rotation path's "Embedded PPSK not found" error was being surfaced to the operator as a failure, but it's not — it just means the PPSK isn't mirrored on that band (GUEST was configured on one band only, which is a perfectly valid setup). Logging this as a sibling failure also poisoned the cron run status to "partial". Now: "not found"-style errors from updateEmbeddedPpsk on a sibling become info-level log entries and the loop continues. Other errors (API failures, permissions, etc.) still surface as warnings/failures. v1.10.1. Co-Authored-By: Claude Opus 4.7 (1M context) --- composer.json | 2 +- src/Console/RotatePasswords.php | 12 ++++++++++++ src/Http/Controllers/WifiController.php | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 721f4ab..e3f26d7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "dashboard/unifi", "description": "UniFi network management, WiFi stats, and captive portal authentication for the Dashboard platform", - "version": "1.10.0", + "version": "1.10.1", "type": "library", "license": "MIT", "autoload": { diff --git a/src/Console/RotatePasswords.php b/src/Console/RotatePasswords.php index 8468b54..4f39516 100644 --- a/src/Console/RotatePasswords.php +++ b/src/Console/RotatePasswords.php @@ -104,6 +104,18 @@ class RotatePasswords extends Command ]); } } catch (\Throwable $e) { + // "Not found" in a sibling just means the + // PPSK isn't mirrored on that band — totally + // normal if GUEST was only configured on one + // band. Skip quietly; don't poison the + // run status. + if (str_contains($e->getMessage(), 'not found')) { + \Illuminate\Support\Facades\Log::info('unifi.ppsk_sibling_skipped', [ + 'sibling_wlan' => $siblingWlanId, + 'ppsk_name' => $ppsk->name, + ]); + continue; + } $this->error("Sibling rotate failed for wlan {$siblingWlanId}: {$e->getMessage()}"); $failedPpsks[] = ['name' => $ppsk->name . ' (sibling wlan ' . $siblingWlanId . ')', 'error' => $e->getMessage()]; } diff --git a/src/Http/Controllers/WifiController.php b/src/Http/Controllers/WifiController.php index 7ac9f66..fdd0beb 100644 --- a/src/Http/Controllers/WifiController.php +++ b/src/Http/Controllers/WifiController.php @@ -314,7 +314,11 @@ class WifiController extends Controller ]); } } catch (\Throwable $e) { - \Illuminate\Support\Facades\Log::warning('unifi.ppsk_sibling_update_failed', [ + // PPSK absent on this band is fine — just + // means it isn't mirrored. Anything else + // gets warning-logged. + $level = str_contains($e->getMessage(), 'not found') ? 'info' : 'warning'; + \Illuminate\Support\Facades\Log::log($level, 'unifi.ppsk_sibling_update', [ 'sibling_wlan' => $siblingWlanId, 'error' => $e->getMessage(), ]);