{"record":{"id":"0b80aea35d50bb16","repo":"projectlombok/lombok","slug":"expected-3-lines-in-path-line-descriptions","errorCode":null,"errorMessage":"Expected 3 lines in <path>: <LINE_DESCRIPTIONS>","messagePattern":"Expected 3 lines in <path>: <LINE_DESCRIPTIONS>","errorType":"console","errorClass":"AppException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/publish/PublishToBucket.java","lineNumber":145,"sourceCode":"\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":127,"sourceCodeEnd":160,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/publish/PublishToBucket.java#L127-L160","documentation":"After the line loop, readCreds requires that all four values were captured; bucketName==null means fewer than 4 non-empty lines were present (bucket is the 4th line). The message text misleadingly says 'Expected 3 lines' — it is a historical off-by-one; the file must contain 4 lines: accessKey/secretKey/endpoint/bucket (LINE_DESCRIPTIONS).","triggerScenarios":"Running the publish flow (go -> readCreds) when the creds file exists but has only 1-3 non-empty lines — e.g. the bucket-name line (or endpoint+bucket lines) is missing entirely, or trailing lines are blank.","commonSituations":"Users copy only the access key and secret from a cloud provider (no R2 endpoint), forget the last line after editing, or create the file per the outdated '3 lines' wording in this very message and omit the bucket name.","solutions":["Add the missing line(s) to the file at <path> so it has exactly 4 non-empty lines: accessKey, secretKey, endpoint URL, bucket name.","Ignore the '3' in the message text — it is an off-by-one in the message; follow LINE_DESCRIPTIONS and the 4-line template.","Check for blank trailing lines / lines with only whitespace, which are skipped and thus not counted.","Regenerate the file from the template in the NoSuchFileException message."],"exampleFix":"// before (creds file, 3 lines -> throws)\nAKIA...\nsecret...\nhttps://12345.r2.cloudflarestorage.com\n// after (4 lines)\nAKIA...\nsecret...\nhttps://12345.r2.cloudflarestorage.com\nlombok-data","handlingStrategy":"validation","validationCode":"List<String> lines = java.nio.file.Files.readAllLines(path).stream().map(String::trim).filter(l -> !l.isEmpty()).collect(java.util.stream.Collectors.toList());\nif (lines.size() < 4) throw new IllegalStateException(path + \" needs 4 lines (accessKey/secretKey/endpoint/bucket), found \" + lines.size());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide all 4 lines; the message text saying '3' is an off-by-one — trust LINE_DESCRIPTIONS: accessKey/secretKey/endpoint/bucket.","Check for missing trailing lines and blank-only lines after edits.","Copy the full 4-line template when creating the file.","Verify the endpoint and bucket lines exist for R2/Cloudflare setups."],"tags":["file-format","configuration","java","misleading-message"],"backgroundTag":"missing-required-config-field","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"}