projectlombok/lombok · error · AppException

I/O issue reading creds file

Error message

I/O issue reading creds file <path>: <exception class>: <message>

What it means

Any IOException other than NoSuchFileException while reading the creds file (readCreds) is converted into this AppException, reporting the exception class and message plus the file path. It signals I/O trouble (permissions, is-a-directory, decoding/IO errors) rather than a missing or malformed file.

Solutions

  1. Read the wrapped <exception class>: <message> in the message and fix that underlying cause (e.g. AccessDeniedException -> chmod/chown the file).
  2. Check the path is a regular readable file (ls -l), not a directory or symlink to nothing.
  3. Run the publish command as a user with read permission on the creds file.
  4. If on shared/network storage, copy the file to local disk and point the config at the local copy.

Example fix

// before
-rw------- root root creds   (published as other user -> AccessDeniedException)
// after
chmod 644 creds   # or chown to the publishing user, then rerun
Defensive patterns

Strategy: try-catch

Validate before calling

java.nio.file.Path p = java.nio.file.Paths.get(credsPath);
if (!java.nio.file.Files.isReadable(p) || !java.nio.file.Files.isRegularFile(p)) throw new IllegalStateException("Cannot read creds file: " + p.toAbsolutePath());

Try / catch

try {
    publish();
} catch (AppException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("I/O issue reading creds file")) {
        // inspect embedded exception class: AccessDeniedException -> fix perms; FileSystemException -> check path
        logAndFixPermissions(e.getMessage());
    } else throw e;
}

Prevention

When it happens

Trigger: go -> readCreds hits IOException while reading the file: no read permission, path is a directory, file removed mid-read, NIO/charset I/O failure.

Common situations: File created by another user/root with restrictive mode; CI runner missing filesystem permissions; the 'file' is actually a directory or a dangling symlink; disk/NFS errors.

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/ccfb72fe13e7a59a. Report an issue: GitHub.

Appendix: source

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

				if (line.isEmpty()) continue;
				if (accessKey == null) { accessKey = line; continue; }
				if (secretKey == null) { secretKey = line; continue; }
				if (endPoint == null) { endPoint = line; continue; }
				if (bucketName == null) { bucketName = line; continue; }
				throw new AppException("Too many lines in " + path.toAbsolutePath() + " - only 4 expected: " + LINE_DESCRIPTIONS);
			}
			if (bucketName == null) throw new AppException("Expected 3 lines in " + path.toAbsolutePath() + ": " + LINE_DESCRIPTIONS);
			creds = AwsBasicCredentials.create(accessKey, secretKey);
			endpoint = URI.create(endPoint);
			this.bucketName = bucketName;
		} catch (NoSuchFileException e) {
			throw new AppException("File with bucket endpoint + credentials is not available. Make file " + path.toAbsolutePath() + "; it should contain something like: \n" +
				"123456789abcdef0123456789abcdef0  # this is the access key\n" +
				"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0  # this is the secret\n" +
				"https://12345.r2.cloudflarestorage.com   # this is the endpoint\n" +
				"lombok-data   # this is the bucket name");
		} catch (IOException e) {
			throw new AppException("I/O issue reading creds file " + path.toAbsolutePath() + ": " + e.getClass() + ": " + e.getMessage());
		}
	}
}

View on GitHub (pinned to 6d6a3e9fec)