home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.72k stars 629 forks source link

AttributeError: 'NoneType' object has no attribute 'ssid' #5271

Closed Bluscream closed 5 days ago

Bluscream commented 3 weeks ago

Describe the issue you are experiencing

The supervisor fails to generate something.

Other users have also reported this issue https://community.home-assistant.io/t/cant-change-wlan-settings/564670

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Steps to reproduce the issue

  1. Try enabling wifi on http://homeassistant.local:8123/config/network
  2. Get denied

Anything in the Supervisor logs that might be useful for us?

2024-08-26 04:13:12.368 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 189, in block_bad_requests
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 205, in system_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 272, in token_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 283, in core_proxy
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/utils.py", line 63, in wrap_api
    answer = await method(api, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/network.py", line 222, in interface_update
    await asyncio.shield(self.sys_host.network.apply_changes(interface))
  File "/usr/src/supervisor/supervisor/host/network.py", line 221, in apply_changes
    settings = get_connection_from_interface(interface, self.sys_dbus.network)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/dbus/network/setting/generate.py", line 141, in get_connection_from_interface
    "ssid": Variant("ay", interface.wifi.ssid.encode("UTF-8")),
                          ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ssid'

System Health information

System Information

version core-2024.8.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.31-haos-raspi
arch aarch64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4708 Installed Version | 1.34.0 Stage | running Available Repositories | 1467 Downloaded Repositories | 49 HACS Data | ok
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | January 1, 2018 at 12:00 AM relayer_connected | false relayer_region | null remote_enabled | true remote_connected | false alexa_enabled | false google_enabled | true remote_server | null certificate_status | null instance_id | d0780bade37e42cfab1c83cc683c3017 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.08.0 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 57.8 GB disk_used | 34.9 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | false ntp_synchronized | true virtualization | board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), ZeroTier One (0.18.0), Log Viewer (0.17.0), Advanced SSH & Web Terminal (18.0.0), Mosquitto broker (6.4.1), ESPHome (2024.8.0), Studio Code Server (5.15.0), Network UPS Tools (0.13.1), Whisper (2.1.2), Piper (1.5.2), Samba share (12.3.2), Let's Encrypt (5.1.1), CEC Scanner (3.0), A9 Camera fake server (2.4), RPC Shutdown (2.5), Google Assistant SDK (2.5.0), Matter Server (6.4.1), OpenThread Border Router (2.9.1), openWakeWord (1.10.0), MQTT IO (0.4.0), go2rtc (1.9.4), Castsponsorskip (0.8.0), Home Assistant Git Exporter (1.17.0), AirCast (4.2.1), Portainer Agent (linux-ppc64le-2.21.0-rc2-alpine), motionEye (0.20.0), Portainer (2.20.1), AppDaemon (0.16.6), Vaultwarden (Bitwarden) (0.22.0), Music Assistant Server (2.2.2), Zigbee2MQTT (1.39.1-1), MPD (1.7.2)
Dashboards dashboards | 15 -- | -- resources | 20 views | 50 mode | storage
Recorder oldest_recorder_run | August 20, 2024 at 2:57 PM -- | -- current_recorder_run | August 26, 2024 at 12:53 AM estimated_db_size | 1221.38 MiB database_engine | sqlite database_version | 3.45.3

Supervisor diagnostics

No response

Additional information

No response

JanosBerke commented 2 weeks ago

I have exactly the same error message. I wanted to add an additional usb wifi adapter next to the existing, built-in and LAN adapter to be able to use it for ModBus communication with a device. My hardware is a Yellow.

agners commented 5 days ago

This will be fixed with the upcomming Supervisor release.

That said, there will now a error appear asking you to provide a SSID. In the frontend, that means you have to scan for access points and select one. Then the above error should also not appear.