{"record":{"id":"01a5b9a15503cdab","repo":"projectlombok/lombok","slug":"too-many-lines-in-path-only-4-expected-line","errorCode":null,"errorMessage":"Too many lines in <path> - only 4 expected: <LINE_DESCRIPTIONS>","messagePattern":"Too many lines in <path> - only 4 expected: <LINE_DESCRIPTIONS>","errorType":"console","errorClass":"AppException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/publish/PublishToBucket.java","lineNumber":143,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\t\n\tprivate static final String LINE_DESCRIPTIONS = \"accessKey/secretKey/endpoint/bucket\";\n\tprivate void readCreds(Path path) throws AppException {\n\t\ttry {\n\t\t\tList<String> lines = Files.readAllLines(path);\n\t\t\tString accessKey = null, secretKey = null, endPoint = null, bucketName = null;\n\t\t\tfor (String line : lines) {\n\t\t\t\tint idx = line.indexOf('#');\n\t\t\t\tif (idx != -1) line = line.substring(0, idx);\n\t\t\t\tline = line.trim();\n\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":125,"sourceCodeEnd":160,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/publish/PublishToBucket.java#L125-L160","documentation":"PublishToBucket.readCreds parses a credentials file expected to contain exactly 4 non-empty, trimmed lines: accessKey, secretKey, endpoint URL, bucket name (described by LINE_DESCRIPTIONS = \"accessKey/secretKey/endpoint/bucket\"). If the file contains a 5th non-empty line, readCreds throws this AppException. This is a strict file-shape validation so publish tooling never uploads with ambiguous credentials.","triggerScenarios":"Running the publish flow (go -> readCreds) when the creds file at the configured path has 5 or more non-empty lines after trimming — e.g. extra blank-looking lines with whitespace/comments, a trailing annotation line, duplicated keys appended, or two credential files concatenated.","commonSituations":"Users append a comment or note line to the creds file; editors add a stray content line; credentials pasted from a wiki include headers; secrets manager exports wrap the 4 values with extra metadata lines.","solutions":["Open the file reported by <path> and delete everything after the 4th non-empty line.","Ensure exactly 4 non-empty lines in order: accessKey, secretKey, endpoint URL, bucket name; remove inline comments (the parser does not strip '#' comments).","Regenerate the file from the template shown in the NoSuchFileException message (error 52) rather than editing an old copy.","If you need more config, move it to a separate file or env vars instead of the 4-line creds file."],"exampleFix":"// before (creds file, 5 lines -> throws)\nAKIA...\nsecret...\nhttps://12345.r2.cloudflarestorage.com\nlombok-data\n# rot 2026-09-01\n// after (4 lines, no extras)\nAKIA...\nsecret...\nhttps://12345.r2.cloudflarestorage.com\nlombok-data","handlingStrategy":"validation","validationCode":"long nonEmpty = java.nio.file.Files.readAllLines(path).stream().filter(l -> !l.trim().isEmpty()).count();\nif (nonEmpty > 4) throw new IllegalStateException(path + \" must contain exactly 4 non-empty lines, found \" + nonEmpty);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the creds file to exactly 4 non-empty lines: accessKey, secretKey, endpoint, bucket.","Do not add comments or notes to the file — the parser does not strip '#' comments.","Regenerate the file from the documented template instead of hand-editing old copies.","Store extra config elsewhere (env vars, separate file)."],"tags":["file-format","configuration","java"],"backgroundTag":"invalid-config-value","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"}