{"record":{"id":"f517efa1140109cb","repo":"slimtoolkit/slim","slug":"unknown-service-s","errorCode":null,"errorMessage":"unknown service - %s","messagePattern":"unknown service - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/compose/execution.go","lineNumber":612,"sourceCode":"\t\t}(name)\n\t}\n\n\twg.Wait()\n\tselect {\n\tcase err := <-errCh:\n\t\treturn err\n\tdefault:\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n\nfunc (ref *Execution) PrepareService(ctx context.Context, name string) error {\n\tref.logger.Debugf(\"Execution.PrepareService(%s)\", name)\n\tserviceInfo, ok := ref.AllServices[name]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown service - %s\", name)\n\t}\n\n\tservice := serviceInfo.Config\n\tref.logger.Debugf(\"Execution.PrepareService(%s): image=%s\", name, service.Image)\n\n\tif service.Image == \"\" {\n\t\timageName := fmt.Sprintf(\"%s_%s\", ref.Project.Name, name)\n\t\tif ref.BuildImages && service.Build != nil {\n\t\t\tif err := buildImage(ctx, ref.apiClient, ref.BaseComposeDir, imageName, service.Build); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"cant build service image - %s\", name)\n\t\t}\n\t} else {\n\t\tfound, err := HasImage(ref.apiClient, service.Image)\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/compose/execution.go#L594-L630","documentation":"Execution.PrepareService looks up the requested service name in ref.AllServices (the resolved service map for the compose project). If the name is not present, it returns 'unknown service - %s'. This means the service is not part of the execution's resolved/selected service set.","triggerScenarios":"Calling PrepareService(ctx, name) with a service name that is not a key in Execution.AllServices — typically a name not defined in the compose file, a typo, or a service added after the Execution was created.","commonSituations":"Typos in service names, referencing services from an override file that wasn't loaded, running PrepareService for a service belonging to a different compose project, or scripts using stale names after a compose file refactor.","solutions":["Print the available services (e.g. iterate ref.AllServices keys or run the compose config/ps equivalent) and correct the service name","Recreate the Execution after editing the compose file so AllServices reflects the current definitions","Fix the typo / wrong project: ensure the name matches a service defined in the loaded compose configuration"],"exampleFix":"// before\nerr := execution.PrepareService(ctx, \"web-app\")   // service is named \"webapp\"\n// after\nerr := execution.PrepareService(ctx, \"webapp\")","handlingStrategy":"validation","validationCode":"func serviceExists(exec *compose.Execution, name string) bool {\n    _, ok := exec.AllServices[name]\n    return ok\n}\n\nif !serviceExists(execution, \"web\") {\n    return fmt.Errorf(\"service %q not in project; available: %v\", \"web\", keys(execution.AllServices))\n}","typeGuard":null,"tryCatchPattern":"if err := execution.PrepareService(ctx, svc); err != nil {\n    if strings.HasPrefix(err.Error(), \"unknown service - \") {\n        return fmt.Errorf(\"service %q not found in compose project: %w\", svc, err)\n    }\n    return err\n}","preventionTips":["List service names from the loaded project before calling PrepareService","Recreate the Execution after any compose file edit","Copy service names from the compose file, not from memory","Validate the compose file with `docker compose config --services` first"],"tags":["compose","docker","service-lookup"],"backgroundTag":"unknown-service","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}