{"record":{"id":"884c0583fd6a7b53","repo":"kubernetes/kops","slug":"error-reading-kernel-release-w","errorCode":null,"errorMessage":"error reading kernel release: %w","messagePattern":"error reading kernel release: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/command.go","lineNumber":690,"sourceCode":"\t// TODO: Add to /etc/modules-load.d/ ?\n\treturn nil\n}\n\n// installKernelModulesExtra installs the kernel-modules-extra package matching the\n// running kernel. The RHEL10 and Rocky10 images drop it from the iptables-nft\n// dependency chain, so nft_compat, the xt_* matches, ip_set and br_netfilter are\n// simply absent from a freshly booted node.\n//\n// The package is pinned to the running kernel release because an unpinned install\n// resolves to the newest build in the repo, whose modules land under a /lib/modules\n// directory we have not booted, leaving the running kernel just as empty.\n//\n// TODO: Move to tasks architecture along with loadKernelModules. It has to happen\n// here for now because the modprobes above run before any task does.\nfunc installKernelModulesExtra() error {\n\trelease, err := os.ReadFile(\"/proc/sys/kernel/osrelease\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading kernel release: %w\", err)\n\t}\n\n\tpkg := \"kernel-modules-extra-\" + strings.TrimSpace(string(release))\n\tklog.Infof(\"Installing %s\", pkg)\n\tcmd := exec.Command(\"/usr/bin/dnf\", \"install\", \"-y\", pkg)\n\tif output, err := cmd.CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"error installing %s (%v): %s\", pkg, err, string(output))\n\t}\n\treturn nil\n}\n\n// getRegion queries the cloud provider for the region.\nfunc getRegion(ctx context.Context, bootConfig *nodeup.BootConfig) (string, error) {\n\tswitch bootConfig.CloudProvider {\n\tcase api.CloudProviderAWS:\n\t\tregion, err := awsbootstrap.RegionFromMetadata(ctx)\n\t\tif err != nil {\n\t\t\treturn \"\", err","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/command.go#L672-L708","documentation":"Error \"error reading kernel release: %w\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/nodeup/command.go:690 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-12T12:17:11.808Z"}