giuseppecastaldo / ha-addons

Home Assistant Whatsapp Add-on
Apache License 2.0
49 stars 18 forks source link

Service terminated #12

Closed shevaxsempre closed 1 year ago

shevaxsempre commented 1 year ago

Ciao Giuseppe, I often find the component broken, and not just rebuilding it, I have to uninstall and reinstall. I don't know if it happens when maybe Ha reboots or anything.

[11:25:07] INFO: Installed custom component. [2023-01-15T11:25:08.310] [INFO] default - Whatsapp Addon started. undefined:14694 }6121302@s.whatsapp.net": true, ^ SyntaxError: Unexpected number in JSON at position 517597 at JSON.parse () at useFileAuthState (/utils/useFileAuthState.js:34:43) at async WhatsappClient.connect (/whatsapp.js:51:38) Node.js v18.9.1 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 fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

ekkesa commented 1 year ago

I'm also still experiencing the add-on falling over and crashing. The watchdog service also dont restart it.

ekkesa commented 1 year ago

I receive an immediate crash on start-up:

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
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[13:21:29] INFO: Installed custom component.
[2023-01-16T13:21:32.008] [INFO] default - Whatsapp Addon started.
undefined:43896
}AJJy4WPumKzFhculPjUsPZPAu+0yYsEOnGxIR"
 ^
SyntaxError: Unexpected token A in JSON at position 1542675
    at JSON.parse (<anonymous>)
    at useFileAuthState (/utils/useFileAuthState.js:34:43)
    at async WhatsappClient.connect (/whatsapp.js:51:38)
Node.js v18.9.1
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 fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
shevaxsempre commented 1 year ago

exactly, even me the watchdog does not make it restart, even today the same error: at useFileAuthState (/utils/useFileAuthState.js:34:43)

swinster commented 1 year ago

Was this ever working for you? Do you recently update the add-in?

I am just surmising here as I can across a similar issue when trying to create a standalone container to be used with HA docker (so no add-in functionality). I am still determining what happened with this project, but after an update to this repo, rebuilding the image caused the container to fail to start similarly. I had to remove the persistent data folder (mapped to /data within the container) and rebuild. Therefore I had to re-add the WhatsApp client login. I don't know what would you do with the add-in, but I guess you would remove and re-install it?

swinster commented 1 year ago

@shevaxsempre and @ekkesa - please provide feedback if my comment has not resolved your issue.

ekkesa commented 1 year ago

Hi, Everything seems to be running more stable now - Thank you for all the effort, I will report if I see any strange behaviour.