home-assistant / supervisor

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

Adding a network storage with a "umlaut" (Ä, Ö, Ü) causes supervisor to stop working #4483

Closed Xitee1 closed 11 months ago

Xitee1 commented 1 year ago

Describe the issue you are experiencing

I had lots of trouble while trying to connect my network storage. Let me tell what I did: So I tried adding my network storage "Überwachungskameras" to the HA storage. After clicking connect, it would fail: chrome_ai4RULO3JV chrome_NA0ragu4Fn

I really cannot find anything related to this in the logs or it's completely useless. It tells you like "The error is:" with nothing coming after it. When clicking connect again nothing will happen. But this time the connect button is greyed out and the error message will disappear. Even after long waiting nothing happens. chrome_e8jxa7tmdO

And after that the problems began. So first I tried rebooting the host with the UI. It would not came back up and only show "connetion refused" (luckily it came back after cutting the power). Now, the next day, I tried again after updating core to the latest version. Same issue. Then a supervisor update appeared (from 2023.7.1 to 2023.8.1) on which I clicked install. First trough the UI (where it would be stuck for ~2 hours) and later with the command "ha supervisor update" where it told me finally something useful after around one hour of waiting: Post “[http://supervisor/supervisor/update 10](http://supervisor/supervisor/update)”: context deadline exceeded (Client.Timeout exceeded while awaiting headers)

So after a lot of googling I found this thread. I executed the manual update script and finally the update was finished.. and I was able again to add other network storages. After trying it again with the "Überachungskameras" it failed again and the supervisor kind of crashed like before.

After some testing it clearly is the Umlaut (Ä, Ö, Ü) which is causing the issue. In the name it is actually checking them. But not in the share name.

I know that the problem also is that the frontend is allowing these characters and thus "cause" the issue but I reported it here because I think it still is more supervisor related because a wrong character in my opinion should not crash the whole supervisor service. There needs to be better error handeling or timeouts. Or at best we get it to work with german umlauts. For me HA so far is the only thing which is causing problems with them. Let me know if this is the wrong place and I should report the issue somewhere else.

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. Add network storage trough the UI with a Umlaut in the remote share name.

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

I don't think so but here's my complete log:

23-08-08 23:31:12 INFO (MainThread) [supervisor.docker.supervisor] Attaching to Supervisor ghcr.io/home-assistant/aarch64-hassio-supervisor with version 2023.08.1
23-08-08 23:31:12 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.INITIALIZE
23-08-08 23:31:12 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-08-08 23:31:12 INFO (MainThread) [__main__] Setting up Supervisor
23-08-08 23:31:12 INFO (MainThread) [supervisor.api] Starting API on 172.30.32.2
23-08-08 23:31:12 INFO (MainThread) [supervisor.hardware.monitor] Started Supervisor hardware monitor
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.manager] Connected to system D-Bus.
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.agent] Load dbus interface io.hass.os
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.hostname] Load dbus interface org.freedesktop.hostname1
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.logind] Load dbus interface org.freedesktop.login1
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.network] Load dbus interface org.freedesktop.NetworkManager
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.rauc] Load dbus interface de.pengutronix.rauc
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.resolved] Load dbus interface org.freedesktop.resolve1
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.systemd] Load dbus interface org.freedesktop.systemd1
23-08-08 23:31:12 INFO (MainThread) [supervisor.dbus.timedate] Load dbus interface org.freedesktop.timedate1
23-08-08 23:31:13 INFO (MainThread) [supervisor.host.services] Updating service information
23-08-08 23:31:13 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
23-08-08 23:31:13 WARNING (MainThread) [supervisor.host.network] Requested to update interface eth0.5 which does not exist or is disabled.
23-08-08 23:31:13 INFO (MainThread) [supervisor.host.apparmor] Loading AppArmor Profiles: {'hassio-supervisor'}
23-08-08 23:31:13 INFO (MainThread) [supervisor.mounts.manager] Initializing all user-configured mounts
23-08-08 23:31:13 INFO (MainThread) [supervisor.host.network] Updating local network information
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.monitor] Started docker events monitor
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-cli with version 2023.06.0
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-dns with version 2023.06.2
23-08-08 23:31:13 INFO (MainThread) [supervisor.plugins.dns] Updated /etc/resolv.conf
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-audio with version 2023.06.0
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-observer with version 2023.06.0
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-multicast with version 2023.06.2
23-08-08 23:31:13 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
23-08-08 23:31:13 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/raspberrypi4-64-homeassistant with version 2023.8.1
23-08-08 23:31:13 INFO (MainThread) [supervisor.homeassistant.secrets] Loaded 7 Home Assistant secrets
23-08-08 23:31:14 INFO (MainThread) [supervisor.os.manager] Detect Home Assistant Operating System 10.4 / BootSlot B
23-08-08 23:31:15 WARNING (SyncWorker_0) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Frigate (Full Access) Beta (0.12.0)
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/core repository
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/ccab4aaf repository
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/5c53de3b repository
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/abc67f79 repository
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/a0d7b954 repository
23-08-08 23:31:16 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/15d21743 repository
23-08-08 23:31:18 WARNING (SyncWorker_4) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Frigate (Full Access) Beta (0.12.0)
23-08-08 23:31:19 INFO (MainThread) [supervisor.store] Loading add-ons from store: 78 all - 78 new - 0 remove
23-08-08 23:31:19 INFO (MainThread) [supervisor.addons] Found 13 installed add-ons
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/esphome/esphome-hassio with version 2023.6.3
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-mariadb with version 2.6.1
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/chrony/aarch64 with version 2.6.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-configurator with version 5.6.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-mosquitto with version 6.2.1
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/influxdb/aarch64 with version 4.7.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-ssh with version 9.7.1
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/tasmoadmin/aarch64 with version 0.25.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/ssh/aarch64 with version 15.0.6
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/vscode/aarch64 with version 5.10.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/grafana/aarch64 with version 9.0.3
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/appdaemon/aarch64 with version 0.13.4
23-08-08 23:31:19 INFO (MainThread) [supervisor.docker.interface] Attaching to thomasmauerer/samba-backup-aarch64 with version 5.2.0
23-08-08 23:31:19 INFO (MainThread) [supervisor.backups.manager] Found 9 backup files
23-08-08 23:31:27 INFO (MainThread) [supervisor.discovery] Loaded 2 messages
23-08-08 23:31:27 INFO (MainThread) [supervisor.ingress] Loaded 5 ingress sessions
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state CoreState.SETUP
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.check] System checks complete
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.SETUP
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-08-08 23:31:27 INFO (MainThread) [supervisor.jobs] 'ResolutionFixup.run_autofix' blocked from execution, system is not running - CoreState.SETUP
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.SETUP
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-08-08 23:31:27 INFO (MainThread) [__main__] Running Supervisor
23-08-08 23:31:27 INFO (MainThread) [supervisor.os.manager] Rauc: B - marked slot kernel.1 as good
23-08-08 23:31:27 INFO (MainThread) [supervisor.addons] Phase 'AddonStartup.INITIALIZE' starting 0 add-ons
23-08-08 23:31:27 INFO (MainThread) [supervisor.core] Supervisor reboot detected
23-08-08 23:31:27 INFO (MainThread) [supervisor.misc.tasks] All core tasks are scheduled
23-08-08 23:31:27 INFO (MainThread) [supervisor.core] Supervisor is up and running
23-08-08 23:31:27 INFO (MainThread) [supervisor.host.info] Updating local host information
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state CoreState.RUNNING
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.FREE_SPACE/ContextType.SYSTEM
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.MULTIPLE_DATA_DISKS/ContextType.SYSTEM
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.PWNED/ContextType.ADDON
23-08-08 23:31:27 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
23-08-08 23:31:27 INFO (MainThread) [supervisor.host.services] Updating service information
23-08-08 23:31:27 INFO (MainThread) [supervisor.host.network] Updating local network information
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.TRUST/ContextType.SUPERVISOR
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.DNS_SERVER_FAILED/ContextType.DNS_SERVER
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.DNS_SERVER_IPV6_ERROR/ContextType.DNS_SERVER
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.DOCKER_CONFIG/ContextType.SYSTEM
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.IPV4_CONNECTION_PROBLEM/ContextType.SYSTEM
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.NO_CURRENT_BACKUP/ContextType.SYSTEM
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.SECURITY/ContextType.CORE
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.check] System checks complete
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
23-08-08 23:31:27 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
23-08-08 23:31:27 INFO (MainThread) [supervisor.host.manager] Host information reload completed
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state CoreState.RUNNING
23-08-08 23:31:27 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
23-08-08 23:31:29 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
23-08-08 23:31:29 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_appdaemon
23-08-08 23:31:29 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running

System Health information

Nothing available

Supervisor diagnostics

No response

Additional information

No response

mdegat01 commented 1 year ago

Ah yes those characters cannot be used in a mount name since the mount name becomes the file name on disk. I didn't realize \w allowed those in python regex, correcting now with a better validation message. Thanks!

Xitee1 commented 1 year ago

those characters cannot be used in a mount name since the mount name becomes the file name

That's really the problem? Because actually you can use them in file names, both, in Windows and Linux. But thanks for fixing the validation. At least then the supervisor can no longer crash by using normal german words :)

Xitee1 commented 1 year ago

After looking at the changes you've made I think you misunderstood which field is causing the error. Sorry that I haven't clearly said that. It's the "Remote-Freigabe", not the "Name" (first field). There the check was successful. It didn't allowed me to use umlauts. That's why I replaced the Ü with U in there (see first screenshot). It's the share name itself (defined in my SMB server config) that has an umlaut which causes the error.

        json={
            "name": "Uberwachungskameras",
            "type": "cifs",
            "usage": "share",
            "server": "nas.local",
            "share": "Überwachungskameras", # <-- This is what's failing
            "version": "2.0",
        },
agners commented 11 months ago

It seems that this causes the D-Bus broker to disconnect the Supervisor :cold_sweat:

hassio_supervisor[421]: 23-10-04 16:19:22 INFO (MainThread) [supervisor.mounts.manager] Creating or updating mount: uber
dbus-broker[136]: Peer :1.82 is being disconnected as it sent a message with an invalid body.
hassio_supervisor[421]: 23-10-04 16:19:22 ERROR (MainThread) [supervisor.mounts.mount] Could not mount uber due to: 
homeassistant[421]: 2023-10-04 16:19:22.463 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /mounts - Could not mount uber due to:

To reproduce this there is no SMB server with a share with umlaut needed. It seems that the message we pass to systemd gets declined, before any connection attempt is being made.

This is after clicking connect

image

agners commented 11 months ago

As @mdegat01 found, the underlying issue is actually in the D-Bus library. It is fixed by https://github.com/Bluetooth-Devices/dbus-fast/pull/261. A bump in Supervisor will follow soon.

agners commented 11 months ago

This is resolved by https://github.com/home-assistant/supervisor/pull/4603.