{"record":{"id":"56bf4f3379fbd173","repo":"FuelLabs/fuel-core","slug":"while-writing-to-s3-bucket-key-client-e","errorCode":null,"errorMessage":"While writing to S3 Bucket: {}, key: {}: {client_error}","messagePattern":"While writing to S3 Bucket: (.+?), key: (.+?): (.+?)","errorType":"exception","errorClass":"Error::DB","httpStatus":null,"severity":"error","filePath":"crates/services/block_aggregator_api/src/db/remote_cache.rs","lineNumber":268,"sourceCode":"        {\n            return Err(Error::db_error(anyhow!(\n                \"Cannot store block at height {}: current height is {}, expected next height is {}\",\n                height,\n                current_height,\n                next_height\n            )));\n        }\n\n        let key = block_height_to_key(&height);\n        if self.publishes_blocks {\n            let zipped = gzip_bytes(block)?;\n            let body = ByteStream::from(zipped);\n            self.client\n                .put_object(&self.s3_bucket, &key, body)\n                .await\n                .map_err(|e| {\n                    let client_error = format!(\"{e:?}\");\n                    Error::DB(anyhow!(e).context(format!(\n                        \"While writing to S3 Bucket: {}, key: {}: {client_error}\",\n                        self.s3_bucket, key\n                    )))\n                })?;\n        }\n\n        let mut tx = self.local_persisted.write_transaction();\n        tx.storage_as_mut::<LatestBlock>()\n            .insert(&(), &Mode::new_s3(height))\n            .map_err(|e| {\n                Error::DB(\n                    anyhow!(e).context(format!(\n                        \"while storing latest block height: {height:?}\"\n                    )),\n                )\n            })?;\n        tx.commit().map_err(|e| Error::DB(anyhow!(e)))?;\n","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/add100d30d21498e8528c46be8567fbd2ea019af/crates/services/block_aggregator_api/src/db/remote_cache.rs#L250-L286","documentation":"Wrapper around an S3 SDK failure in remote_cache.rs store_block: after the gzip-compressed block body was streamed via put_object to the given bucket/key, the AWS client returned an error (network, throttling, auth, or 5xx from S3). The bucket name and the height-derived object key are embedded for correlation. The height-continuity precondition earlier in store_block already passed; this is purely the object-store write failing.","triggerScenarios":"Thrown at crates/services/block_aggregator_api/src/db/remote_cache.rs:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the put_object with exponential backoff — S3 throttling (503 SlowDown) and transient network errors are the most common causes and writes are idempotent per key","Verify bucket permissions/credentials and region if the error persists across retries","Check the error's client_error detail for SDK-classified retryability","Since the key is deterministic (block_height_to_key), a retried write overwrites safely; ensure downstream readers tolerate re-written objects"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"add100d30d21498e8528c46be8567fbd2ea019af","analyzedAt":"2026-09-05T18:46:12.018Z","contentChangedAt":"2026-09-05T18:46:12.018Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}