mdegat01 / addon-amr2mqtt

HA Addon which runs rtlamr to read IDM power meter data and send to MQTT broker
MIT License
33 stars 15 forks source link

PermissionError when trying to start addon #109

Closed brotherjansen closed 5 months ago

brotherjansen commented 8 months ago

Restored home assistant from full backup (moved from Raspberry Pi 3 to Raspberry Pi 4). AMR2MQTT fails with the error below. I have tried restarting home assistant multiple times and the addon multiple times.

Traceback (most recent call last):
  File "/amr2mqtt/amr2mqtt.py", line 18, in <module>
    import settings
  File "/amr2mqtt/settings.py", line 19, in <module>
    with open("/data/options.json", encoding="utf-8") as config_options:
PermissionError: [Errno 13] Permission denied: '/data/options.json'

Full log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

-----------------------------------------------------------
 Add-on: AMR2MQTT
 AMR2MQTT for Home Assistant
-----------------------------------------------------------
 Add-on version: 2.1.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.4  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.1.6
 Home Assistant Supervisor: 2023.12.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/02-set-timezone.sh
[17:29:56] INFO: Configuring timezone
cont-init: info: /etc/cont-init.d/02-set-timezone.sh exited 0
cont-init: info: running /etc/cont-init.d/30-config.sh
[17:29:58] INFO: Ensure MQTT broker is reachable at core-mosquitto:1883 (60s timeout)
cont-init: info: /etc/cont-init.d/30-config.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun amr2mqtt (no readiness notification)
services-up: info: copying legacy longrun rtl_tcp (no readiness notification)
s6-rc: info: service legacy-services successfully started
[17:29:58] INFO: Starting rtl_tcp daemon...
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Tuned to 100000000 Hz.
[17:30:00] INFO: Log level set to INFO
[17:30:00] INFO: Waiting for rtl_tcp...
Allocating 15 zero-copy buffers
[17:30:00] INFO: Handing over control to AMR2MQTT...
Signal caught, exiting!
Signal caught, exiting!
Traceback (most recent call last):
  File "/amr2mqtt/amr2mqtt.py", line 18, in <module>
    import settings
  File "/amr2mqtt/settings.py", line 19, in <module>
    with open("/data/options.json", encoding="utf-8") as config_options:
PermissionError: [Errno 13] Permission denied: '/data/options.json'
[17:30:01] WARNING: Halt add-on with exit code 1
s6-rc: info: service legacy-services: stopping
[17:30:01] INFO: Service restart after closing
[17:30:01] INFO: Service restart after closing
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 fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Signal caught, exiting!

Add-on version: 2.1.2 System: Home Assistant OS 11.4 (aarch64 / raspberrypi4-64) Home Assistant Core: 2024.1.6 Home Assistant Supervisor: 2023.12.1

Appears to be the same issue as #104

github-actions[bot] commented 7 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

roobster13 commented 6 months ago

I feel as though I too am having this issue but I am a new user and trying to install this for the first time, my log looks identical though

roobster13 commented 6 months ago

Logs after new install:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting cont-init: info: running /etc/cont-init.d/00-banner.sh


Add-on: AMR2MQTT AMR2MQTT for Home Assistant

Add-on version: 2.1.2 You are running the latest version of this add-on. System: Home Assistant OS 12.1 (aarch64 / raspberrypi4-64) Home Assistant Core: 2024.3.0 Home Assistant Supervisor: 2024.03.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0 cont-init: info: running /etc/cont-init.d/01-log-level.sh cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0 cont-init: info: running /etc/cont-init.d/02-set-timezone.sh [22:07:19] INFO: Configuring timezone cont-init: info: /etc/cont-init.d/02-set-timezone.sh exited 0 cont-init: info: running /etc/cont-init.d/30-config.sh [22:07:21] INFO: Ensure MQTT broker is reachable at 127.0.0.1:1883 (60s timeout) cont-init: info: /etc/cont-init.d/30-config.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun amr2mqtt (no readiness notification) services-up: info: copying legacy longrun rtl_tcp (no readiness notification) s6-rc: info: service legacy-services successfully started [22:08:21] INFO: Starting rtl_tcp daemon... Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner [R82XX] PLL not locked! Tuned to 100000000 Hz. [22:08:23] INFO: Log level set to INFO [22:08:23] INFO: Waiting for rtl_tcp... Allocating 15 zero-copy buffers [22:08:23] INFO: Handing over control to AMR2MQTT... Signal caught, exiting! Signal caught, exiting! INFO:root:Starting rtlamr INFO:root:Connecting to MQTT broker at 127.0.0.1:1883 Traceback (most recent call last): File "/amr2mqtt/amr2mqtt.py", line 515, in mqttc = create_mqtt_client() File "/amr2mqtt/amr2mqtt.py", line 182, in create_mqtt_client client.connect( File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 941, in connect return self.reconnect() File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1075, in reconnect sock = self._create_socket_connection() File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 3546, in _create_socket_connection return socket.create_connection(addr, source_address=source, timeout=self._keepalive) File "/usr/lib/python3.9/socket.py", line 843, in create_connection raise err File "/usr/lib/python3.9/socket.py", line 831, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused [22:08:23] WARNING: Halt add-on with exit code 1 s6-rc: info: service legacy-services: stopping [22:08:23] INFO: Service restart after closing [22:08:23] INFO: Service restart after closing s6-svwait: fatal: supervisor died 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 fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped Signal caught, exiting! Allocating 15 zero-copy buffers Signal caught, exiting! Signal caught, exiting!

github-actions[bot] commented 5 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!