docker/cli ยท error
failed to wait on tasks of stack: %s: %w
Error message
failed to wait on tasks of stack: %s: %w
What it means
Error "failed to wait on tasks of stack: %s: %w" thrown in docker/cli.
Source
Thrown at cli/command/stack/remove.go:92
_, _ = fmt.Fprintln(dockerCli.Err(), "Nothing found in stack:", namespace)
continue
}
// TODO(thaJeztah): change this "hasError" boolean to return a (multi-)error for each of these functions instead.
hasError := removeServices(ctx, dockerCli, services.Items)
hasError = removeSecrets(ctx, dockerCli, secrets.Items) || hasError
hasError = removeConfigs(ctx, dockerCli, configs.Items) || hasError
hasError = removeNetworks(ctx, dockerCli, networks.Items) || hasError
if hasError {
errs = append(errs, errors.New("failed to remove some resources from stack: "+namespace))
continue
}
if !opts.detach {
err = waitOnTasks(ctx, apiClient, namespace)
if err != nil {
errs = append(errs, fmt.Errorf("failed to wait on tasks of stack: %s: %w", namespace, err))
}
}
}
return errors.Join(errs...)
}
func sortServiceByName(services []swarm.Service) func(i, j int) bool {
return func(i, j int) bool {
return services[i].Spec.Name < services[j].Spec.Name
}
}
func removeServices(ctx context.Context, dockerCLI command.Cli, services []swarm.Service) bool {
var hasError bool
sort.Slice(services, sortServiceByName(services))
for _, service := range services {
_, _ = fmt.Fprintln(dockerCLI.Out(), "Removing service", service.Spec.Name)
if _, err := dockerCLI.Client().ServiceRemove(ctx, service.ID, client.ServiceRemoveOptions{}); err != nil {View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/command/stack/remove.go:92 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/948346a1a1fdd7ea.json.
Report an issue: GitHub.