{"record":{"id":"5f0032c5b5878524","repo":"nats-io/nats-server","slug":"sublist-nil-channel","errorCode":null,"errorMessage":"sublist: nil channel","messagePattern":"sublist: nil channel","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/sublist.go","lineNumber":45,"sourceCode":"// provides a facility to match subjects from published messages to\n// interested subscribers. Subscribers can have wildcard subjects to\n// match multiple published subjects.\n\n// Common byte variables for wildcards and token separator.\nconst (\n\tpwc   = '*'\n\tpwcs  = \"*\"\n\tfwc   = '>'\n\tfwcs  = \">\"\n\ttsep  = \".\"\n\tbtsep = '.'\n)\n\n// Sublist related errors\nvar (\n\tErrInvalidSubject    = errors.New(\"sublist: invalid subject\")\n\tErrNotFound          = errors.New(\"sublist: no matches found\")\n\tErrNilChan           = errors.New(\"sublist: nil channel\")\n\tErrAlreadyRegistered = errors.New(\"sublist: notification already registered\")\n)\n\nconst (\n\t// cacheMax is used to bound limit the frontend cache\n\tslCacheMax = 1024\n\t// If we run a sweeper we will drain to this count.\n\tslCacheSweep = 256\n\t// plistMin is our lower bounds to create a fast plist for Match.\n\tplistMin = 256\n)\n\n// SublistResult is a result structure better optimized for queue subs.\ntype SublistResult struct {\n\tpsubs []*subscription\n\tqsubs [][]*subscription // don't make this a map, too expensive to iterate\n}\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/sublist.go#L27-L63","documentation":"RegisterNotification was called with a nil notification channel — the sublist cannot register reconfiguration interest without a channel, so the nil guard returns ErrNilChan immediately.","triggerScenarios":"Thrown at server/sublist.go:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-nil (buffered) notification channel","Skip registration when no notifications are needed"],"exampleFix":null,"handlingStrategy":"type-guard","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-08T10:18:20.063Z"}