{"record":{"id":"143d560f0d4cf365","repo":"GoogleContainerTools/skaffold","slug":"unknown-operating-system-q","errorCode":null,"errorMessage":"unknown operating system %q","messagePattern":"unknown operating system %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/platform/platform.go","lineNumber":138,"sourceCode":"\nfunc isKnownPlatform(p specs.Platform) error {\n\tif err := isKnownOS(p.OS); err != nil {\n\t\treturn err\n\t}\n\tif err := isKnownArch(p.Architecture); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// isKnownOS returns an error if we don't know about the operating system.\n// Unexported function copied from \"github.com/containerd/containerd/platforms\"\nfunc isKnownOS(os string) error {\n\tswitch os {\n\tcase \"aix\", \"android\", \"darwin\", \"dragonfly\", \"freebsd\", \"hurd\", \"illumos\", \"js\", \"linux\", \"nacl\", \"netbsd\", \"openbsd\", \"plan9\", \"solaris\", \"windows\", \"zos\":\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown operating system %q\", os)\n}\n\n// isKnownArch returns an error if we don't know about the architecture.\n// Unexported function copied from \"github.com/containerd/containerd/platforms\"\nfunc isKnownArch(arch string) error {\n\tswitch arch {\n\tcase \"386\", \"amd64\", \"amd64p32\", \"arm\", \"armbe\", \"arm64\", \"arm64be\", \"ppc64\", \"ppc64le\", \"mips\", \"mipsle\", \"mips64\", \"mips64le\", \"mips64p32\", \"mips64p32le\", \"ppc\", \"riscv\", \"riscv64\", \"s390\", \"s390x\", \"sparc\", \"sparc64\", \"wasm\":\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown architecture %q\", arch)\n}\n\nfunc Format(pl specs.Platform) string { return platforms.Format(pl) }\n","sourceCodeStart":120,"sourceCodeEnd":152,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/platform/platform.go#L120-L152","documentation":"Skaffold validates the OS component of a platform string against the list of known GOOS values (copied from containerd/platforms). If the OS token is not in that list, isKnownOS returns this error and platform matching fails. Note it uses GOOS names like darwin, not marketing names like macos or osx.","triggerScenarios":"A platform selection contains an unknown OS token, e.g. skaffold --platform linux/bogus or build.platforms: [macos/amd64] in skaffold.yaml; isKnownPlatform calls isKnownOS which falls through its switch.","commonSituations":"Writing macos or osx instead of darwin; writing win or win32 instead of windows; typos like linx; copying a Docker --platform value that uses non-GOOS naming.","solutions":["Use GOOS names: linux, darwin, windows, freebsd, solaris, etc.","Replace macos/osx with darwin and win32 with windows in your platform string","Check the full platform with a known-good value first, e.g. linux/amd64, then adjust"],"exampleFix":"// before (skaffold.yaml)\nbuild:\n  platforms: [\"macos/arm64\"]\n// after\nbuild:\n  platforms: [\"darwin/arm64\"]","handlingStrategy":"validation","validationCode":"const knownOS = new Set([\"aix\",\"android\",\"darwin\",\"dragonfly\",\"freebsd\",\"hurd\",\"illumos\",\"js\",\"linux\",\"nacl\",\"netbsd\",\"openbsd\",\"plan9\",\"solaris\",\"windows\",\"zos\"]);\nfunction validPlatformOS(p) { const os = p.split(\"/\")[0]; return knownOS.has(os); }","typeGuard":"function isKnownOS(os) {\n  return [\"aix\",\"android\",\"darwin\",\"dragonfly\",\"freebsd\",\"hurd\",\"illumos\",\"js\",\"linux\",\"nacl\",\"netbsd\",\"openbsd\",\"plan9\",\"solaris\",\"windows\",\"zos\"].includes(os);\n}","tryCatchPattern":"try {\n  await skaffold.build({ platforms: [sel] });\n} catch (e) {\n  if (/unknown operating system/.test(String(e))) {\n    throw new Error(`Bad OS in platform \"${sel}\"; use GOOS names like darwin, not macos`);\n  }\n  throw e;\n}","preventionTips":["Always use GOOS spellings: darwin not macos/osx, windows not win32","Validate platform strings in CI before invoking skaffold","Cross-check against `go tool dist list` for valid OS/arch pairs"],"tags":["platform","configuration","os"],"backgroundTag":"unknown-platform-os","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}