sdesalve / hassio-addons

MIT License
85 stars 21 forks source link

Cannot install ARM addon #89

Closed jarlesb closed 7 months ago

jarlesb commented 7 months ago

Hi,

I am still struggeling to install the ARM version.

I am running:

Whan trying to install the application I get the following error in the log

ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /addons/89275b70_dss_voipARM/install - '89275b70_dss_voipARM'

I have also tried to copy the content locally but no change: ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /addons/local_dss_voipARM/install - 'local_dss_voipARM'

I have fiber connection and are running AdGuard. All other addons can be installed... Also the non-ARM addon "DSS VoIP Notifier" can be install, but does not work.

sdesalve commented 7 months ago

please go to

https://[HASSIO URL]/config/logs

and post your supervisor log or any other logs that can be related to addon install

image

jarlesb commented 7 months ago

I get this error: 23-11-27 23:19:21 WARNING (MainThread) [supervisor.addons.options] Option 'interface' does not exist in the schema for Samba share (core_samba)

jarlesb commented 7 months ago

Here is the full log 23-11-27 23:19:21 WARNING (MainThread) [supervisor.addons.options] Option 'interface' does not exist in the schema for Samba share (coresamba) 23-11-27 23:19:42 CRITICAL (MainThread) [supervisor.utils.common] Can't parse data: does not match regular expression ^([a-z0-9][a-z0-9.-](:[0-9]+)?/)?([a-z0-9{][a-z0-9.-{}]/)?([a-z0-9{][a-z0-9.-_{}])$ for dictionary value @ data['user']['89275b70_dss_voipARM']['image']. Got '89275b70/aarch64-addon-dss_voipARM' 23-11-27 23:19:42 WARNING (MainThread) [supervisor.utils.common] Resetting /data/addons.json to last version 23-11-27 23:19:42 ERROR (MainThread) [supervisor.jobs] Unhandled exception: '89275b70_dss_voipARM' Traceback (most recent call last): File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 289, in wrapper return await self._method(obj, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/addons/addon.py", line 613, in install await self.load() File "/usr/src/supervisor/supervisor/addons/addon.py", line 188, in load await self.instance.attach(version=self.version) ^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/addons/addon.py", line 233, in version return self.persist[ATTR_VERSION] ^^^^^^^^^^^^ File "/usr/src/supervisor/supervisor/addons/addon.py", line 213, in persist return self.sys_addons.data.user[self.slug]


KeyError: '89275b70_dss_voipARM'
sdesalve commented 7 months ago

Rename folder /addons/89275b70_dss_voipARM and replace all strings in all files to use lowercase

Seems than cannot install this addon for capital letters

jarlesb commented 7 months ago

Now gets on step ahead, but stil fails:

image

`23-11-28 11:18:32 INFO (MainThread) [supervisor.addons.addon] Creating Home Assistant add-on data folder /data/addons/data/local_dss_voiparm 23-11-28 11:18:32 INFO (MainThread) [supervisor.docker.addon] Starting build for local/aarch64-addon-dss_voiparm:4.0.0 23-11-28 11:18:36 ERROR (MainThread) [supervisor.docker.addon] Can't build local/aarch64-addon-dss_voiparm:4.0.0: The command '/bin/ash -o pipefail -c apk add --no-cache coreutils=9.0-r2 wget=1.21.2-r2 sox pjsua screen bc' returned a non-zero code: 2 23-11-28 11:18:36 ERROR (MainThread) [supervisor.docker.addon] Build log: Step 1/17 : ARG BUILD_FROM=hassioaddons/base:8.0.3

Step 2/17 : FROM ${BUILD_FROM}

---> e513b08f8658

Step 3/17 : ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 S6_CMD_WAIT_FOR_SERVICES=1 TERM="xterm-256color"

---> Running in 4c464e7adf69

Removing intermediate container 4c464e7adf69

---> 7a526a73a3fa

Step 4/17 : ENV LANG C.UTF-8

---> Running in 161474788ec3

Removing intermediate container 161474788ec3

---> 817bc263d9a0

Step 5/17 : COPY rootfs /

---> 0a5dbe997310

Step 6/17 : RUN apk add --no-cache coreutils=9.0-r2 wget=1.21.2-r2 sox pjsua screen bc

---> Running in 2b632a811cf4

fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz

WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz: UNTRUSTED signature

fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/aarch64/APKINDEX.tar.gz

WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz: UNTRUSTED signature

WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/testing/aarch64/APKINDEX.tar.gz: UNTRUSTED signature

ERROR: unsatisfiable constraints:

coreutils-8.32-r0: breaks: world[coreutils=9.0-r2] wget-1.20.3-r1: breaks: world[wget=1.21.2-r2]

Removing intermediate container 2b632a811cf4`

sdesalve commented 7 months ago

On Dockerfile

remove from this line the versions

/bin/ash -o pipefail -c apk add --no-cache coreutils=9.0-r2 wget=1.21.2-r2 sox

Leave coreutils wget sox

jarlesb commented 7 months ago

Thanks!

Without the version entries, it installs. But I have not been able to make a voip call yet... Will test a bit more...

jarlesb commented 7 months ago

It seems that addon crashes when it is running with the following error in the dss_voiparm log:

parse error: Expected string key before ':' at line 1, column 4 [19:32:22] ERROR: Unknown HTTP error occured

image

sdesalve commented 7 months ago

please post addon configuration

check that double quotes is this character " check tts configuration check --no-tcp is 2 minus sign --

jarlesb commented 7 months ago

Thanks again!

Here is addon config: sip_parameters: caller_id_uri: sip:xxxx@sip.freevoipdeal.com realm: "*" username: xxxx password: xxxxxxxx pjsua_custom_options: "--no-tcp"

And developer service test yaml: service: hassio.addon_stdin data: addon: local_dss_voiparm input: {"call_sip_uri":"sip:+47XXXXXXXXX@sip.freevoipdeal.com","message_tts":"Test"}

sdesalve commented 7 months ago

TTS config?

jarlesb commented 7 months ago

I have the following in configuration.yaml:

# Text to speech tts: - platform: google_translate service_name: google_translate_say language: "no"'

sdesalve commented 7 months ago

hope is that

# Text to speech 
tts:
 - platform: google_translate
   service_name: google_translate_say
   language: "no"
jarlesb commented 7 months ago

hope is that

# Text to speech 
tts:
 - platform: google_translate
   service_name: google_translate_say
   language: "no"

Yes, just bad code marking from my side. The code you just posted is the one I have in configuration.yaml

sdesalve commented 7 months ago
    - service: hassio.addon_stdin
      data_template:
        addon: local_dss_voiparm 
        input: {"call_sip_uri":"sip:+xxxxxxxx@sip.freevoipdeal.com","audio_file_url":"https://download.samplelib.com/mp3/sample-3s.mp3"}

try this addon invocation

jarlesb commented 7 months ago
    - service: hassio.addon_stdin
      data_template:
        addon: local_dss_voiparm 
        input: {"call_sip_uri":"sip:+xxxxxxxx@sip.freevoipdeal.com","audio_file_url":"https://download.samplelib.com/mp3/sample-3s.mp3"}

try this addon invocation

Great, thanks a lot! That worked, hence the add-on is working! Just need to fix my tts setup.

Btw, used data instead of data_template as that one is deprecated

jarlesb commented 7 months ago

Will you try to fix the installation via add onstore? :)

jarlesb commented 7 months ago

I cannot seem to get message_tts option to work.

If I test this, then all works well with test:

service: tts.google_translate_say
data:
  entity_id: all
  message: "Test."
sdesalve commented 7 months ago

addon cannot get MP3 file from hassio TTS cache folder...

adapt this:

# Text to speech
tts:
  - platform: google_translate
    service_name: google_translate_say
    language: 'it'
    cache: true
    cache_dir: /config/www/tts
    time_memory: 300
    base_url: !secret http_base_url

(base URL should have been deprecated... remove it if you get an error)

or check

homeassistant:
  external_url: !secret http_base_url
jarlesb commented 7 months ago

Ok, I'll try that.

Here is the error I got, when I was trying the tts.piper plattform option.

´´´´ 2023-11-29 22:45:58.784 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x16\x03\x01\x01\x94\x01'\n ^" ´´´´

sdesalve commented 7 months ago

paste more text from log about this error...

sdesalve commented 7 months ago

Will you try to fix the installation via add onstore? :)

try to install now!

jarlesb commented 7 months ago

Will you try to fix the installation via add onstore? :)

try to install now!

Works perfect, thanks!

jarlesb commented 7 months ago

paste more text from log about this error...

Works very well with the MP3 file and log says:

2023-11-29 23:06:48.800 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-11-29 23:06:48.800 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service

And add_on log gives all info on successful call.

If I try with message_tts Add_on crashes and restart, hence I do not see anything in log.

In supervisor log I see

2023-11-29 23:12:31.103 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-11-29 23:12:31.103 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-11-29 23:12:31.962 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Bad status line "Invalid method encountered:\n\n  b'\\x16\\x03\\x01\\x01x\\x01'\n    ^"

Will have to stop now, but will continue with debugging tomorrow :)

sdesalve commented 7 months ago

paste more text from log about this error...

Works very well with the MP3 file and log says:

2023-11-29 23:06:48.800 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-11-29 23:06:48.800 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service

And add_on log gives all info on successful call.

If I try with message_tts Add_on crashes and restart, hence I do not see anything in log.

In supervisor log I see

2023-11-29 23:12:31.103 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-11-29 23:12:31.103 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-11-29 23:12:31.962 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Bad status line "Invalid method encountered:\n\n  b'\\x16\\x03\\x01\\x01x\\x01'\n    ^"

Will have to stop now, but will continue with debugging tomorrow :)

disable watchdog...

open all logs files (also /share/dss_voiparm folder) and check what line of RUN files is crashing

jarlesb commented 7 months ago

Hi again Salvatore, and thanks for all the support yesterday. Please find my logs given below:

home-assistant.log

2023-11-30 22:21:36.124 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-11-30 22:21:36.125 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-11-30 22:21:37.013 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Bad status line "Invalid method encountered:\n\n  b'\\x16\\x03\\x01\\x01x\\x01'\n    ^"

Addon log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Add-on: DSS VoIP Notifier for ARM
 VoIP Notifier for Home Assistant (for ARM processors)
-----------------------------------------------------------
 Add-on version: 4.1.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1  (aarch64 / odroid-n2)
 Home Assistant Core: 2023.11.3
 Home Assistant Supervisor: 2023.11.6
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Info] Starting addon...
PJSUA_CUSTOM_OPTIONS = '--no-tcp'
[Info] Listening for messages via stdin service call...
[Info] Received messages {"call_sip_uri":"sip:+xxxx@sip.freevoipdeal.com","message_tts":"Test"}
Converting audio file 'https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7abxxxxxxxx_no_-_google_translate.mp3'...
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

share/dss_voiparm Seems that only dss_sox shows an error

sox:      SoX v14.4.2
sox FAIL formats: can't open input file URL `https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7abxxxxxxxx_no_-_google_translate.mp3': 

I have 4 tts entities. New google tts with different languages, as well as the tts.piper.

Here is the error if I chose the tts.piper as platform:

sox:      SoX v14.4.2
sox FAIL formats: can't open input file URL `https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7ab7fb5d1fa_nl-be_a8xxxxxxxx_tts.piper.wav': WAVE: RIFF header not found

Any good advice?

sdesalve commented 7 months ago

sox: SoX v14.4.2 sox FAIL formats: can't open input file URL `https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7abxxxxxxxx_no_-_google_translate.mp3':

as suggested, SOX cannot reach TTS generated mp3...

can you ear TTS if you open that URL on your browser?

And 192.168.1.1 it's your subnet. Noboby can reach your device if you paste your private lan IP here 😂

Is your hassio exposed to internet? Have you setup your public domain name?

homeassistant:
  external_url: !secret http_base_url
jarlesb commented 7 months ago

sox: SoX v14.4.2 sox FAIL formats: can't open input file URL `https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7abxxxxxxxx_no_-_google_translate.mp3':

as suggested, SOX cannot reach TTS generated mp3...

can you ear TTS if you open that URL on your browser?

And 192.168.1.1 it's your subnet. Noboby can reach your device if you paste your private lan IP here 😂

Is your hassio exposed to internet? Have you setup your public domain name?

homeassistant:
  external_url: !secret http_base_url

If I swap the internal IP with the external dns name it works, and also when I replace https with http for the internal IP address. I have the external URL option, so not sure why it does not work... But will try to debug a little.

jarlesb commented 7 months ago

sox: SoX v14.4.2 sox FAIL formats: can't open input file URL `https://192.168.xx.xx:8123/api/tts_proxy/640ab2bae07bedc4c163f679a746f7abxxxxxxxx_no_-_google_translate.mp3':

as suggested, SOX cannot reach TTS generated mp3... can you ear TTS if you open that URL on your browser? And 192.168.1.1 it's your subnet. Noboby can reach your device if you paste your private lan IP here 😂 Is your hassio exposed to internet? Have you setup your public domain name?

homeassistant:
  external_url: !secret http_base_url

If I swap the internal IP with the external dns name it works, and also when I replace https with http for the internal IP address. I have the external URL option, so not sure why it does not work... But will try to debug a little.

I added the the following option in configuration.yaml without https, then it works:

homeassistant:
  internal_url: http://192.168.X.X:8123

Thanks a lot again for the help and a great addon :)