diff --git a/server/lib/dbRetry.ts b/server/lib/dbRetry.ts index 7f8d1eea8..9dcf84c7c 100644 --- a/server/lib/dbRetry.ts +++ b/server/lib/dbRetry.ts @@ -71,7 +71,7 @@ export async function withRetry( const jitter = Math.random() * baseDelay; const delay = baseDelay + jitter; logger.warn( - `Transient DB error in ${context}, retrying attempt ${attempt}/${maxRetries} after ${delay.toFixed(0)}ms`, + `Transient DB issue in ${context}, retrying attempt ${attempt}/${maxRetries} after ${delay.toFixed(0)}ms`, { code: error?.code ?? error?.cause?.code } ); await new Promise((resolve) => setTimeout(resolve, delay)); diff --git a/server/private/routers/hybrid.ts b/server/private/routers/hybrid.ts index bf3afa382..caad19732 100644 --- a/server/private/routers/hybrid.ts +++ b/server/private/routers/hybrid.ts @@ -2478,7 +2478,12 @@ hybridRouter.post( destinations: destinations }); } catch (error) { - logger.error(error); + if (!( + error instanceof Error && + error.message === "Exit node not allowed" + )) { + logger.error(error); + } return next( createHttpError( HttpCode.INTERNAL_SERVER_ERROR, diff --git a/server/routers/olm/handleOlmServerInitAddPeerHandshake.ts b/server/routers/olm/handleOlmServerInitAddPeerHandshake.ts index b3aaffb93..6bad5b89b 100644 --- a/server/routers/olm/handleOlmServerInitAddPeerHandshake.ts +++ b/server/routers/olm/handleOlmServerInitAddPeerHandshake.ts @@ -85,7 +85,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( ); if (!resources || resources.length === 0) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Resource not found` ); await sendCancel(); @@ -94,7 +94,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( if (resources.length > 1) { // error but this should not happen because the nice id cant contain a dot and the alias has to have a dot and both have to be unique within the org so there should never be multiple matches - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Multiple resources found matching the criteria` ); return; @@ -119,7 +119,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( ); if (currentResourceAssociationCaches.length === 0) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Client ${client.clientId} does not have access to resource ${resource.siteResourceId}` ); await sendCancel(); @@ -127,7 +127,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( } if (!resource.networkId) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Resource ${resource.siteResourceId} has no network` ); await sendCancel(); @@ -141,7 +141,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( .where(eq(siteNetworks.networkId, resource.networkId)); if (!siteRows || siteRows.length === 0) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: No sites found for resource ${resource.siteResourceId}` ); await sendCancel(); @@ -164,9 +164,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( } if (sitesToProcess.length === 0) { - logger.error( - `handleOlmServerInitAddPeerHandshake: No sites to process` - ); + logger.warn(`handleOlmServerInitAddPeerHandshake: No sites to process`); await sendCancel(); return; } @@ -193,7 +191,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( } if (!site.exitNodeId) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Site ${site.siteId} has no exit node, skipping` ); continue; @@ -205,7 +203,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( .where(eq(exitNodes.exitNodeId, site.exitNodeId)); if (!exitNode) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: Exit node not found for site ${site.siteId}, skipping` ); continue; @@ -229,7 +227,7 @@ export const handleOlmServerInitAddPeerHandshake: MessageHandler = async ( } if (!handshakeInitiated) { - logger.error( + logger.warn( `handleOlmServerInitAddPeerHandshake: No accessible sites with valid exit nodes found, cancelling chain` ); await sendCancel();