{"record":{"id":"7c034a1e9c74389f","repo":"nats-io/nats-server","slug":"line-in-package-didn-t-contain-2-entries-q","errorCode":null,"errorMessage":"line in package didn't contain 2 entries: %q","messagePattern":"line in package didn't contain 2 entries: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/dirstore.go","lineNumber":329,"sourceCode":"\t})\n\tif packMsg != nil {\n\t\tcb(strings.Join(packMsg, \"\\n\"))\n\t}\n\treturn err\n}\n\n// Merge takes the JWTs from package and adds them to the store\n// Merge is destructive in the sense that it doesn't check if the JWT\n// is newer or anything like that.\nfunc (store *DirJWTStore) Merge(pack string) error {\n\tnewJWTs := strings.Split(pack, \"\\n\")\n\tfor _, line := range newJWTs {\n\t\tif line == _EMPTY_ { // ignore blank lines\n\t\t\tcontinue\n\t\t}\n\t\tsplit := strings.Split(line, \"|\")\n\t\tif len(split) != 2 {\n\t\t\treturn fmt.Errorf(\"line in package didn't contain 2 entries: %q\", line)\n\t\t}\n\t\tpubKey := split[0]\n\t\tif !nkeys.IsValidPublicAccountKey(pubKey) {\n\t\t\treturn fmt.Errorf(\"key to merge is not a valid public account key\")\n\t\t}\n\t\tif err := store.saveIfNewer(pubKey, split[1]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (store *DirJWTStore) Reload() error {\n\tstore.Lock()\n\texp := store.expiration\n\tif exp == nil || store.readonly {\n\t\tstore.Unlock()\n\t\treturn nil","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/dirstore.go#L311-L347","documentation":"DirJWTStore.Merge: a non-blank line of the pushed JWT package did not split on '|' into exactly pubKey|jwt parts, so the package format is invalid and the merge aborts.","triggerScenarios":"Thrown at server/dirstore.go:329 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure each package line is '<public key>|<JWT>'","Regenerate the package from a compatible nats resolver export","Strip corrupted lines from the package"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}