projectlombok/lombok · error · AppException

I/O exception uploading

Error message

I/O exception uploading: <exception class>: <message>

What it means

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.

Solutions

  1. Read the wrapped class and message for the root cause (auth vs network vs file)
  2. Verify AWS credentials/region in the creds file are valid
  3. Check network connectivity to the S3 endpoint and retry
  4. Confirm all files under the upload root are readable; re-run

Example fix

// before (flaky single attempt)
go0(s3, ...)
// after: wrap with retry on transient IOException
for (int i = 0; i < 3; i++) { try { go0(s3, ...); break; } catch (IOException e) { if (i == 2) throw e; sleepbackoff(); } }
Defensive patterns

Strategy: retry

Validate before calling

if (!Files.isReadable(Paths.get(rootPath))) throw new IllegalStateException("upload root unreadable");
// verify creds load before upload
new Properties(Files.newInputStream(Paths.get(credsFile)));

Try / catch

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); }

Prevention

When it happens

Trigger: go0 fails on IO while reading local files or interacting with the bucket: unreadable source file, network interruption during upload, S3 client IO errors.

Common situations: Expired/invalid AWS credentials causing client IO errors, offline CI, files deleted mid-upload, network flakiness uploading large trees.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07). Data as JSON: /api/errors/b4fc97ab3cef9893. Report an issue: GitHub.

Appendix: source

Thrown at src/support/lombok/publish/PublishToBucket.java:83

			.credentialsProvider(() -> creds)
			.build();
		
		ListObjectsV2Response objList = s3.listObjectsV2(ListObjectsV2Request.builder()
			.bucket(bucketName)
			.prefix(bucketDir + "/")
			.build());
		
		Set<String> inBucketBeforeUpload = new HashSet<String>();
		for (S3Object obj : objList.contents()) inBucketBeforeUpload.add(obj.key());
		
		dbg("Already in bucket:\n" +
			inBucketBeforeUpload.stream().map(x -> "  " + x + "\n").collect(Collectors.joining()) +
			(inBucketBeforeUpload.isEmpty() ? "  (Nothing)\n" : ""));
		
		try {
			go0(s3, inBucketBeforeUpload, bucketDir + "/", Paths.get(rootPath));
		} catch (IOException e) {
			throw new AppException("I/O exception uploading: " + e.getClass() + ": " + e.getMessage());
		}
		
		if (delete) {
			dbg("Uploads complete. Files to delete:\n" +
				inBucketBeforeUpload.stream().map(x -> "  " + x + "\n").collect(Collectors.joining()) +
				(inBucketBeforeUpload.isEmpty() ? "  (Nothing)\n" : ""));
			
			if (!inBucketBeforeUpload.isEmpty()) {
				List<ObjectIdentifier> objsToDelete = new ArrayList<ObjectIdentifier>();
				for (String key : inBucketBeforeUpload) {
					objsToDelete.add(ObjectIdentifier.builder().key(key).build());
				}
				s3.deleteObjects(DeleteObjectsRequest.builder()
					.bucket(bucketName)
					.delete(Delete.builder().objects(objsToDelete).build())
					.build());
				dbg("Deletion completed");
			}

View on GitHub (pinned to 6d6a3e9fec)