{"record":{"id":"65f640219e5bd177","repo":"nats-io/nats-server","slug":"error-setting-up-list-request-handling-v","errorCode":null,"errorMessage":"error setting up list request handling: %v","messagePattern":"error setting up list request handling: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/accounts.go","lineNumber":4612,"sourceCode":"\t\t\ts.sendInternalMsgLocked(reply, _EMPTY_, nil, []byte{})\n\t\t\ts.Debugf(\"DirResolver - Pack request matches hash %x\", ourHash[:])\n\t\t} else if err := dr.DirJWTStore.PackWalk(1, func(partialPackMsg string) {\n\t\t\ts.sendInternalMsgLocked(reply, _EMPTY_, nil, []byte(partialPackMsg))\n\t\t}); err != nil {\n\t\t\t// let them timeout\n\t\t\ts.Errorf(\"DirResolver - Pack request error: %v\", err)\n\t\t} else {\n\t\t\ts.Debugf(\"DirResolver - Pack request hash %x - finished responding with hash %x\", theirHash, ourHash)\n\t\t\ts.sendInternalMsgLocked(reply, _EMPTY_, nil, []byte{})\n\t\t}\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error setting up pack request handling: %v\", err)\n\t}\n\t// respond to list requests with one message containing all account ids\n\tif _, err := s.sysSubscribe(accListReqSubj, func(_ *subscription, _ *client, _ *Account, _, reply string, _ []byte) {\n\t\thandleListRequest(dr.DirJWTStore, s, reply)\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error setting up list request handling: %v\", err)\n\t}\n\tif _, err := s.sysSubscribe(accDeleteReqSubj, func(_ *subscription, c *client, _ *Account, _, reply string, msg []byte) {\n\t\t// As this is a raw message, we need to extract payload and only decode claims from it,\n\t\t// in case request is sent with headers.\n\t\t_, msg = c.msgParts(msg)\n\t\thandleDeleteRequest(dr.DirJWTStore, s, msg, reply)\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error setting up delete request handling: %v\", err)\n\t}\n\t// embed pack responses into store\n\tif _, err := s.sysSubscribe(packRespIb, func(_ *subscription, _ *client, _ *Account, _, _ string, msg []byte) {\n\t\thash := dr.DirJWTStore.Hash()\n\t\tif len(msg) == 0 { // end of response stream\n\t\t\ts.Debugf(\"DirResolver - Merging finished and resulting in: %x\", dr.DirJWTStore.Hash())\n\t\t\treturn\n\t\t} else if err := dr.DirJWTStore.Merge(string(msg)); err != nil {\n\t\t\ts.Errorf(\"DirResolver - Merging resulted in error: %v\", err)\n\t\t} else {","sourceCodeStart":4594,"sourceCodeEnd":4630,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/accounts.go#L4594-L4630","documentation":"Returned by DirAccResolver setup when the system subscription that answers account-list requests (accListReqSubj) with all account IDs cannot be established. It wraps the sysSubscribe error so the resolver aborts initialization.","triggerScenarios":"Start()/setup on a DirAccResolver where sysSubscribe(accListReqSubj, ...) fails — eventing not initialized, system account missing, or internal client unavailable.","commonSituations":"Clustered deployments where the system account is not propagated; resolver started during shutdown; missing system_account directive.","solutions":["Ensure the system account is configured and available on the server.","Inspect the wrapped underlying error for the root cause.","Restart the server so eventing initializes before resolver setup.","Verify resolver configuration options are valid."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if srv.Opts.SystemAccount == \"\" {\n    return fmt.Errorf(\"list request handling requires a system account\")\n}","typeGuard":null,"tryCatchPattern":"if err := dr.Start(); err != nil {\n    if strings.Contains(err.Error(), \"error setting up list request handling\") {\n        return fmt.Errorf(\"resolver list subscription failed: %w\", err)\n    }\n    return err\n}","preventionTips":["Verify system account configuration before enabling a dir resolver.","Avoid starting the resolver during server shutdown.","Check server logs for earlier eventing initialization failures.","Include the wrapped error in your own logs for diagnosis."],"tags":["nats-server","account-resolver","subscription","system-account"],"backgroundTag":"internal-subscription-setup-failed","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}