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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle additional bluetooth start exceptions #76096
Conversation
Improves the error reporting so the user has a better chance of fixing out what is wrong The following exceptions are now handled ``` 2022-08-02 09:23:42.854 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Bluetooth for bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 324, in async_init reply = await self._bus.call( File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call await future File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 365, in _message_reader if self._unmarshaller.unmarshall(): File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 289, in unmarshall self._unmarshall() File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 242, in _unmarshall raise InvalidMessageError("Expecting endianness as the first byte") dbus_next.errors.InvalidMessageError: Expecting endianness as the first byte ``` ``` 2022-08-02 09:29:00.722 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Bluetooth for bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 290, in async_init await self._bus.connect() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 149, in connect await self._authenticate() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 380, in _authenticate await self._loop.sock_sendall(self._sock, b0) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 441, in sock_sendall n = sock.send(data) BrokenPipeError: [Errno 32] Broken pipe ```
Improves the error reporting so the user has a better chance of fixing out what is wrong The following exceptions are now handled ``` 2022-08-02 09:23:42.854 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Bluetooth for bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 324, in async_init reply = await self._bus.call( File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call await future File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 365, in _message_reader if self._unmarshaller.unmarshall(): File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 289, in unmarshall self._unmarshall() File "/usr/local/lib/python3.10/site-packages/dbus_next/_private/unmarshaller.py", line 242, in _unmarshall raise InvalidMessageError("Expecting endianness as the first byte") dbus_next.errors.InvalidMessageError: Expecting endianness as the first byte ``` ``` 2022-08-02 09:29:00.722 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Bluetooth for bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 290, in async_init await self._bus.connect() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 149, in connect await self._authenticate() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 380, in _authenticate await self._loop.sock_sendall(self._sock, b0) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 441, in sock_sendall n = sock.send(data) BrokenPipeError: [Errno 32] Broken pipe ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, these errors look really helpful 馃憤
Shouldn't some of these raise repairable issues instead? |
I think that would be a nice improvement for the next PR. I wanted to address the most common issues for release rollout and since I've got a whole lot of reports to triage I won't be able to get that in until later |
Proposed change
Improves the error reporting so the user has a better chance
of fixing out what is wrong
There are a few upstream PRs that will help as well but they likely won't be out the door in time for release
hbldh/bleak#919
hbldh/bleak#918
hbldh/bleak#920
The following exceptions are now handled
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: