neilenns / node-deepstackai-trigger

Detects motion using Deepstack AI and calls registered triggers based on trigger rules.
MIT License
167 stars 28 forks source link

Help with configuration on unRAID #163

Closed neilenns closed 4 years ago

neilenns commented 4 years ago

Hi I am trying to install this on an unRAID template and used the documentation to setup the /config and environment variables. However, I cannot start the docker, and the log has the following:

2020-06-10T10:39:49-07:00 [Main] Starting up version 1.7.0

2020-06-10T10:39:49-07:00 [Main] Timezone offset is 420
2020-06-10T10:39:49-07:00 [Main] Current time is Wed Jun 10 2020 10:39:49 GMT-0700 (Pacific Daylight Time)
2020-06-10T10:39:49-07:00 [Trigger Manager] Unable to read the configuration file: ENOENT: no such file or directory, open '/run/secrets/triggers'.
2020-06-10T10:39:49-07:00 [Trigger Manager] Unable to read the configuration file: ENOENT: no such file or directory, open '/config/triggers.json'.
2020-06-10T10:39:49-07:00 [Trigger Manager] Unable to find a trigger configuration file. Verify the trigger secret points to a file called triggers.json or that the /config mount point contains a file called triggers.json.
2020-06-10T10:39:49-07:00 [MQTT Manager] Unable to read the configuration file: ENOENT: no such file or directory, open '/run/secrets/mqtt'.
2020-06-10T10:39:49-07:00 [MQTT Manager] Unable to read the configuration file: ENOENT: no such file or directory, open '/config/mqtt.json'.
2020-06-10T10:39:49-07:00 [MQTT Manager] Unable to find an MQTT configuration file. If MQTT was disabled in the Docker configuration then this warning can be safely ignored. Otherwise it means something is wrong with how the container is configured. Verify the mqtt secret points to a file called mqtt.json or that the /config mount point contains a file called mqtt.json.

2020-06-10T10:39:49-07:00 [Telegram Manager] Unable to read the Telegram configuration file: ENOENT: no such file or directory, open '/run/secrets/telegram'.
2020-06-10T10:39:49-07:00 [Telegram Manager] Unable to read the Telegram configuration file: ENOENT: no such file or directory, open '/config/telegram.json'.
2020-06-10T10:39:49-07:00 [Telegram Manager] Unable to find an Telegram configuration file. If Telegram was disabled in the Docker configuration then this warning can be safely ignored. Otherwise it means something is wrong with how the container is configured. Verify the telegram secret points to a file called telegram.json or that the /config mount point contains a file called telegram.json.

2020-06-10T10:39:49-07:00 [Main] Cannot read property 'map' of undefined

I tried downloading the sample configuration files and put it into my /config mapping which did not work. I also tried to create the folder "secrets" and put those files in there, and it still did not work. Not sure how to proceed from here. Hope you can shed some lights for me. Below is a screenshot of the container setups. deepstackai-trigger

Originally posted by @soldius in https://github.com/danecreekphotography/node-deepstackai-trigger/issues/161#issuecomment-642163317

neilenns commented 4 years ago

Unfortunately I don't have access to unRAID but you are on the right path. Those errors mean the mounts didn't work, either because they mounted to the right place or the files weren't there.

When I was messing with Portainer I found it was tough to figure out the actual path to put for the local folder. Are you positive those paths are correct for telling unRAID where the things are on the local machine?

From the screenshot it seems like the paths might be configured as environment variables, not volume mount points. Or does unRAID shoe both in the same view? They need to be volumes/mounts, not environment variables.

soldius commented 4 years ago

You are correct with UnRAID. The view shows both variables and mount path the same way. I'm pretty sure that it is pointing to the correct path in my Unraid, as it actually created the directory 'node-deepstackai-trigger' when i created the docker. Attached is some of the screenshots of the setup pathConfig variableConfig

neilenns commented 4 years ago

Ok, thanks for the additional screenshots. That does look right and good to hear it created the directory locally.

Next thing to try is to triple check that triggers.json exists at /mnt/user/appdata/node-deepstack-ai-trigger/triggers.json, then try restarting the container.

This is also making me realize I shouldn't kill the app when the app configs can't be found. If the app just sat there doing nothing you'd be able to open a terminal to the Docker container and actually check and see if the file is there. I'll open a new issue for that.

soldius commented 4 years ago

Hi Thanks for the quick reply. I did make sure the files are in there. I even tried to create what the log says with "/run/secrets/" but neither method works :(. Did i have to edit anything special inside those json? Thank you. files

neilenns commented 4 years ago

To just get up and running you don't have to edit any of the json files. They won't process the way you likely want for your setup, but at least you should see it boot without complaints of missing config files.

You can ignore the "secrets" stuff, that won't work with UnRAID. As far as I can tell they don't support secrets files.

I should have a build in about 30 minutes that will stay running after the failure. You'll be able to open a terminal to the container after startup and type ls /config to see if the files are actually there.

soldius commented 4 years ago

Oh very nice. Thank you!

neilenns commented 4 years ago

Ok it's ready. You'll need to point to a different docker image tag: danecreekphotography/node-deepstackai-trigger:dev. That'll pull down the new image. Then run it and the logs should show the same failure but the container will still running. Then access a terminal to the container (dunno how Unraid does that but there must be a way) and then do ls /config to see if it shows up.

soldius commented 4 years ago

Ok. I just pulled the new image and tried it. using ls /config i got:

~/app $ ls /config
ls: /config: No such file or directory

Using just ls i got:

~/app $ ls
LICENSE    README.md  bundle.js

Not sure if /config exists or the mapping is broken somehow xD

neilenns commented 4 years ago

Yup, that means the mount didn't work, which is what I suspected.

Unfortunately this is going to be something with how unRAID mounts volumes. At some point I'll have to try getting unraid working on a machine here so I can try doing this. Until then all I can suggest is keep poking around or try asking in the unraid forums as to why the mount might not be showing up properly.

neilenns commented 4 years ago

Old issue not specific to the app, closing.