slimtoolkit/slim · error
unknown service - %s
Error message
unknown service - %s
What it means
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.
Source
Thrown at pkg/app/master/compose/execution.go:612
}(name)
}
wg.Wait()
select {
case err := <-errCh:
return err
default:
return nil
}
return nil
}
func (ref *Execution) PrepareService(ctx context.Context, name string) error {
ref.logger.Debugf("Execution.PrepareService(%s)", name)
serviceInfo, ok := ref.AllServices[name]
if !ok {
return fmt.Errorf("unknown service - %s", name)
}
service := serviceInfo.Config
ref.logger.Debugf("Execution.PrepareService(%s): image=%s", name, service.Image)
if service.Image == "" {
imageName := fmt.Sprintf("%s_%s", ref.Project.Name, name)
if ref.BuildImages && service.Build != nil {
if err := buildImage(ctx, ref.apiClient, ref.BaseComposeDir, imageName, service.Build); err != nil {
return err
}
} else {
return fmt.Errorf("cant build service image - %s", name)
}
} else {
found, err := HasImage(ref.apiClient, service.Image)
if err != nil {
return errView on GitHub (pinned to 81940d17fa)
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
Example fix
// before err := execution.PrepareService(ctx, "web-app") // service is named "webapp" // after err := execution.PrepareService(ctx, "webapp")
Defensive patterns
Strategy: validation
Validate before calling
func serviceExists(exec *compose.Execution, name string) bool {
_, ok := exec.AllServices[name]
return ok
}
if !serviceExists(execution, "web") {
return fmt.Errorf("service %q not in project; available: %v", "web", keys(execution.AllServices))
} Try / catch
if err := execution.PrepareService(ctx, svc); err != nil {
if strings.HasPrefix(err.Error(), "unknown service - ") {
return fmt.Errorf("service %q not found in compose project: %w", svc, err)
}
return err
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- no service image
- no project info
- cant build service image - %s
- bad image reference
- invalid context directory - %s
AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31).
Data as JSON: /api/errors/f517efa1140109cb.
Report an issue: GitHub.