{"record":{"id":"ccfb72fe13e7a59a","repo":"projectlombok/lombok","slug":"i-o-issue-reading-creds-file-path-exception-cl","errorCode":null,"errorMessage":"I/O issue reading creds file <path>: <exception class>: <message>","messagePattern":"I/O issue reading creds file <path>: <exception class>: <message>","errorType":"console","errorClass":"AppException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/publish/PublishToBucket.java","lineNumber":156,"sourceCode":"\t\t\t\tif (line.isEmpty()) continue;\n\t\t\t\tif (accessKey == null) { accessKey = line; continue; }\n\t\t\t\tif (secretKey == null) { secretKey = line; continue; }\n\t\t\t\tif (endPoint == null) { endPoint = line; continue; }\n\t\t\t\tif (bucketName == null) { bucketName = line; continue; }\n\t\t\t\tthrow new AppException(\"Too many lines in \" + path.toAbsolutePath() + \" - only 4 expected: \" + LINE_DESCRIPTIONS);\n\t\t\t}\n\t\t\tif (bucketName == null) throw new AppException(\"Expected 3 lines in \" + path.toAbsolutePath() + \": \" + LINE_DESCRIPTIONS);\n\t\t\tcreds = AwsBasicCredentials.create(accessKey, secretKey);\n\t\t\tendpoint = URI.create(endPoint);\n\t\t\tthis.bucketName = bucketName;\n\t\t} catch (NoSuchFileException e) {\n\t\t\tthrow new AppException(\"File with bucket endpoint + credentials is not available. Make file \" + path.toAbsolutePath() + \"; it should contain something like: \\n\" +\n\t\t\t\t\"123456789abcdef0123456789abcdef0  # this is the access key\\n\" +\n\t\t\t\t\"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0  # this is the secret\\n\" +\n\t\t\t\t\"https://12345.r2.cloudflarestorage.com   # this is the endpoint\\n\" +\n\t\t\t\t\"lombok-data   # this is the bucket name\");\n\t\t} catch (IOException e) {\n\t\t\tthrow new AppException(\"I/O issue reading creds file \" + path.toAbsolutePath() + \": \" + e.getClass() + \": \" + e.getMessage());\n\t\t}\n\t}\n}\n","sourceCodeStart":138,"sourceCodeEnd":160,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/publish/PublishToBucket.java#L138-L160","documentation":"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.","triggerScenarios":"go -> readCreds hits IOException while reading the file: no read permission, path is a directory, file removed mid-read, NIO/charset I/O failure.","commonSituations":"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.","solutions":["Read the wrapped <exception class>: <message> in the message and fix that underlying cause (e.g. AccessDeniedException -> chmod/chown the file).","Check the path is a regular readable file (ls -l), not a directory or symlink to nothing.","Run the publish command as a user with read permission on the creds file.","If on shared/network storage, copy the file to local disk and point the config at the local copy."],"exampleFix":"// before\n-rw------- root root creds   (published as other user -> AccessDeniedException)\n// after\nchmod 644 creds   # or chown to the publishing user, then rerun","handlingStrategy":"try-catch","validationCode":"java.nio.file.Path p = java.nio.file.Paths.get(credsPath);\nif (!java.nio.file.Files.isReadable(p) || !java.nio.file.Files.isRegularFile(p)) throw new IllegalStateException(\"Cannot read creds file: \" + p.toAbsolutePath());","typeGuard":null,"tryCatchPattern":"try {\n    publish();\n} catch (AppException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"I/O issue reading creds file\")) {\n        // inspect embedded exception class: AccessDeniedException -> fix perms; FileSystemException -> check path\n        logAndFixPermissions(e.getMessage());\n    } else throw e;\n}","preventionTips":["Ensure the publishing user has read permission on the creds file (chmod/chown).","Point the config at a regular file, not a directory or dangling symlink.","Avoid reading creds from flaky network shares; copy to local disk.","Read the wrapped exception class in the message to target the fix."],"tags":["io","file-read","permissions","java"],"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"}