{"record":{"id":"6638c8259b288bbc","repo":"snail007/goproxy","slug":"service-s-not-found","errorCode":null,"errorMessage":"service %s not found","messagePattern":"service (.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/service.go","lineNumber":45,"sourceCode":"}\nfunc Run(name string) (service *ServiceItem, err error) {\n\tservice, ok := servicesMap[name]\n\tif ok {\n\t\tgo func() {\n\t\t\tdefer func() {\n\t\t\t\terr := recover()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"%s servcie crashed, ERR: %s\\ntrace:%s\", name, err, string(debug.Stack()))\n\t\t\t\t}\n\t\t\t}()\n\t\t\terr := service.S.Start(service.Args)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s servcie fail, ERR: %s\", name, err)\n\t\t\t}\n\t\t}()\n\t}\n\tif !ok {\n\t\terr = fmt.Errorf(\"service %s not found\", name)\n\t}\n\treturn\n}\n","sourceCodeStart":27,"sourceCodeEnd":49,"githubUrl":"https://github.com/snail007/goproxy/blob/e6d6a821db80e7f47ee6e981a144984e1d4ddb3d/services/service.go#L27-L49","documentation":"Run starts a configured service by looking up its type name in the registered service map. This fatal-path error is returned when the requested service name is not registered in the map, i.e. the config requested a service type the binary does not know.","triggerScenarios":"initConfig calls Run with a service name (from config, e.g. an unknown mode/type value) that has no entry in the services map; ok==false from the map lookup produces \"service %s not found\".","commonSituations":"Typo in the config's service/type field; running an older binary that lacks a newer service type; config copied from a different project/edition; case mismatch in the service name.","solutions":["Check the service name in the config against the documented list of supported service types and fix the typo","Upgrade to a binary version that supports the requested service type","Confirm which service types the running build registers (see the services map in services/service.go)","Enable the corresponding config option that registers the service if it is opt-in"],"exampleFix":"// before (typo in config)\n// mode=httpproxyx\n// after\n// mode=httpProxy  (a name registered in the services map)","handlingStrategy":"validation","validationCode":"var supportedServices = map[string]bool{\"httpProxy\": true, \"tcp\": true, \"udp\": true /* ...per docs */}\nif !supportedServices[cfg.Mode] {\n    return fmt.Errorf(\"config mode %q is not supported by this build\", cfg.Mode)\n}","typeGuard":null,"tryCatchPattern":"if err := run(cfg); err != nil {\n    if strings.Contains(err.Error(), \"not found\") && strings.Contains(err.Error(), \"service\") {\n        log.Fatalf(\"unknown service type %q: check config against docs/binary version\", cfg.Mode)\n    }\n}","preventionTips":["Copy service names from the official docs, not from memory","Verify config against the same version of the binary you deploy","Keep a sample config in the repo and diff changes against it","Add a startup config validation step before calling Run"],"tags":["configuration","service-lookup","startup"],"backgroundTag":"unknown-service-type","analyzedSha":"e6d6a821db80e7f47ee6e981a144984e1d4ddb3d","analyzedAt":"2026-09-03T15:32:42.750Z","contentChangedAt":"2026-09-03T15:32:42.750Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}