{"record":{"id":"63b70784cce060de","repo":"temporalio/temporal","slug":"q-service-is-missing-in-config","errorCode":null,"errorMessage":"%q service is missing in config","messagePattern":"%q service is missing in config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"temporal/server_options.go","lineNumber":139,"sourceCode":"\t\tconfig.WithEnv(so.env),\n\t\tconfig.WithConfigDir(so.configDir),\n\t\tconfig.WithZone(so.zone),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not load config file: %w\", err)\n\t}\n\tso.config = cfg\n\treturn nil\n}\n\nfunc (so *serverOptions) validateConfig() error {\n\tif err := so.config.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tfor name := range so.serviceNames {\n\t\tif _, ok := so.config.Services[string(name)]; !ok {\n\t\t\treturn fmt.Errorf(\"%q service is missing in config\", name)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":121,"sourceCodeEnd":144,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/temporal/server_options.go#L121-L144","documentation":"Returned by serverOptions.validateConfig in temporal/server_options.go:139 when a service name requested on the server options (so.serviceNames, e.g. frontend, history, matching, worker) has no corresponding entry under the 'services' key of the loaded config. It is wrapped by 'config validation error' from loadAndValidate. This guards against starting a service whose per-service settings (rpc ports, etc.) are absent.","triggerScenarios":"temporal.NewServer with default service set (or WithService/WithFrontendService etc.) combined with a config file whose services map lacks that key — e.g. a minimal config defining only 'frontend' while history/matching/worker are also requested.","commonSituations":"Running an all-in-one server with a config copied from a single-service example; deleting or renaming a services block; splitting a monolith config for a per-service deployment but reusing the full service list on one node.","solutions":["Add a '<serviceName>:' block under 'services:' in your config with at least an rpc section (grpcPort/httpPort as needed).","Or reduce the requested services via server options (e.g. run only temporal.WithFrontendService on this node) to match the config.","Start from the upstream config_template.yaml and keep services sections in sync with the services your deployment runs.","Check for YAML key typos ('frontend ' with trailing space, wrong case) which make the lookup miss."],"exampleFix":"// config before — server requests history but config only has frontend\nservices:\n  frontend:\n    rpc:\n      grpcPort: 7233\n// after\nservices:\n  frontend:\n    rpc:\n      grpcPort: 7233\n  history:\n    rpc:\n      grpcPort: 7234","handlingStrategy":"validation","validationCode":"requested := map[string]bool{\"frontend\": true, \"history\": true, \"matching\": true, \"worker\": true}\nfor svc := range requested {\n    if _, ok := cfg.Services[svc]; !ok {\n        return fmt.Errorf(\"preflight: %q not present in config services\", svc)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := server.Start(); err != nil {\n    if strings.Contains(err.Error(), \"is missing in config\") {\n        log.Fatalf(\"config missing a requested service: %v\", err)\n    }\n    return err\n}","preventionTips":["Match the services you request via options to the services defined in config, per deployment node.","Copy service blocks from config_template.yaml when adding a new service.","Watch for YAML key typos/case mismatches that silently drop services entries."],"tags":["go","config","validation","services","temporal-server"],"backgroundTag":"invalid-config-value","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}