{"id":"03b1a161fcd2f7f9","repo":"docker/cli","slug":"unable-to-read-inspect-data-w","errorCode":null,"errorMessage":"unable to read inspect data: %w","messagePattern":"unable to read inspect data: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/inspect/inspector.go","lineNumber":134,"sourceCode":"\t\t}\n\t\treturn i.tryRawInspectFallback(rawElement)\n\t}\n\ti.buffer.Write(buffer.Bytes())\n\ti.buffer.WriteByte('\\n')\n\treturn nil\n}\n\n// tryRawInspectFallback executes the inspect template with a raw interface.\n// This allows docker cli to parse inspect structs injected with Swarm fields.\nfunc (i *TemplateInspector) tryRawInspectFallback(rawElement []byte) error {\n\tvar raw any\n\tbuffer := new(bytes.Buffer)\n\trdr := bytes.NewReader(rawElement)\n\tdec := json.NewDecoder(rdr)\n\tdec.UseNumber()\n\n\tif err := dec.Decode(&raw); err != nil {\n\t\treturn fmt.Errorf(\"unable to read inspect data: %w\", err)\n\t}\n\n\ttmplMissingKey := i.tmpl.Option(\"missingkey=error\")\n\tif err := tmplMissingKey.Execute(buffer, raw); err != nil {\n\t\treturn fmt.Errorf(\"template parsing error: %w\", err)\n\t}\n\n\ti.buffer.Write(buffer.Bytes())\n\ti.buffer.WriteByte('\\n')\n\treturn nil\n}\n\n// Flush writes the result of inspecting all elements into the output stream.\nfunc (i *TemplateInspector) Flush() error {\n\tif i.buffer.Len() == 0 {\n\t\t_, err := io.WriteString(i.out, \"\\n\")\n\t\treturn err\n\t}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/inspect/inspector.go#L116-L152","documentation":"Error \"unable to read inspect data: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/inspect/inspector.go:134 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}