{"record":{"id":"b4fc97ab3cef9893","repo":"projectlombok/lombok","slug":"i-o-exception-uploading-exception-class-messa","errorCode":null,"errorMessage":"I/O exception uploading: <exception class>: <message>","messagePattern":"I/O exception uploading: <exception class>: <message>","errorType":"console","errorClass":"AppException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/publish/PublishToBucket.java","lineNumber":83,"sourceCode":"\t\t\t.credentialsProvider(() -> creds)\n\t\t\t.build();\n\t\t\n\t\tListObjectsV2Response objList = s3.listObjectsV2(ListObjectsV2Request.builder()\n\t\t\t.bucket(bucketName)\n\t\t\t.prefix(bucketDir + \"/\")\n\t\t\t.build());\n\t\t\n\t\tSet<String> inBucketBeforeUpload = new HashSet<String>();\n\t\tfor (S3Object obj : objList.contents()) inBucketBeforeUpload.add(obj.key());\n\t\t\n\t\tdbg(\"Already in bucket:\\n\" +\n\t\t\tinBucketBeforeUpload.stream().map(x -> \"  \" + x + \"\\n\").collect(Collectors.joining()) +\n\t\t\t(inBucketBeforeUpload.isEmpty() ? \"  (Nothing)\\n\" : \"\"));\n\t\t\n\t\ttry {\n\t\t\tgo0(s3, inBucketBeforeUpload, bucketDir + \"/\", Paths.get(rootPath));\n\t\t} catch (IOException e) {\n\t\t\tthrow new AppException(\"I/O exception uploading: \" + e.getClass() + \": \" + e.getMessage());\n\t\t}\n\t\t\n\t\tif (delete) {\n\t\t\tdbg(\"Uploads complete. Files to delete:\\n\" +\n\t\t\t\tinBucketBeforeUpload.stream().map(x -> \"  \" + x + \"\\n\").collect(Collectors.joining()) +\n\t\t\t\t(inBucketBeforeUpload.isEmpty() ? \"  (Nothing)\\n\" : \"\"));\n\t\t\t\n\t\t\tif (!inBucketBeforeUpload.isEmpty()) {\n\t\t\t\tList<ObjectIdentifier> objsToDelete = new ArrayList<ObjectIdentifier>();\n\t\t\t\tfor (String key : inBucketBeforeUpload) {\n\t\t\t\t\tobjsToDelete.add(ObjectIdentifier.builder().key(key).build());\n\t\t\t\t}\n\t\t\t\ts3.deleteObjects(DeleteObjectsRequest.builder()\n\t\t\t\t\t.bucket(bucketName)\n\t\t\t\t\t.delete(Delete.builder().objects(objsToDelete).build())\n\t\t\t\t\t.build());\n\t\t\t\tdbg(\"Deletion completed\");\n\t\t\t}","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/publish/PublishToBucket.java#L65-L101","documentation":"PublishToBucket.go wraps any IOException from the S3 upload walk (go0) into AppException formatted as 'I/O exception uploading: <exceptionClass>: <message>'. The upload aborts; main prints the message and exits 1.","triggerScenarios":"go0 fails on IO while reading local files or interacting with the bucket: unreadable source file, network interruption during upload, S3 client IO errors.","commonSituations":"Expired/invalid AWS credentials causing client IO errors, offline CI, files deleted mid-upload, network flakiness uploading large trees.","solutions":["Read the wrapped class and message for the root cause (auth vs network vs file)","Verify AWS credentials/region in the creds file are valid","Check network connectivity to the S3 endpoint and retry","Confirm all files under the upload root are readable; re-run"],"exampleFix":"// before (flaky single attempt)\ngo0(s3, ...)\n// after: wrap with retry on transient IOException\nfor (int i = 0; i < 3; i++) { try { go0(s3, ...); break; } catch (IOException e) { if (i == 2) throw e; sleepbackoff(); } }","handlingStrategy":"retry","validationCode":"if (!Files.isReadable(Paths.get(rootPath))) throw new IllegalStateException(\"upload root unreadable\");\n// verify creds load before upload\nnew Properties(Files.newInputStream(Paths.get(credsFile)));","typeGuard":null,"tryCatchPattern":"try { PublishToBucket.main(args); } catch (AppException e) { if (e.getMessage().startsWith(\"I/O exception uploading:\")) { checkCredentialsAndNetwork(e.getMessage()); } System.err.println(e.getMessage()); System.exit(1); }","preventionTips":["Validate AWS credentials before large uploads","Run uploads on a stable network; retry transient failures","Ensure all files under the root are readable and none are removed mid-run"],"tags":["java","io","s3","upload","publish"],"backgroundTag":"file-read-failed","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}