{"record":{"id":"3880c96f2d9b7e97","repo":"Dokploy/dokploy","slug":"scaleway-secret-manager-reason-status-respo","errorCode":null,"errorMessage":"Scaleway Secret Manager: ${reason} (status ${response.status}${detail ? `: ${detail}` : \"\"})","messagePattern":"Scaleway Secret Manager: (.+?) \\(status (.+?)(.+?)` : \"\"\\}\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/utils/vault/scaleway.ts","lineNumber":65,"sourceCode":"\n\tif (response.status === 404 && notFoundMessage) {\n\t\tthrow new Error(`Scaleway Secret Manager: ${notFoundMessage}`);\n\t}\n\n\tlet detail = \"\";\n\ttry {\n\t\tconst body = (await response.json()) as {\n\t\t\tmessage?: string;\n\t\t\terror?: string;\n\t\t};\n\t\tdetail = body.message ?? body.error ?? \"\";\n\t} catch {}\n\n\tconst reason =\n\t\tresponse.status === 401 || response.status === 403\n\t\t\t? \"authentication failed\"\n\t\t\t: \"request failed\";\n\tthrow new Error(\n\t\t`Scaleway Secret Manager: ${reason} (status ${response.status}${detail ? `: ${detail}` : \"\"})`,\n\t);\n};\n\nconst accessSecret = async (\n\tconfig: ScalewayConfig,\n\tsecretPath: string,\n\tsecretName: string,\n) => {\n\tconst response = await request(\n\t\tconfig,\n\t\t`/secrets-by-path/versions/${REVISION}/access`,\n\t\t{\n\t\t\tproject_id: config.projectId,\n\t\t\tsecret_name: secretName,\n\t\t\tsecret_path: secretPath,\n\t\t},\n\t\t`secret \"${secretName}\" not found in path \"${secretPath}\"`,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/utils/vault/scaleway.ts#L47-L83","documentation":"Generic failure thrown by the Scaleway Secret Manager request helper for any non-OK response other than a handled 404. It distinguishes authentication failures (401/403) from other request failures and appends the HTTP status plus any message parsed from the JSON error body.","triggerScenarios":"Any Scaleway API call where the token is invalid/expired (401/403), or the request fails with another status (e.g. 429 rate limit, 500, network-level proxy error surfaced as non-OK). Raised from request() called via response() or testConnection().","commonSituations":"Expired or revoked Scaleway API token; token lacking Secret Manager read permissions; wrong project/region causing 403; hitting Scaleway rate limits; mistyped access key.","solutions":["Regenerate the Scaleway API token and update the vault config, then run testConnection","Ensure the token's IAM policy grants secret_manager read access on the target project","Check the status code in the message: 401/403 means credentials, otherwise inspect the detail body for rate limiting or server errors","Verify region/project settings in the config"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-flight the token with a cheap authenticated call\nconst res = await fetch('https://api.scaleway.com/account/v1/projects', {\n  headers: { 'X-Auth-Token': config.apiToken },\n});\nif (res.status === 401 || res.status === 403) throw new Error('Scaleway token invalid — rotate it');","typeGuard":null,"tryCatchPattern":"try {\n  await vault.testConnection();\n} catch (e) {\n  const m = e instanceof Error ? e.message : '';\n  if (m.includes('authentication failed')) rotateToken();\n  else if (m.includes('status 429')) await backoffAndRetry();\n  else throw e;\n}","preventionTips":["Automate Scaleway token rotation before expiry","Grant least-privilege secret_manager.read IAM policy","Monitor testConnection results in CI for vault configs"],"tags":["scaleway","secret-manager","vault","auth","http-error"],"backgroundTag":"vault-authentication-failed","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}