mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
81 stars 63 forks source link

Update fails for 0.5.1 with failed command (non-zero code) #73

Closed muellermartin closed 2 months ago

muellermartin commented 3 months ago

I don't know whether this repository is the right for Hass.io Access Point, as Home Assistant shows 0.5.1 as the current version but there are no matching releases or tags in this repository. But otherwise this seems to match, therefore I'll submit this issue here.

When I try to upgrade Hass.io Access Point from 0.4.8 to 0.5.1 I get the following error: Error updating Hass.io Access Point: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4

The complete system log shows following stack trace:

Click to expand ``` Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:239 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 10:39:45 AM (3 occurrences) Last logged: 10:44:35 AM [140357330160960] Error updating Hass.io Access Point: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/hassio/update.py", line 167, in async_install await async_update_addon(self.hass, slug=self._addon_slug, backup=backup) File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 58, in _wrapper data = await funct(*argv, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 135, in async_update_addon return await hassio.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 592, in send_command raise HassioAPIError(error.get(ATTR_MESSAGE)) homeassistant.components.hassio.handler.HassioAPIError: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 161, in async_install await entity.async_install_with_progress(version, backup) File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 465, in async_install_with_progress await self.async_install(version, backup) File "/usr/src/homeassistant/homeassistant/components/hassio/update.py", line 169, in async_install raise HomeAssistantError(f"Error updating {self.title}: {err}") from err homeassistant.exceptions.HomeAssistantError: Error updating Hass.io Access Point: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 ```

System details:

Core 2024.3.3
Supervisor 2024.03.1
Operating System 12.1
Frontend 20240307.0
ROBOT0-VT commented 2 months ago

Thank you for raising this, I'll investigate now

ROBOT0-VT commented 2 months ago

@muellermartin Hi, this should have been fixed in 0.5.2, please verify

muellermartin commented 2 months ago

@ROBOT0-VT Thanks for the quick reaction!

Unfortunately, the issue seems to persist in 0.5.2 with a very similar error (only some code line numbers changed):

Click to expand ``` Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:239 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 3:55:16 PM (1 occurrences) Last logged: 3:55:16 PM [140229125004480] Error updating Hass.io Access Point: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/hassio/update.py", line 168, in async_install await async_update_addon(self.hass, slug=self._addon_slug, backup=backup) File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 59, in _wrapper data = await funct(*argv, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 136, in async_update_addon return await hassio.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hassio/handler.py", line 593, in send_command raise HassioAPIError(error.get(ATTR_MESSAGE)) homeassistant.components.hassio.handler.HassioAPIError: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 162, in async_install await entity.async_install_with_progress(version, backup) File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 466, in async_install_with_progress await self.async_install(version, backup) File "/usr/src/homeassistant/homeassistant/components/hassio/update.py", line 170, in async_install raise HomeAssistantError(f"Error updating {self.title}: {err}") from err homeassistant.exceptions.HomeAssistantError: Error updating Hass.io Access Point: The command '/bin/bash -o pipefail -c apk update && apk add --no-cache bash iw hostapd networkmanager networkmanager-cli net-tools sudo dnsmasq iptables && rm -rf /var/cache/apk/*' returned a non-zero code: 4 ```
ROBOT0-VT commented 2 months ago

Alrighty, I've fixed this properly, and tested on a fresh addon instance from this repo, rather than my local copy.

Sorry for the super dumb bug🙏 and thank you for your good issue!