{"record":{"id":"4539eb458335edd2","repo":"linshenkx/prompt-optimizer","slug":"s3-upload-failed-s3errormessage-error","errorCode":null,"errorMessage":"S3 upload failed: ${s3ErrorMessage(error)}","messagePattern":"S3 upload failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ui/src/utils/remote-backup.ts","lineNumber":1603,"sourceCode":"\n  async put(\n    path: string,\n    body: Blob | ArrayBuffer | Uint8Array | string,\n    options?: { contentType?: string },\n  ): Promise<RemoteObjectEntry> {\n    const normalized = normalizeObjectPath(path)\n    const blob = bodyToBlob(body, options?.contentType || JSON_MIME_TYPE)\n    const bytes = await bodyToUint8Array(blob)\n    const contentType = blob.type || options?.contentType || JSON_MIME_TYPE\n    try {\n      await this.client.send(new PutObjectCommand({\n        Bucket: this.config.bucket,\n        Key: this.keyForPath(normalized),\n        Body: bytes,\n        ContentType: contentType,\n      }))\n    } catch (error) {\n      throw new Error(`S3 upload failed: ${s3ErrorMessage(error)}`, { cause: error })\n    }\n    return {\n      path: normalized,\n      sizeBytes: bytes.byteLength,\n      updatedAt: new Date().toISOString(),\n      contentType,\n    }\n  }\n\n  async get(path: string): Promise<ArrayBuffer> {\n    const normalized = normalizeObjectPath(path)\n    let lastError: unknown\n\n    for (let attempt = 1; attempt <= S3_DOWNLOAD_RETRY_ATTEMPTS; attempt += 1) {\n      try {\n        const response = await this.client.send(new GetObjectCommand({\n          Bucket: this.config.bucket,\n          Key: this.keyForPath(normalized),","sourceCodeStart":1585,"sourceCodeEnd":1621,"githubUrl":"https://github.com/linshenkx/prompt-optimizer/blob/3e677b1d9f7e0493c142c175560531e7ae786dce/packages/ui/src/utils/remote-backup.ts#L1585-L1621","documentation":"PutObject failed in the S3-compatible store; the error message from the AWS SDK is wrapped with cause for diagnostics.","triggerScenarios":"put() with invalid credentials, missing s3:PutObject permission, bucket policy blocking writes, oversized body, or network/endpoint failures against S3-compatible storage (R2, MinIO).","commonSituations":"Read-only IAM keys; wrong endpoint for the S3-compatible provider; signature mismatch due to clock skew; MinIO bucket not created.","solutions":["Verify credentials and that IAM allows s3:PutObject on the bucket","Confirm the endpoint URL matches the provider (R2 endpoint, MinIO URL) and the bucket exists","Check server clock skew (breaks SigV4 signing) and body size limits"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await store.put(path, bytes) } catch (e) { const m = (e as Error).message; if (m.includes('SlowDown') || m.includes('RequestTimeout')) await retryWithBackoff(() => store.put(path, bytes)); else throw e }","preventionTips":["Pre-flight credential check","Use backoff on throttling errors"],"tags":["s3","upload","aws-sdk","permissions"],"backgroundTag":"s3-upload-failed","analyzedSha":"3e677b1d9f7e0493c142c175560531e7ae786dce","analyzedAt":"2026-08-27T21:29:16.709Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}