{"record":{"id":"933af5a9374c20e7","repo":"n8n-io/n8n","slug":"request-to-s3-failed-error-message","errorCode":null,"errorMessage":"Request to S3 failed: ${error.message}","messagePattern":"Request to S3 failed: (.+?)","errorType":"exception","errorClass":"UnexpectedError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/blob-storage/src/object-store/object-store.service.ee.ts","lineNumber":377,"sourceCode":"\t\t\t\t\tlastModified: item.LastModified?.toISOString() ?? '',\n\t\t\t\t\teTag: item.ETag ?? '',\n\t\t\t\t\tsize: item.Size ?? 0,\n\t\t\t\t\tstorageClass: item.StorageClass ?? '',\n\t\t\t\t})) ?? [];\n\n\t\t\treturn {\n\t\t\t\tcontents,\n\t\t\t\tisTruncated: response.IsTruncated ?? false,\n\t\t\t\tnextContinuationToken: response.NextContinuationToken,\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tthis.handleS3Error(e);\n\t\t}\n\t}\n\n\tprivate handleS3Error(e: unknown): never {\n\t\tconst error = ensureError(e);\n\t\tthrow new UnexpectedError(`Request to S3 failed: ${error.message}`, { cause: error });\n\t}\n}\n","sourceCodeStart":359,"sourceCodeEnd":380,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/blob-storage/src/object-store/object-store.service.ee.ts#L359-L380","documentation":"UnexpectedError thrown by ObjectStoreService.handleS3Error, the catch-all for any AWS SDK error in put/get/list/getListPage/delete (when not already converted to [255]). It wraps the original via ensureError and preserves it as cause, appending the SDK message.","triggerScenarios":"Any S3 operation throws and is caught by the surrounding try/catch, which calls handleS3Error. Typical sources: NoSuchBucket, AccessDenied, networking/DNS to the endpoint, AWS SDK timeout, region mismatch, or signature errors against an S3-compatible backend.","commonSituations":"Wrong N8N_EXTERNAL_STORAGE_S3_REGION; bucket deleted after startup; IAM credentials rotated but not refreshed in n8n; misconfigured custom endpoint (N8N_EXTERNAL_STORAGE_S3_HOST) for MinIO/Cloudflare R2; clock skew breaking SignatureV4.","solutions":["Read the wrapped message — it carries the AWS SDK error name and detail.","For NoSuchBucket/AccessDenied, re-check bucket name and IAM policy.","For endpoint issues, validate N8N_EXTERNAL_STORAGE_S3_HOST and protocol against the S3-compatible provider.","Sync the host clock (SignatureV4 is time-sensitive)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-flight connectivity check before relying on the service\nawait objectStoreService.init(); // surfaces endpoint/auth issues at startup","typeGuard":"import { UnexpectedError } from 'n8n-workflow';\nconst isS3Failure = (e: unknown): boolean =>\n  e instanceof UnexpectedError && /Request to S3 failed/.test(e.message);","tryCatchPattern":"try {\n  await objectStoreService.put(blobName, body);\n} catch (e) {\n  if (e instanceof UnexpectedError && /Request to S3 failed/.test(e.message)) {\n    const name = (e as any).cause?.name;\n    // NoSuchBucket -> fix config, AccessDenied -> fix IAM, timeout -> backoff\n  }\n  throw e;\n}","preventionTips":["Verify region, endpoint, and credentials with init() at startup.","For S3-compatible backends, confirm the host and signing region match.","Keep the host clock synced (SignatureV4 is time-sensitive)."],"tags":["s3","blob-storage","unexpected","sdk-error","catch-all"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}