{"record":{"id":"d5d4fc7e47cca94d","repo":"conductor-oss/conductor","slug":"error-uploading-to-s3-path-s-payloadsize-d","errorCode":null,"errorMessage":"Error uploading to S3 - path:%s, payloadSize: %d","messagePattern":"Error uploading to S3 - path:(.+?), payloadSize: (.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"awss3-storage/src/main/java/com/netflix/conductor/s3/storage/S3PayloadStorage.java","lineNumber":167,"sourceCode":"     */\n    @Override\n    public void upload(String path, InputStream payload, long payloadSize) {\n        try {\n            PutObjectRequest request =\n                    PutObjectRequest.builder()\n                            .bucket(bucketName)\n                            .key(path)\n                            .contentType(CONTENT_TYPE)\n                            .contentLength(payloadSize)\n                            .build();\n\n            s3Client.putObject(request, RequestBody.fromInputStream(payload, payloadSize));\n        } catch (SdkException e) {\n            String msg =\n                    String.format(\n                            \"Error uploading to S3 - path:%s, payloadSize: %d\", path, payloadSize);\n            LOGGER.error(msg, e);\n            throw new TransientException(msg, e);\n        }\n    }\n\n    /**\n     * Downloads the payload stored in the s3 object.\n     *\n     * @param path the S3 key of the object\n     * @return an input stream containing the contents of the object Caller is expected to close the\n     *     input stream.\n     */\n    @Override\n    public InputStream download(String path) {\n        try {\n            GetObjectRequest request =\n                    GetObjectRequest.builder().bucket(bucketName).key(path).build();\n\n            return s3Client.getObject(request);\n        } catch (SdkException e) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/awss3-storage/src/main/java/com/netflix/conductor/s3/storage/S3PayloadStorage.java#L149-L185","documentation":"Thrown as TransientException (wrapping SdkException) by S3PayloadStorage.upload when s3Client.putObject fails with an SdkException. This covers network, credential, throttling, and S3 5xx errors during the actual object PUT. conductor marks it Transient so workflow engines can retry the upload.","triggerScenarios":"Network failure during putObject; expired/invalid credentials; IAM denial on s3:PutObject; S3 throttling; payload too large hitting a limit; bucket in a different region than configured. Caught in upload's SdkException handler.","commonSituations":"Missing s3:PutObject permission; transient network; oversized payload; wrong region; STS session expired mid-upload.","solutions":["Retry with exponential backoff — the exception type is explicitly Transient.","Grant the role s3:PutObject on the bucket.","Confirm region/bucket match and credentials are valid.","If payloadSize is large, verify it is within S3 limits and that contentLength is accurate."],"exampleFix":"// before\nstorage.upload(path, stream, size); // propagates TransientException\n// after\nRetryUtils.retryOn(TransientException.class, 5, Duration.ofMillis(300),\n    () -> storage.upload(path, stream, size));","handlingStrategy":"retry","validationCode":"import org.apache.commons.lang3.StringUtils;\nif (StringUtils.isBlank(path)) throw new IllegalArgumentException(\"upload path is required\");\nif (payloadSize < 0) throw new IllegalArgumentException(\"payloadSize must be >= 0\");\n// Verify IAM policy grants s3:PutObject via an STS dry-run if available","typeGuard":null,"tryCatchPattern":"// TransientException on upload is retriable\nint maxAttempts = 5;\nfor (int attempt = 1; attempt <= maxAttempts; attempt++) {\n    try {\n        storage.upload(path, payload, payloadSize);\n        return;\n    } catch (TransientException e) {\n        if (attempt == maxAttempts) throw e;\n        Thread.sleep(Math.min(300L * attempt, 5000L));\n    }\n}","preventionTips":["Grant s3:PutObject on the bucket.","Ensure accurate contentLength and payloads within S3 limits.","Retry TransientException with backoff; do not retry NonTransient failures."],"tags":["s3","aws","network","transient","storage","iam"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}