{"record":{"id":"f6314ad7006e8b3b","repo":"kubernetes/kubernetes","slug":"kubelet-unsupported-in-this-build","errorCode":null,"errorMessage":"kubelet unsupported in this build","messagePattern":"kubelet unsupported in this build","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kubelet/app/server_unsupported.go","lineNumber":27,"sourceCode":"\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage app\n\nimport (\n\t\"context\"\n\t\"errors\"\n)\n\nfunc watchForLockfileContention(ctx context.Context, path string, done chan struct{}) error {\n\treturn errors.New(\"kubelet unsupported in this build\")\n}\n\nfunc isCgroup2UnifiedMode() bool {\n\treturn false\n}\n","sourceCodeStart":9,"sourceCodeEnd":33,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kubelet/app/server_unsupported.go#L9-L33","documentation":"watchForLockfileContention is a build-tag stub: server_unsupported.go is compiled with `//go:build !linux`, so on non-Linux platforms it always returns this error. The real implementation (inotify-based lock watching) exists only for Linux. This surfaces if lock-file contention watching is requested on a non-Linux build.","triggerScenarios":"Building/running kubelet for a non-Linux OS (e.g. darwin, or a non-Linux target) and enabling --exit-on-lock-contention with a lock path, which calls watchForLockfileContention. The stub cannot use inotify and so errors.","commonSituations":"Cross-compiling or running kubelet tooling on macOS for local development; a build constraint mismatch; invoking the contention-watch codepath on Windows (Windows has its own server_windows.go but lock contention watching routes to the stub).","solutions":["Run kubelet on Linux if you need lock-file contention watching.","Disable --exit-on-lock-contention on non-Linux platforms (the contention feature is Linux/inotify-specific).","For Windows, rely on the Windows service manager / native locking rather than the inotify-based contention watcher."],"exampleFix":"// before — running on macOS with contention enabled\n--exit-on-lock-contention=true --lock-file-path=/tmp/kubelet.lock\n\n// after — disable on non-Linux\n# (omit --exit-on-lock-contention)","handlingStrategy":"validation","validationCode":"// guard the contention watcher to Linux builds only\n//go:build linux\nfunc enableLockContention() { /* real inotify impl */ }\n// on non-Linux, return an explanatory error rather than calling the stub","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only enable lock-file contention watching on Linux.","Document that --exit-on-lock-contention is Linux/inotify-specific.","On Windows/other platforms use native locking/service mechanisms."],"tags":["kubelet","lock-file","build-tags","linux-only","platform"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}