{"record":{"id":"fd5583915ef3ca59","repo":"kubernetes/kops","slug":"error-parsing-dpkg-query-line-q","errorCode":null,"errorMessage":"error parsing dpkg-query line %q","messagePattern":"error parsing dpkg-query line %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/package.go","lineNumber":172,"sourceCode":"\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tif strings.Contains(string(output), \"no packages found\") {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error listing installed packages: %v: %s\", err, string(output))\n\t}\n\n\tinstalled := false\n\tvar healthy *bool\n\tinstalledVersion := \"\"\n\tfor _, line := range strings.Split(string(output), \"\\n\") {\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\ttokens := strings.Split(line, \"\\t\")\n\t\tif len(tokens) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"error parsing dpkg-query line %q\", line)\n\t\t}\n\t\tstate := strings.TrimSpace(tokens[0])\n\t\tversion := strings.TrimSpace(tokens[1])\n\n\t\tswitch state {\n\t\tcase \"ii\":\n\t\t\tinstalled = true\n\t\t\tinstalledVersion = version\n\t\t\thealthy = new(true)\n\t\tcase \"iF\", \"iU\":\n\t\t\tinstalled = true\n\t\t\tinstalledVersion = version\n\t\t\thealthy = new(false)\n\t\tcase \"rc\":\n\t\t\t// removed\n\t\t\tinstalled = false\n\t\tcase \"un\":\n\t\t\t// unknown","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/package.go#L154-L190","documentation":"Error \"error parsing dpkg-query line %q\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/nodeup/nodetasks/package.go:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}