elad-bar / Hassio-addons

10 stars 16 forks source link

Uncaught Error: Class 'Mosquitto\Client' not found in /app/DahuaVTO.php:126 #7

Closed mayobuz closed 3 years ago

mayobuz commented 3 years ago

I get below error after installing ha addon. Anything I should install to solve it?


Add-on: DahuaVTO2MQTT Listens to events from Dahua VTO unit and publishes them via MQTT Message

Add-on version: 1.0.9 You are running the latest version of this add-on. parse error: Expected string key before ':' at line 1, column 4 [11:52:17] ERROR: Unknown HTTP error occured System: (armv7 / raspberrypi3) Home Assistant Core: 0.118.5 Home Assistant Supervisor: 2020.12.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. [11:52:21] INFO: @@@@@@@@@@@@@@@@ /usr/bin/curl [11:52:21] INFO: @@@@@@@@@@@@@@@@ [11:52:21] INFO: FFS [11:52:21] INFO: Staring Dahua to MQTT PHP Notice: Undefined offset: 1 in /app/DahuaVTO.php on line 49 PHP Notice: Undefined offset: 1 in /app/DahuaVTO.php on line 49 PHP Notice: Undefined offset: 1 in /app/DahuaVTO.php on line 49 PHP Fatal error: Uncaught Error: Class 'Mosquitto\Client' not found in /app/DahuaVTO.php:126 Stack trace:

0 /app/DahuaVTO.php(4): DahuaVTOEventListener->DahuaVTOEventListener()

1 {main}

thrown in /app/DahuaVTO.php on line 126 [cmd] /bin/ash exited 255 [cont-finish.d] executing container finish scripts... [cont-finish.d] 99-message.sh: executing...

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when starting or running this add-on.

Be sure to check the log above, line by line, for hints.

cibernox commented 3 years ago

Just came to mention I installed the addon today for the first time and I'm getting the same error.

cibernox commented 3 years ago

For the record, I downloaded this repo, built the docker image myself hardcoding my details, and pointing to the mosquitto broker of my home assistant installation on a raspberry PI and I was able to make it work, so I'm not sure why the docker image in addon when installed on the raspberry can't find the class Mosquitto\Client.

My best guess is that something goes wrong before that, which prevents the dependencies to be installed.

cibernox commented 3 years ago

For completeness sake, I reinstalled the addon and checked the logs, and installation seems to go as expected:

20-12-14 13:33:29 INFO (MainThread) [supervisor.addons] Creating Home Assistant add-on data folder /data/addons/data/26703e67_dahuavto2mqtt
20-12-14 13:33:29 INFO (SyncWorker_3) [supervisor.docker.addon] Starting build for 26703e67/armv7-addon-dahuavto2mqtt:1.0.9
20-12-14 13:34:00 INFO (SyncWorker_3) [supervisor.docker.addon] Build 26703e67/armv7-addon-dahuavto2mqtt:1.0.9 done
20-12-14 13:34:00 INFO (MainThread) [supervisor.addons] Add-on '26703e67_dahuavto2mqtt' successfully installed

The error message I get when starting is still the same. Just to eliminate possible sources of confusion, this time I've configured my credentials in plain text instead of pulling them from the secrets.yaml file.

cibernox commented 3 years ago

I am happy to help debugging this but I don't have a lot of experience with home assistant or docker for that matter. Any idea how I can track from where the parse error: Expected string key before ':' at line 1, column 4 is comming from, as it doesn't say on which file that is.

[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: DahuaVTO2MQTT
 Listens to events from Dahua VTO unit and publishes them via MQTT Message
-----------------------------------------------------------
 Add-on version: 1.0.9
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[21:02:02] ERROR: Unknown HTTP error occured
 System:   (armv7 / raspberrypi4)
 Home Assistant Core: 0.118.5
 Home Assistant Supervisor: 2020.12.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.
[21:02:04] INFO: @@@@@@@@@@@@@@@@
/usr/bin/curl
[21:02:04] INFO: @@@@@@@@@@@@@@@@
[21:02:04] INFO: FFS
[21:02:04] INFO: Staring Dahua to MQTT
2020-12-13 21:02:04 DEBUG   DahuaVTOAPI::SetDeviceDetails Device Type: VTO2202F
2020-12-13 21:02:04 DEBUG   DahuaVTOAPI::SetDeviceDetails Serial Number: <REDACTED> 
PHP Notice:  Undefined offset: 1 in /app/DahuaVTO.php on line 49
PHP Fatal error:  Uncaught Error: Class 'Mosquitto\Client' not found in /app/DahuaVTO.php:126
Stack trace:
#0 /app/DahuaVTO.php(4): DahuaVTOEventListener->DahuaVTOEventListener()
#1 {main}
  thrown in /app/DahuaVTO.php on line 126
[cmd] /bin/ash exited 255
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.

 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
elad-bar commented 3 years ago

Please update to the latest, should work now, Thanks