home-assistant / supervisor

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

Unknown error when using a space in hostname #4978

Closed blaauboer closed 3 months ago

blaauboer commented 3 months ago

Describe the issue you are experiencing

When trying to change the hostname in Home Assistant OS and using a space, it results in the following error: "Unknown error, see supervisor logs".

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. Go to settings -> network
  2. Edit hostname with a space in the name
  3. Click save

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

Logger: homeassistant.components.hassio
Bron: components/hassio/websocket_api.py:138
integratie: Home Assistant Supervisor (documentation, issues)
First occurred: 13:48:25 (5 gebeurtenissen)
Laatst gelogd: 14:11:38

Failed to to call /host/options -

System Health information

None

Supervisor diagnostics

No response

Additional information

No response

agners commented 3 months ago

In general, you can't use a hostname with a space, that is just a restriction.

However, instead of showing "Unknown error, see supervisor logs", a better message should appear. I think that was due to a issue on Core side in error handling, it should be fixed with https://github.com/home-assistant/core/pull/113144 (part of 2024.3.1). What version of Core are you using?

mdegat01 commented 3 months ago

You can't have a hostname with a space in it. The PR linked above will make the error clearer, but in the end that's what's happening. This isn't supervisor's rule, it's way lower then that. You have to use a different hostname.

Closing because the linked PR resolves the error handling issue and Supervisor cannot change the rules on what is or isn't a valid hostname.