Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ha network update wlan0 without required params causes internal server error #4977

Closed
aambroze opened this issue Mar 22, 2024 · 5 comments
Closed

Comments

@aambroze
Copy link

aambroze commented Mar 22, 2024

(report re-written to reflect actual issue, pointed out by @agners)

Configuring wlan using ha network update without providing all required parameters causes internal server error with no feedback to the user.

image image

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 to configure wlan adapter from shell without providing required parameters
  2. Internal server error occurs. No feedback for the user about required parameters.

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

24-03-22 17:32:33 INFO (MainThread) [supervisor.api.middleware.security] /network/info access from core_ssh
24-03-22 17:32:33 INFO (MainThread) [supervisor.api.middleware.security] /network/info access from core_ssh
24-03-22 17:32:33 INFO (MainThread) [supervisor.api.middleware.security] /host/info access from core_ssh
24-03-22 17:32:33 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from core_ssh
24-03-22 17:32:38 INFO (MainThread) [supervisor.api.middleware.security] /network/info access from core_ssh
24-03-22 17:33:03 INFO (MainThread) [supervisor.api.middleware.security] /network/interface/wlan0/update access from core_ssh
24-03-22 17:33:03 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.3.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.20-haos
arch aarch64
timezone Europe/Warsaw
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4946
Installed Version 1.34.0
Stage running
Available Repositories 1401
Downloaded Repositories 9
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.1
update_channel stable
supervisor_version supervisor-2024.03.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 56.6 GB
disk_used 6.9 GB
healthy true
supported true
board odroid-n2
supervisor_api ok
version_api ok
installed_addons Studio Code Server (5.15.0), Terminal & SSH (9.10.0), Cloudflared (5.1.6), Home Assistant Google Drive Backup (0.112.1), File editor (5.8.0), Mosquitto broker (6.4.0), Zigbee2MQTT (1.36.0-1)
Dashboards
dashboards 8
resources 2
views 7
mode storage
Recorder
oldest_recorder_run 14 marca 2024 o 14:57
current_recorder_run 22 marca 2024 o 17:32
estimated_db_size 40.30 MiB
database_engine sqlite
database_version 3.44.2

Supervisor diagnostics

config_entry-hassio-8302e49fdefff51c8551e0885c7aa39f.json

Additional information

No response

@aambroze aambroze added the bug label Mar 22, 2024
@agners
Copy link
Member

agners commented Mar 27, 2024

The network configuration has no WiFi mode/SSID/authentication information, that is why that stack trace is caused.

Granted, Supervisor should handle this a bit more gracefully and send back an appropriate error.

But when passing WiFi information (--wifi-auth, --wifi-mode, --wifi-psk and --wifi-ssid), things should work again.

@aambroze
Copy link
Author

I’ll try.

Even if that’s the case and it’s about providing proper network details and not graceful response…

Is it expected that my network details can be wiped during update from 11.5 to 12.1? Maybe that’s my actual issue ?

@aambroze
Copy link
Author

@agners
Thank you for suggestion.

I've connected using Ethernet and successfully enabled and connected to WiFi.

This leaves us with two issues:

  • very ungraceful Supervisor behavior (crash/500 instead of simple information about required params),
  • updating HAOS from 11.5 to 12.1 wipes WLAN details.

I'll redact my report to reflect the first issue. Where should I report second one?

@aambroze aambroze changed the title ODROID N2+ WLAN/BT dongle doesn't work after updating to 12.1 ha network update wlan0 without required params causes internal server error Mar 28, 2024
@agners
Copy link
Member

agners commented Apr 8, 2024

  • updating HAOS from 11.5 to 12.1 wipes WLAN details.

I'll redact my report to reflect the first issue. Where should I report second one?

This would go to the Home Assistant Operating System repository.

Copy link

github-actions bot commented May 8, 2024

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants