{"record":{"id":"80c7a5dbd820cab9","repo":"nats-io/nats-server","slug":"in-non-operator-mode-default-js-domain-referenc","errorCode":null,"errorMessage":"in non operator mode, `default_js_domain` references non existing account %q","messagePattern":"in non operator mode, `default_js_domain` references non existing account %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/jetstream.go","lineNumber":2901,"sourceCode":"\tif len(o.JsAccDefaultDomain) > 0 {\n\t\tif len(o.TrustedOperators) == 0 {\n\t\t\tfor a, domain := range o.JsAccDefaultDomain {\n\t\t\t\tfound := false\n\t\t\t\tif isReservedAccount(a) {\n\t\t\t\t\tfound = true\n\t\t\t\t} else {\n\t\t\t\t\tfor _, acc := range o.Accounts {\n\t\t\t\t\t\tif a == acc.GetName() {\n\t\t\t\t\t\t\tif len(acc.jsLimits) > 0 && domain != _EMPTY_ {\n\t\t\t\t\t\t\t\treturn fmt.Errorf(\"default_js_domain contains account name %q with enabled JetStream\", a)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\treturn fmt.Errorf(\"in non operator mode, `default_js_domain` references non existing account %q\", a)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor a := range o.JsAccDefaultDomain {\n\t\t\t\tif !nkeys.IsValidPublicAccountKey(a) {\n\t\t\t\t\treturn fmt.Errorf(\"default_js_domain contains account name %q, which is not a valid public account nkey\", a)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor a, d := range o.JsAccDefaultDomain {\n\t\t\tsacc := DEFAULT_SYSTEM_ACCOUNT\n\t\t\tif o.SystemAccount != _EMPTY_ {\n\t\t\t\tsacc = o.SystemAccount\n\t\t\t}\n\t\t\tif a == sacc {\n\t\t\t\treturn fmt.Errorf(\"system account %q can not be in default_js_domain\", a)\n\t\t\t}\n\t\t\tif d == _EMPTY_ {","sourceCodeStart":2883,"sourceCodeEnd":2919,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/jetstream.go#L2883-L2919","documentation":"When running in non-operator mode, every account named in default_js_domain must be one of the server's configured accounts (or a reserved account). If validation cannot find the account among configured accounts, startup fails with this error because the domain mapping would reference an account the server does not know.","triggerScenarios":"Server config with default_js_domain (JsAccDefaultDomain) containing an account name that is not present in the accounts list and is not a reserved account, in non-operator mode - caught during ProcessOptions at startup.","commonSituations":"Typo in the account name in default_js_domain; account defined only in another config file or via operator JWT (but server running non-operator); leftover default_js_domain after removing the account from config.","solutions":["Add the referenced account to the server's accounts configuration, or fix the name typo.","Remove the stale default_js_domain entry for the nonexistent account.","If accounts come from an operator mode resolver, run with operator mode so the account resolves via JWT.","Validate the config with `nats-server -t` before deploying."],"exampleFix":"// before\naccounts: { APP: {} }\ndefault_js_domain: { MISSING_ACC: \"domainA\" }\n// after\naccounts: { APP: {}, JSACC: { jetstream: enable } }\ndefault_js_domain: { JSACC: \"domainA\" }","handlingStrategy":"validation","validationCode":"for name := range cfg.DefaultJSDomain {\n    if _, ok := cfg.Accounts[name]; !ok {\n        return fmt.Errorf(\"default_js_domain references unknown account %q\", name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every default_js_domain entry exists in the accounts list","Validate config with `nats-server -t` before deploys","Remove stale entries when deleting accounts from config","If accounts resolve via operator JWTs, switch the server to operator mode instead"],"tags":["jetstream","configuration","domain","nats-server"],"backgroundTag":"jetstream-config-account-not-found","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}