Skip to content

[BUG]: Namespaces blocks startup of core #111

@bentumbler

Description

@bentumbler

What happened?

The namespaces code ran as a blocking part of wlanpi-core startup, and if it failed, core failed to start. When connecting to a weak or non existent SSID, that blocking code delays the startup of core

Relevant log output

026-01-22 15:51:35,014 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:35,015 - wlanpi_core.services.network_namespace_service - INFO - found connected network: ['d8:b3:70:f8:75:79', '5240', '-86', '[WPA2-SAE-CCMP][SAE-H2E][ESS]', 'OrbWPA3PSK']
2026-01-22 15:51:35,015 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns ip addr show wlan0
2026-01-22 15:51:35,052 - wlanpi_core.services.network_namespace_service - INFO - stdout: 4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether e4:60:17:64:e8:e9 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::e660:17ff:fe64:e8e9/64 scope link tentative 
       valid_lft forever preferred_lft forever

2026-01-22 15:51:35,053 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:35,053 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:35,054 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns dhclient -r wlan0
2026-01-22 15:51:35,182 - wlanpi_core.services.network_namespace_service - INFO - stdout: 
2026-01-22 15:51:35,183 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:35,183 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:35,184 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns pkill -f dhclient.*wlan0
2026-01-22 15:51:35,244 - wlanpi_core.services.network_namespace_service - INFO - stdout: 
2026-01-22 15:51:35,245 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:35,246 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:36,247 - wlanpi_core.services.network_namespace_service - INFO - Starting DHCP client for wlan0 with timeout
2026-01-22 15:51:36,248 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns timeout 15 dhclient -v -1 wlan0
2026-01-22 15:51:36,492 - wlanpi_core.services.network_namespace_service - INFO - stdout: 
2026-01-22 15:51:36,493 - wlanpi_core.services.network_namespace_service - INFO - stderr: Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/e4:60:17:64:e8:e9
Sending on   LPF/wlan0/e4:60:17:64:e8:e9
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPOFFER of 192.168.10.216 from 192.168.10.1
DHCPREQUEST for 192.168.10.216 on wlan0 to 255.255.255.255 port 67
DHCPACK of 192.168.10.216 from 192.168.10.1
bound to 192.168.10.216 -- renewal in 38719 seconds.

2026-01-22 15:51:36,494 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:36,494 - wlanpi_core.services.network_namespace_service - INFO - DHCP completed for wlan0
2026-01-22 15:51:36,496 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns ip route show default
2026-01-22 15:51:36,533 - wlanpi_core.services.network_namespace_service - INFO - stdout: default via 192.168.10.1 dev wlan0 

2026-01-22 15:51:36,534 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:36,534 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:36,536 - wlanpi_core.services.network_namespace_service - INFO - Starting app 'orb' in namespace 'wlan0_ns' with command: /usr/bin/orb sensor
2026-01-22 15:51:36,537 - wlanpi_core.services.network_namespace_service - INFO - Executing command: ip netns exec wlan0_ns /usr/bin/orb sensor
2026-01-22 15:51:36,538 - wlanpi_core.services.network_namespace_service - INFO - App log file will be written to: /tmp/orb.log
2026-01-22 15:51:36,553 - wlanpi_core.services.network_namespace_service - INFO - Launched app 'orb' in namespace 'wlan0_ns' with PID 653838
2026-01-22 15:51:37,055 - wlanpi_core.services.network_namespace_service - INFO - Process 653838 is running (confirmed via poll())
2026-01-22 15:51:37,056 - wlanpi_core.services.network_namespace_service - INFO - Running: ip netns pids wlan0_ns
2026-01-22 15:51:37,075 - wlanpi_core.services.network_namespace_service - INFO - Process 653838 confirmed visible in namespace 'wlan0_ns' (found in namespace PIDs)
2026-01-22 15:51:37,076 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns ss -tulpn
2026-01-22 15:51:37,157 - wlanpi_core.services.network_namespace_service - INFO - No network bindings found for PID 653838 yet (process may not have bound to interfaces yet)
2026-01-22 15:51:37,158 - wlanpi_core.services.network_namespace_service - INFO - App 'orb' startup verification complete. Monitor logs at /tmp/orb.log
2026-01-22 15:51:37,159 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns wpa_cli -i wlan0 status
2026-01-22 15:51:37,193 - wlanpi_core.services.network_namespace_service - INFO - stdout: bssid=d8:b3:70:f8:75:79
freq=5240
ssid=OrbWPA3PSK
id=0
mode=station
wifi_generation=7
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=SAE
pmf=2
mgmt_group_cipher=BIP
sae_group=19
sae_h2e=1
sae_pk=0
wpa_state=COMPLETED
ip_address=192.168.10.216
p2p_device_address=e4:60:17:64:e8:ea
address=e4:60:17:64:e8:e9
uuid=25d52bb1-df8f-5892-a81c-e18a4a67aa6f
ieee80211ac=1
ssid_verified=1

2026-01-22 15:51:37,194 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:37,194 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:37,195 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns wpa_cli -i wlan0 scan_results
2026-01-22 15:51:37,228 - wlanpi_core.services.network_namespace_service - INFO - stdout: bssid / frequency / signal level / flags / ssid

2026-01-22 15:51:37,230 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:37,230 - wlanpi_core.services.network_namespace_service - INFO - found connected network: ['d8:b3:70:f8:75:79', '5240', '-86', '[WPA2-SAE-CCMP][SAE-H2E][ESS]', 'OrbWPA3PSK']
2026-01-22 15:51:37,230 - wlanpi_core.services.network_namespace_service - INFO - Running: sudo ip netns exec wlan0_ns ip addr show wlan0
2026-01-22 15:51:37,265 - wlanpi_core.services.network_namespace_service - INFO - stdout: 4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether e4:60:17:64:e8:e9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.216/24 brd 192.168.10.255 scope global dynamic wlan0
       valid_lft 86400sec preferred_lft 86400sec
    inet6 fe80::e660:17ff:fe64:e8e9/64 scope link 
       valid_lft forever preferred_lft forever

2026-01-22 15:51:37,266 - wlanpi_core.services.network_namespace_service - INFO - stderr: 
2026-01-22 15:51:37,266 - wlanpi_core.services.network_namespace_service - INFO - return_code: 0
2026-01-22 15:51:37,268 - wlanpi_core.app - INFO - Config wlan0_OrbWPA3PSK activated successfully
2026-01-22 15:51:37,292 - wlanpi_core.app - DEBUG - System manager initialized succcessfully
2026-01-22 15:51:37,294 - wlanpi_core.core.security - DEBUG - Filesystem ready after 1 attempts
2026-01-22 15:51:37,296 - wlanpi_core.core.security - DEBUG - Loaded existing shared secret
2026-01-22 15:51:37,311 - wlanpi_core.core.security - DEBUG - Loaded existing encryption key
2026-01-22 15:51:37,312 - wlanpi_core.core.security - DEBUG - Security initialization complete
2026-01-22 15:51:37,312 - wlanpi_core.app - INFO - Security manager initialized successfully
2026-01-22 15:51:37,372 - wlanpi_core.core.database - DEBUG - Database engine initialized
2026-01-22 15:51:37,373 - wlanpi_core.core.database - INFO - Initializing database
2026-01-22 15:51:37,395 - wlanpi_core.core.database - DEBUG - Database tables initialized
2026-01-22 15:51:37,396 - wlanpi_core.core.database - INFO - Database initialization successful on attempt 1
2026-01-22 15:51:37,397 - wlanpi_core.app - INFO - Database manager initialized successfully
2026-01-22 15:51:37,398 - wlanpi_core.app - DEBUG - Token manager initialized successfully
2026-01-22 15:51:37,398 - wlanpi_core.app - INFO - All components initialized ...
2026-01-22 15:51:37,399 - wlanpi_core.app - INFO - Application successfully initialized
2026-01-22 15:51:37,399 - wlanpi_core.app - DEBUG - Application health monitoring started
INFO:     Application startup complete.

How often does this bug happen?

Every time

What version are you using?

Core 2.1.7

Where is the bug located?

No response

Self Service

  • I would be willing to fix this bug myself.

Guidelines and Policies

  • I have read the contributing guidelines and agree to follow the code of conduct and contribution policies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions