{"record":{"id":"a13f7edfa5fd11d5","repo":"docker/cli","slug":"error-no-such-object-s","errorCode":null,"errorMessage":"error: no such object: %s","messagePattern":"error: no such object: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/system/inspect.go","lineNumber":281,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif isSwarmSupported == swarmUnsupported {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tv, raw, err := inspectData.objectInspector(ref)\n\t\t\tif err != nil {\n\t\t\t\tif typeConstraint == \"\" && isErrSkippable(err) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn v, raw, err\n\t\t\t}\n\t\t\tif getSize && !inspectData.isSizeSupported {\n\t\t\t\t_, _ = fmt.Fprintln(dockerCLI.Err(), \"WARNING: --size ignored for\", inspectData.objectType)\n\t\t\t}\n\t\t\treturn v, raw, err\n\t\t}\n\t\treturn nil, nil, fmt.Errorf(\"error: no such object: %s\", ref)\n\t}\n}\n\nfunc isErrSkippable(err error) bool {\n\treturn errdefs.IsNotFound(err) ||\n\t\tstrings.Contains(err.Error(), \"not supported\") ||\n\t\tstrings.Contains(err.Error(), \"invalid reference format\")\n}\n","sourceCodeStart":263,"sourceCodeEnd":290,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/system/inspect.go#L263-L290","documentation":"Produced by 'docker inspect' when a given reference is not found in any searched object type. The elementSearcher iterates over all applicable types and, finding no match (and skipping not-found when type is unconstrained), returns this 'no such object' error.","triggerScenarios":"Running 'docker inspect <missing-id>' where the ID/name doesn't match any container, image, network, volume, service, task, node, secret, plugin, or config. Triggered at inspect.go:281 after the loop exhausts types.","commonSituations":"Typo in the ID/name; object was deleted; wrong context/daemon (object exists on a different host); abbreviated ID prefix is ambiguous and matched nothing; type filter hides the actual object type.","solutions":["Verify the object exists with the relevant 'docker <type> ls' (e.g. 'docker ps -a', 'docker images').","Confirm you're on the right context/daemon ('docker context ls').","Drop --type if set, in case the object is a different kind than assumed.","Use the full ID instead of an ambiguous short prefix."],"exampleFix":"# before\ndocker inspect mycontainer\n\n# after: confirm it exists, then inspect\ndocker ps -a --filter name=mycontainer\ndocker inspect mycontainer  # use exact name/id","handlingStrategy":"try-catch","validationCode":"// Confirm object existence before inspect (example: container)\nif _, err := apiClient.ContainerInspect(ctx, ref, client.ContainerInspectOptions{}); err != nil {\n    if errdefs.IsNotFound(err) {\n        return fmt.Errorf(\"no such object: %s\", ref)\n    }\n    return err\n}","typeGuard":"func isNoSuchObjectErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"no such object:\")\n}","tryCatchPattern":"v, raw, err := elementSearcher(ref)\nif err != nil {\n    if isNoSuchObjectErr(err) {\n        // optionally search a broader type set or report gracefully\n        return nil\n    }\n    return err\n}","preventionTips":["Verify the object with the relevant 'docker <type> ls' first.","Use the right context/daemon.","Pass full IDs to avoid ambiguous prefixes."],"tags":["inspect","not-found","object","validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}