{"id":"669d0d5ed8b6d350","repo":"docker/cli","slug":"no-such-service-s-669d0d","errorCode":null,"errorMessage":"no such service: %s","messagePattern":"no such service: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/inspect.go","lineNumber":66,"sourceCode":"\tflags.BoolVar(&opts.pretty, \"pretty\", false, \"Print the information in a human friendly format\")\n\n\treturn cmd\n}\n\nfunc runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {\n\tapiClient := dockerCLI.Client()\n\n\tif opts.pretty {\n\t\topts.format = \"pretty\"\n\t}\n\n\tgetRef := func(ref string) (any, []byte, error) {\n\t\t// Service inspect shows defaults values in empty fields.\n\t\tres, err := apiClient.ServiceInspect(ctx, ref, client.ServiceInspectOptions{InsertDefaults: true})\n\t\tif err == nil || !errdefs.IsNotFound(err) {\n\t\t\treturn res.Service, res.Raw, err\n\t\t}\n\t\treturn nil, nil, fmt.Errorf(\"no such service: %s\", ref)\n\t}\n\n\tgetNetwork := func(ref string) (any, []byte, error) {\n\t\tres, err := apiClient.NetworkInspect(ctx, ref, client.NetworkInspectOptions{Scope: \"swarm\"})\n\t\tif err == nil || !errdefs.IsNotFound(err) {\n\t\t\treturn res.Network, res.Raw, err\n\t\t}\n\t\treturn nil, nil, fmt.Errorf(\"no such network: %s\", ref)\n\t}\n\n\tf := opts.format\n\tif len(f) == 0 {\n\t\tf = \"raw\"\n\t\tif len(dockerCLI.ConfigFile().ServiceInspectFormat) > 0 {\n\t\t\tf = dockerCLI.ConfigFile().ServiceInspectFormat\n\t\t}\n\t}\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/inspect.go#L48-L84","documentation":"Error \"no such service: %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/inspect.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}