{"id":"ac3cc73611901df3","repo":"docker/cli","slug":"no-such-task-or-service-v","errorCode":null,"errorMessage":"no such task or service: %v","messagePattern":"no such task or service: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/logs.go","lineNumber":93,"sourceCode":"\n\tvar (\n\t\tmaxLength    = 1\n\t\tresponseBody io.ReadCloser\n\t\ttty          bool\n\t)\n\n\tservice, err := apiClient.ServiceInspect(ctx, opts.target, client.ServiceInspectOptions{})\n\tif err != nil {\n\t\t// if it's any error other than service not found, it's Real\n\t\tif !errdefs.IsNotFound(err) {\n\t\t\treturn err\n\t\t}\n\t\tres, err := apiClient.TaskInspect(ctx, opts.target, client.TaskInspectOptions{})\n\t\tif err != nil {\n\t\t\tif errdefs.IsNotFound(err) {\n\t\t\t\t// if the task isn't found, rewrite the error to be clear\n\t\t\t\t// that we looked for services AND tasks and found none\n\t\t\t\terr = fmt.Errorf(\"no such task or service: %v\", opts.target)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\ttty = res.Task.Spec.ContainerSpec.TTY\n\t\tmaxLength = getMaxLength(res.Task.Slot)\n\n\t\t// we can't prettify tty logs. tell the user that this is the case.\n\t\t// this is why we assign the logs function to a variable and delay calling\n\t\t// it. we want to check this before we make the call and checking twice in\n\t\t// each branch is even sloppier than this CLI disaster already is\n\t\tif tty && !opts.raw {\n\t\t\treturn errors.New(\"tty service logs only supported with --raw\")\n\t\t}\n\n\t\t// now get the logs\n\t\tresponseBody, err = apiClient.TaskLogs(ctx, opts.target, client.TaskLogsOptions{\n\t\t\tShowStdout: true,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/logs.go#L75-L111","documentation":"Error \"no such task or service: %v\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/logs.go:93 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}