kubernetes/kops · error
error reading /proc/self/mountinfo: %v
Error message
error reading /proc/self/mountinfo: %v
What it means
BindMount.Find determines whether the mount already exists by parsing /proc/self/mountinfo. If the file cannot be read, the error is wrapped with this message. This indicates a /proc issue rather than a mount-state mismatch.
Source
Thrown at upup/pkg/fi/nodeup/nodetasks/bindmount.go:98
}
}
return deps
}
func findTaskInSlice(tasks []fi.NodeupTask, task fi.NodeupTask) int {
for i, t := range tasks {
if t == task {
return i
}
}
return -1
}
func (e *BindMount) Find(c *fi.NodeupContext) (*BindMount, error) {
mounts, err := os.ReadFile("/proc/self/mountinfo")
if err != nil {
return nil, fmt.Errorf("error reading /proc/self/mountinfo: %v", err)
}
for _, line := range strings.Split(string(mounts), "\n") {
// See `man mount_namespaces` and `man proc`
// 534 458 8:1 /var/lib/kubelet /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet rw,nosuid,nodev,noexec,relatime shared:19 - ext4 /dev/sda1 rw,commit=30,data=ordered
line = strings.TrimSpace(line)
if line == "" {
continue
}
tokens := strings.Fields(line)
if len(tokens) < 8 {
klog.V(4).Infof("ignoring mountinfo line: %q", line)
}
mountpoint := tokens[4]
if strings.TrimSuffix(mountpoint, "/") != strings.TrimSuffix(e.Mountpoint, "/") {
continue
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Ensure /proc is mounted in the environment (`mount -t proc proc /proc`)
- Run nodeup on the host (systemd unit) rather than inside a restricted container
- Check security profiles (seccomp/AppArmor/SELinux) that may deny reads on /proc/self/mountinfo
- Reboot/re-provision the node if procfs appears corrupted
Defensive patterns
Strategy: validation
Validate before calling
if _, err := os.Stat("/proc/self/mountinfo"); err != nil {
return errors.New("procfs unavailable; run nodeup on the host with /proc mounted")
} Try / catch
if err := nodeup.Run(ctx); err != nil {
if strings.Contains(err.Error(), "/proc/self/mountinfo") {
klog.Errorf("procfs inaccessible — check container/seccomp profile: %v", err)
}
} Prevention
- Always run nodeup on the host via systemd, not inside unprivileged containers
- Mount /proc in chroot/minimal environments before nodeup
- Review seccomp/AppArmor/SELinux policies for procfs read denials
- Test node bootstrap images for procfs availability
When it happens
Trigger: os.ReadFile("/proc/self/mountinfo") fails — /proc not mounted (minimal containers), procfs hidden by seccomp/AppArmor, or host filesystem corruption.
Common situations: Running nodeup inside a container without /proc mounted; hardened runtimes blocking procfs reads; chrooted environments lacking procfs.
Related errors
- failed to ensure the directory: %s, error: %w
- error creating temp dir: %v
- error writing temp file: %v
- error reading addons file %s: %v
- reading %q certificate: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/4fc2668f4113f017.
Report an issue: GitHub.