{"record":{"id":"c17359e863c37097","repo":"nats-io/nats-server","slug":"no-export-defined-for-q","errorCode":null,"errorMessage":"no export defined for %q","messagePattern":"no export defined for %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/accounts.go","lineNumber":2617,"sourceCode":"\n\t// Redo timer as needed.\n\tacc.mu.Lock()\n\tif totalResponses > 0 && se.rtmr != nil {\n\t\tse.rtmr.Stop()\n\t\tse.rtmr.Reset(se.respThresh)\n\t} else {\n\t\tse.clearResponseThresholdTimer()\n\t}\n\tacc.mu.Unlock()\n}\n\n// ServiceExportResponseThreshold returns the current threshold.\nfunc (a *Account) ServiceExportResponseThreshold(export string) (time.Duration, error) {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tse := a.getServiceExport(export)\n\tif se == nil {\n\t\treturn 0, fmt.Errorf(\"no export defined for %q\", export)\n\t}\n\treturn se.respThresh, nil\n}\n\n// SetServiceExportResponseThreshold sets the maximum time the system will a response to be delivered\n// from a service export responder.\nfunc (a *Account) SetServiceExportResponseThreshold(export string, maxTime time.Duration) error {\n\ta.mu.Lock()\n\tif a.isClaimAccount() {\n\t\ta.mu.Unlock()\n\t\treturn fmt.Errorf(\"claim based accounts can not be updated directly\")\n\t}\n\tlrt := a.lowestServiceExportResponseTime()\n\tse := a.getServiceExport(export)\n\tif se == nil {\n\t\ta.mu.Unlock()\n\t\treturn fmt.Errorf(\"no export defined for %q\", export)\n\t}","sourceCodeStart":2599,"sourceCodeEnd":2635,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/accounts.go#L2599-L2635","documentation":"ServiceExportResponseThreshold looks up a service export by subject and returns this error when no export matches (server/accounts.go:2617). The account has no service export registered for the given subject string.","triggerScenarios":"Calling ServiceExportResponseThreshold with a subject that was never registered via AddServiceExport, or after the export was removed.","commonSituations":"Typos in the export subject; querying the wrong account; exports removed after config/claim updates.","solutions":["Register the export with AddServiceExport before querying its threshold.","Verify the exact export subject string on the correct account.","Use accountexports or imports.services inspection to list existing exports."],"exampleFix":"// before\nd, err := acc.ServiceExportResponseThreshold(\"typo.subject\")\n// after\nacc.AddServiceExport(\"help.request\", nil)\nd, err := acc.ServiceExportResponseThreshold(\"help.request\")","handlingStrategy":"validation","validationCode":"if acc.getServiceExport(subject) == nil {\n    return fmt.Errorf(\"export %s not registered\", subject)\n}","typeGuard":null,"tryCatchPattern":"if d, err := acc.ServiceExportResponseThreshold(subject); err != nil {\n    if strings.Contains(err.Error(), \"no export defined\") {\n        // register export or fix subject\n    }\n}","preventionTips":["Register exports before tuning thresholds","Centralize export subject constants","Verify account identity when querying exports"],"tags":["nats-server","service-export","lookup-miss"],"backgroundTag":"service-export-not-found","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}