Skons / hassio-addons

7 stars 4 forks source link

Installation fail on HA Home Assistant 2023.7.1 and Debian 12 Bookworm #50

Closed BebeMischa closed 1 year ago

BebeMischa commented 1 year ago

As HA is now compatible with Bookworm, i did the upgrade. (HA supervised, Debian, intel machine, al latest versions)

After that The DGP addon stopped working. I got several errors. Unfortunately I did not save them.

I did choose to remove the addon, restart system and install the addon again.

Now it fails to install.

The error I get now:

The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies=20230531.221623 tesseract-ocr=5.3.1-r1 tesseract-ocr-dev=5.3.1-r1 jpeg-dev=9e-r1 libjpeg=9e-r1 zlib-dev=1.2.13-r1 gcc=12.2.1_git20220924-r10 libc-dev=0.7.2-r5' returned a non-zero code: 3

So it looks, like the addon needs to be updated for compatibility with Debian 12.

As usual, I'm standby to provide support by testing stuff and so.

Thank you very much in advance, dear @Skons , we did solve things before, we can fight this one too ;-)

Skons commented 1 year ago

At this moment i do not have a debian instance running. All i can do is update everything to the latest version to see if that will solve your problem

BebeMischa commented 1 year ago

So, would you, please?

Skons commented 1 year ago

Just released an update, can you verify if that update solves your problem?

BebeMischa commented 1 year ago

Thanks for all the work ;-)

Now the addon does install, bus it starts and then stops in some seconds.

this is, what Supervisor has to say about it:

23-08-08 00:11:51 INFO (SyncWorker_3) [supervisor.docker.addon] Starting Docker add-on f5a8083e/amd64-addon-dutch_gas_prices with version 2023.8.7.1
23-08-08 00:12:01 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-3628' coro=<Addon.watchdog_container() done, defined at /usr/src/supervisor/supervisor/addons/addon.py:1042> exception=AddonsJobError('Rate limit exceeded, more then 10 calls in 0:30:00')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 1056, in watchdog_container
    await self._restart_after_problem(self, event.state)
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 144, in wrapper
    raise on_condition(
supervisor.exceptions.AddonsJobError: Rate limit exceeded, more then 10 calls in 0:30:00
BebeMischa commented 1 year ago

And here is the addon log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
curl: (7) Failed to connect to supervisor port 80 after 1 ms: Couldn't connect to server
[00:11:51] ERROR: Something went wrong contacting the API
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
curl: (7) Failed to connect to supervisor port 80 after 1 ms: Couldn't connect to server
[00:11:51] ERROR: Something went wrong contacting the API
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
curl: (7) Failed to connect to supervisor port 80 after 0 ms: Couldn't connect to server
[00:11:52] ERROR: Something went wrong contacting the API
[00:11:52] INFO: Log_level: null
[00:11:52] INFO: mqtt_host: 
[00:11:52] INFO: mqtt_port: 
[00:11:52] INFO: Starting dutch gas prices...
[2023-08-08 00:11:56] DEBUG   : gas_station: Cachepath is '/app/cache/'
Traceback (most recent call last):
  File "/app/main.py", line 25, in <module>
    start(str(sys.argv[1]),str(sys.argv[2]),str(sys.argv[3]))
                               ~~~~~~~~^^^
IndexError: list index out of range
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Skons commented 1 year ago

Your problem lies in the addon not being able to contact the supervisor. Did you install the supervisor? Have you installed DGP as HA addon or as docker container?

curl: (7) Failed to connect to supervisor port 80 after 1 ms: Couldn't connect to server
[00:11:51] ERROR: Something went wrong contacting the API
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
curl: (7) Failed to connect to supervisor port 80 after 1 ms: Couldn't connect to server
BebeMischa commented 1 year ago

DGP is installed as a HA addon. Like it always has been. Supervisor is installed and running. I have a healthy and supported HA install. All other addons and integration are running fine. DGP is the only thing, that appears in the supervisor log with errors.

The only thing, that changed, was the Debian OS upgrade from Bullseye to Bookworm.

That was done with dist-upgrade and nothing else changed on the system.

Skons commented 1 year ago

In this topic the same problem is discussed: https://github.com/home-assistant/supervisor/issues/4396

See comment https://github.com/home-assistant/supervisor/issues/4396#issuecomment-1642303441

I don't want to release a fix just to test it, so can you run tests for me? I will provide you with a manual how to place the addon as a local addon with the potential fix. If you are interested, then i will provide you with a manual the coming days (depending on when i have time)

BebeMischa commented 1 year ago

Sure, no problem... ;-)

So actually it's all about this?

apparmor.txt

# Capabilities
  capability,
  file,
  signal (send) set=(kill,term,int,hup,cont),
  network,
Skons commented 1 year ago

I hope it is all about that ;)

Download the repository as zip file with this link. Copy the folder dutch_gas_prices to your home assistant. If you have the Samba Share add-on installed, use this path: \\homeassistant.local\addons\dutch_gas_prices (replace homeassistant.local if needed)

Make sure the folder structure looks like this image

Edit the apparmor.txt and add network to capabilities, it looks quite similar to what you posted.

Then go to you home assistant instance, Settings -> Add-ons -> Add-on store and then you should see Dutch Gas Prices on top as Local add-ons. Click it, click install. Follow the procedure on how to configure the add-on, or copy the configuration from your existing Dutch Gas Prices add-on and try to start it. Let me know if it works or what your log is stating.

BebeMischa commented 1 year ago
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Dutch gas prices
 Get gas prices from dutch gas stations
-----------------------------------------------------------
 Add-on version: 2023.8.7.1
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 12 (bookworm)  (amd64 / qemux86-64)
 Home Assistant Core: 2023.8.1
 Home Assistant Supervisor: 2023.08.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to INFO
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[21:27:37] INFO: Log_level: info
[21:27:37] INFO: mqtt_host: 192.168.188.57
[21:27:37] INFO: mqtt_port: 1883
[21:27:37] INFO: Starting dutch gas prices...
[2023-08-10 21:27:40] INFO    : DGP initialized, launching client
[2023-08-10 21:27:40] INFO    : Connecting mqtt
[2023-08-10 21:27:40] INFO    : Connected with result code 0
[2023-08-10 21:28:12] INFO    : Received payload '{"fuel_type":"euro98","radius":5,"latitude":52.xxxxxxx,"longitude":4.xxxxxxx,"friendly_name_template":"[brand] ([station_street])", "to_publish":10}' on topic 'dgp/gas_stations'

Looks better :-)

Skons commented 1 year ago

Nice! Thanks for your help. Just released 2023.8.11.1 which should fix your issue. You can uninstall the local addon and remove the files. After that, run the update on the DGP from my repo.

BebeMischa commented 1 year ago

Solved ;-) So, where can i buy you a beer?