ruvnet/RuView · error · RuntimeError

Cannot read /proc/net/wireless: {exc}

Error message

Cannot read /proc/net/wireless: {exc}

What it means

LinuxWifiCollector.is_available() already confirmed /proc/net/wireless exists via os.path.exists, but the subsequent open() raised an OSError (permission denied, broken procfs mount, or the file vanished between check and read). The reason string 'Cannot read /proc/net/wireless: {exc}' is returned as unavailable and _validate_interface() re-raises it as RuntimeError when the collector starts. This is a host-environment error: the Linux wireless procfs interface is present but not readable by the current process.

Source

Thrown at archive/v1/src/sensing/rssi_collector.py:218

        except OSError as exc:
            return False, f"Cannot read /proc/net/wireless: {exc}"

        if interface not in content:
            names = cls._parse_interface_names(content)
            return False, (
                f"Interface '{interface}' not listed in /proc/net/wireless. "
                f"Available: {names or '(none)'}. "
                f"Ensure the interface is up and associated with an AP."
            )
        return True, "ok"

    # -- internals -----------------------------------------------------------

    def _validate_interface(self) -> None:
        """Check that the interface exists on this machine."""
        available, reason = self.is_available(self._interface)
        if not available:
            raise RuntimeError(reason)

    @staticmethod
    def _parse_interface_names(proc_content: str) -> List[str]:
        """Extract interface names from /proc/net/wireless content."""
        names: List[str] = []
        for line in proc_content.splitlines()[2:]:  # skip header lines
            parts = line.split(":")
            if len(parts) >= 2:
                names.append(parts[0].strip())
        return names

    def _sample_loop(self) -> None:
        interval = 1.0 / self._rate
        while self._running:
            t0 = time.monotonic()
            try:
                sample = self._read_sample()
                self._buffer.append(sample)

View on GitHub (pinned to 4685618388)

Solutions

  1. Run the app on a normal Linux host with a WiFi adapter and a standard procfs mount; host RSSI sensing is not supported in restricted sandboxes.
  2. Diagnose the mount and permissions: run 'mount | grep proc' and 'ls -l /proc/net/wireless' as the same user the service runs as.
  3. If containerized, run with host network and an unmasked /proc (for example 'docker run --network host -v /proc:/proc' style setups) or move RSSI collection to the host.
  4. For camera-free perception in restricted environments, use the ESP32 CSI node firmware path instead of host WiFi sensing, which does not depend on /proc/net/wireless.

Example fix

# before
collector = LinuxWifiCollector(interface='wlan0')
collector.start()  # raises RuntimeError: Cannot read /proc/net/wireless: ...

# after
available, reason = LinuxWifiCollector.is_available('wlan0')
if not available:
    raise SystemExit(f'RSSI sensing unavailable on this host: {reason}')
collector = LinuxWifiCollector(interface='wlan0')
collector.start()
Defensive patterns

Strategy: validation

Validate before calling

available, reason = LinuxWifiCollector.is_available('wlan0')
if not available:
    raise SystemExit(f'RSSI sensing unavailable: {reason}')

Prevention

When it happens

Trigger: Calling LinuxWifiCollector(interface=...).start() (which runs _validate_interface -> is_available) on a host where open('/proc/net/wireless') raises OSError: EACCES under a restrictive container runtime or SELinux policy, a read-only or corrupted procfs mount, or a race where the file is removed after the exists() check.

Common situations: Running the collector inside Docker/Podman with a masked or restricted /proc; hardened or embedded Linux images that mount procfs with unusual options; running as an unprivileged user on systems where /proc/net/wireless is root-only; WSL2 with a partially exposed procfs.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/08a12f743d55f2b2. Report an issue: GitHub.