From a824ea3dcf64f1d6b009403caf3775b9cd7932d4 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Thu, 4 Dec 2025 03:37:48 -0500 Subject: [PATCH] chore: spammy log cleanup --- CHANGELOG.md | 3 +++ app/server/headscale/api/index.ts | 9 ++++++--- app/server/web/sessions.ts | 30 +++++++++++------------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89e0eb..92ccddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ - Secret path loading has been reworked from the ground up to be more reliable (closes [#334](https://github.com/tale/headplane/issues/334)). - Added better testing and validation for configuration loading - Re-worked the OIDC integration to adhere to the correct standards and surface more errors to the user. +- Removed several unnecessarily verbose or spammy log messages. +- Updated the minimum Docker API used to support the latest Docker versions (via [#370](https://github.com/tale/headplane/pull/370)). +- Enhanced the node tag dialog to show a dropdown of assignable tags (via [#362](https://github.com/tale/headplane/pull/362)). --- # 0.6.1 (October 12, 2025) diff --git a/app/server/headscale/api/index.ts b/app/server/headscale/api/index.ts index 3705c89..056351f 100644 --- a/app/server/headscale/api/index.ts +++ b/app/server/headscale/api/index.ts @@ -7,7 +7,7 @@ import { Agent, type Dispatcher, request } from 'undici'; import log from '~/utils/log'; import endpointSets, { RuntimeApiClient } from './endpoints'; import { undiciToFriendlyError } from './error'; -import { HeadscaleAPIError } from './error-client'; +import { HeadscaleAPIError, isApiError } from './error-client'; import { detectApiVersion, isAtLeast, type Version } from './version'; /** @@ -238,8 +238,11 @@ export async function createHeadscaleInterface( Object.keys(hashes).length, ); return hashes; - } catch (err) { - log.warn('api', 'Error during OpenAPI polling: %o', err); + } catch (error) { + if (isApiError(error)) { + log.debug('api', 'Failed to fetch OpenAPI spec: %d', error.statusCode); + } + return null; } } diff --git a/app/server/web/sessions.ts b/app/server/web/sessions.ts index 5b0500a..900c41a 100644 --- a/app/server/web/sessions.ts +++ b/app/server/web/sessions.ts @@ -219,36 +219,28 @@ export async function createSessionStorage(options: AuthSessionOptions) { } async function migrateUserDatabase(path: string, db: LibSQLDatabase) { - log.info('config', 'Migrating old user database from %s', path); const realPath = resolve(path); - log.warn( - 'config', - 'oidc.user_storage_file is deprecated and will be removed in Headplane 0.7.0', - ); - log.warn( - 'config', - 'You can ignore this warning if you do not use OIDC authentication.', - ); - log.warn( - 'config', - 'Data will be automatically migrated to the new SQL database.', - ); - log.warn( - 'config', - 'Refer to server.data_path to ensure this path is mounted correctly is using Docker.', - ); - try { const handle = await open(realPath, 'a+'); await handle.close(); } catch (error) { + if ( + error != null && + typeof error === 'object' && + 'code' in error && + error.code === 'ENOENT' + ) { + log.debug('config', 'No old user database file found at %s', realPath); + return; + } + log.warn('config', 'Failed to migrate old user database at %s', realPath); log.warn( 'config', 'This is not an error, but existing users will not be migrated', ); - log.warn('config', 'Unable to open user database file: %s', error); + log.warn('config', 'Unable to open user database file: %s', String(error)); log.debug('config', 'Error details: %s', error); return; }