Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.
This repository was archived by the owner on May 27, 2025. It is now read-only.

Trouble validating settings and mqtt #456

Closed

Description

@mikerenna

Im trying to set this up and I'm struggling with the following error:
2022-08-05T12:43:59-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/run/secrets/secrets'.
2022-08-05T12:43:59-05:00 [Settings] Loaded settings from /run/secrets/settings

I don't see anything happening in mqtt allthough i have it enabled (would have expected connect messages in log or in mqtt). I'm ultimately trying to determine if the docker setup is correct. the above message makes me think the settings file did not load correctly but i can console to the /run/secrets/ folder referenced above and viewing the files there, they appear to be my settings and triggers files. Any thoughts on the error or why i might not see mqtt message of any kind related to startup or any status?

Thanks in advance
Mike

Activity

  1. neilenns commented on Aug 5, 2022

    @neilenns
    Owner
  2. mikerenna commented on Aug 5, 2022

    @mikerenna
    Author

    here you go. trying to pull them off of a local folder. this is running QNAP container station for docker: copy/pasted flattened the formatting.

    version: "3.8"
    services:
    trigger:
    volumes:
    - '/share/blue_iris/aiinput:/aiinput'
    environment:
    - TZ=America/Chicago
    ports:
    - 4242:4242
    secrets:
    - triggers
    - settings
    image: ghcr.io/neilenns/node-deepstackai-trigger:latest
    restart: always
    depends_on:
    - deepstack-ai

    deepstack-ai:
    image: deepquestai/deepstack:latest
    restart: always
    volumes:
    - localstorage:/datastore
    environment:
    - VISION-DETECTION=True

    volumes:
    localstorage:

    secrets:
    settings:
    # This should point to the location of the settings.json configuration file
    file: '/share/Container/deepstackai/settings.json'

    triggers:
    # This should point to the location of the triggers.json configuration file
    file: '/share/Container/deepstackai/triggers.json'

  3. mikerenna commented on Aug 5, 2022

    @mikerenna
    Author

    strange thing is that it appears that its picking up those files and creating them in the run/secrets/ location. if i view them through console they appear correct. so maybe its working but not sure how to tell. nothing in mqtt to indicate any connection. so i'm wondering if something is wrong.

  4. neilenns commented on Aug 5, 2022

    @neilenns
    Owner

    Are you sure the paths to those files exist on your local machine? These two lines should be the local path:

    file: '/share/Container/deepstackai/settings.json'
    file: '/share/Container/deepstackai/triggers.json'
    

    Also if they are shared to whatever machine is running Docker that might cause a problem? Not sure. In my case they are just local files in the same folder as my docker-compose.yml file.

  5. neilenns commented on Aug 5, 2022

    @neilenns
    Owner

    I looked at my config more closely and I don't think I'm even using the secrets, I just have a volume mounted. Try doing it that way instead:

    services:
      trigger:
        volumes:
          - /share/blue_iris/aiinput:/aiinput
          - /share/Container/deepstackai:/config
    
  6. mikerenna commented on Aug 5, 2022

    @mikerenna
    Author
  7. mikerenna commented on Aug 8, 2022

    @mikerenna
    Author

    unfortunately no difference. From this is seems like its at least picking up the settings file from where I put it. (i added a config subfolder on my share location). Is there more I should see here? Any way to tell if its running properly? I'm assuming that something is wrong because there are no entries at all in my MQTT host and i was expecting them from startup at least. No indication here in the log that its connected. no indication that triggers file was loaded either.

    2022-08-08T10:30:06-05:00 [Main] ****************************************
    2022-08-08T10:30:06-05:00 [Main] Starting up version 5.8.4
    2022-08-08T10:30:06-05:00 [Main] Timezone offset is 300
    2022-08-08T10:30:06-05:00 [Main] Current time is Mon Aug 08 2022 10:30:06 GMT-0500 (Central Daylight Time)
    2022-08-08T10:30:06-05:00 [Settings] Unable to read the settings file: ENOENT: no such file or directory, open '/run/secrets/settings'.
    2022-08-08T10:30:06-05:00 [Settings] Unable to load file /run/secrets/settings.
    2022-08-08T10:30:06-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/config/secrets.json'.

  8. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    as a follow-up, i modified the mqtt host as a test and immediately got an error in the log. So its clearly loading the settings file but no indication that it successfully connects to the mqtt server. is there a setting that forces it to publish a status message in mqtt that i'm missing? A way to confirm that the triggers file is being picked up? Testing triggers, there is no action in mqtt either which seems related. Thanks in advance for any ideas.

  9. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  10. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    Verbose was already set to true. Should i have been seeing more than the above in the log as a result? it seems like its loading the settings file (which i reason by the fact that when i change the mqtt host to a bad port, i see an error on restart) but if its not picking up the verbose flag, I couldn't explain that either. Sorry for the trouble. This seems like an exceptionally useful tool. I appreciate you taking your time to share ideas here. -Mike

  11. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  12. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    just checked that blue iris is dropping jpgs to the designated folder but no action in log. In fact, log is still just showing the three times I restarted it yesterday. (this is the log view from portainer for the trigger container. deepstack shows even less). You can see in the log where I changed the port on mqtt to see if i could force a failure.
    2022-08-08T10:30:06-05:00 [Main] ****************************************
    2022-08-08T10:30:06-05:00 [Main] Starting up version 5.8.4
    2022-08-08T10:30:06-05:00 [Main] Timezone offset is 300
    2022-08-08T10:30:06-05:00 [Main] Current time is Mon Aug 08 2022 10:30:06 GMT-0500 (Central Daylight Time)
    2022-08-08T10:30:06-05:00 [Settings] Unable to read the settings file: ENOENT: no such file or directory, open '/run/secrets/settings'.
    2022-08-08T10:30:06-05:00 [Settings] Unable to load file /run/secrets/settings.
    2022-08-08T10:30:06-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/config/secrets.json'.
    2022-08-08T10:30:06-05:00 [Settings] Loaded settings from /config/settings.json
    2022-08-08T16:35:16-05:00 [Main] Shutting down.
    2022-08-08T16:35:17-05:00 [Main] ****************************************
    2022-08-08T16:35:17-05:00 [Main] Starting up version 5.8.4
    2022-08-08T16:35:17-05:00 [Main] Timezone offset is 300
    2022-08-08T16:35:17-05:00 [Main] Current time is Mon Aug 08 2022 16:35:17 GMT-0500 (Central Daylight Time)
    2022-08-08T16:35:17-05:00 [Settings] Unable to read the settings file: ENOENT: no such file or directory, open '/run/secrets/settings'.
    2022-08-08T16:35:17-05:00 [Settings] Unable to load file /run/secrets/settings.
    2022-08-08T16:35:17-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/config/secrets.json'.
    2022-08-08T16:35:17-05:00 [Settings] Loaded settings from /config/settings.json
    2022-08-08T16:35:17-05:00 [Main] [MQTT] Unable to connect: connect ECONNREFUSED 192.168.0.14:1884
    2022-08-08T16:35:17-05:00 [Main] ****************************************
    2022-08-08T16:35:17-05:00 [Main] Startup failed due to errors. For troubleshooting assistance see https://github.com/danecreekphotography/node-deepstackai-trigger/wiki/Troubleshooting.
    2022-08-08T16:35:17-05:00 [Main] Startup reattempt 1 of 5 in 30 seconds.
    2022-08-08T16:35:47-05:00 [Main] ****************************************
    2022-08-08T16:35:47-05:00 [Main] Starting up version 5.8.4
    2022-08-08T16:35:47-05:00 [Main] Timezone offset is 300
    2022-08-08T16:35:47-05:00 [Main] Current time is Mon Aug 08 2022 16:35:47 GMT-0500 (Central Daylight Time)
    2022-08-08T16:35:47-05:00 [Settings] Unable to read the settings file: ENOENT: no such file or directory, open '/run/secrets/settings'.
    2022-08-08T16:35:47-05:00 [Settings] Unable to load file /run/secrets/settings.
    2022-08-08T16:35:47-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/config/secrets.json'.
    2022-08-08T16:35:47-05:00 [Settings] Loaded settings from /config/settings.json
    2022-08-08T16:36:19-05:00 [Main] Shutting down.
    2022-08-08T16:36:20-05:00 [Main] ****************************************
    2022-08-08T16:36:20-05:00 [Main] Starting up version 5.8.4
    2022-08-08T16:36:20-05:00 [Main] Timezone offset is 300
    2022-08-08T16:36:20-05:00 [Main] Current time is Mon Aug 08 2022 16:36:20 GMT-0500 (Central Daylight Time)
    2022-08-08T16:36:20-05:00 [Settings] Unable to read the settings file: ENOENT: no such file or directory, open '/run/secrets/settings'.
    2022-08-08T16:36:20-05:00 [Settings] Unable to load file /run/secrets/settings.
    2022-08-08T16:36:20-05:00 [Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/config/secrets.json'.
    2022-08-08T16:36:20-05:00 [Settings] Loaded settings from /config/settings.json

  13. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    i had removed all the secrets references and went to your suggestion for a volume mount for /config. That didn't appear to make a difference. I don't know why there are still secret references here unless that's all just in the code. When I added a /config subfolder to my mount it changed the last line in the log, which i would have expected. that much seems ok.

  14. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  15. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    i don't know. I've tried a myriad of things to troubleshoot the picture folder. The sample config files use a relative path in the mask ("/aiinput/Cat*.jpg). What is that relative of? My aiinput folder is almost identical to your example. settings file appears to be being picked up properly from a similar mount (similar to your example, with just an additional /config subfolder on the share). i've tried with the relative path in triggers and without. I tried moving my picture folder round. I'm not sure how to troubleshoot. Pictures are landing in the folder, and there is never any indication in the log that anything past start up has ever happened. is there any other way to validate things are running? Is there no mqtt status message in the log that should happen at startup? or any way to tell that triggers was loaded? (log shows settings being loaded, although some goofy message on that, but no mention of triggers). Verbose flag didn't make any difference in logging from what i can say. Sort of at a loss.

  16. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  17. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    Settings:
    {
    "$schema": "https://raw.githubusercontent.com/danecreekphotography/node-deepstackai-trigger/main/src/schemas/settings.schema.json",
    "deepstackUri": "http://deepstack-ai:5000/",
    "enableAnnotations": false,
    "enableWebServer": true,
    "verbose": true,
    "awaitWriteFinish": true,
    "mqtt": {
    "uri": "mqtt://192.168.0.14:1883",
    "username": "#######",
    "password": "#######",
    "enabled": true
    },
    "telegram": {
    "botToken": "insert bot token here",
    "enabled": false
    },
    "pushbullet": {
    "accessToken": "access token here",
    "enabled": false
    },
    "pushover": {
    "apiKey": "api key here",
    "userKey": "user key here",
    "enabled": false
    }
    }

    Docker-compose:
    version: "3.8"
    services:
    trigger:
    volumes:
    - '/share/Container/deepstackai/aiinput:/aiinput'
    - '/share/Container/deepstackai/config:/config'
    environment:
    - TZ=America/Chicago
    ports:
    - 4242:4242
    image: ghcr.io/neilenns/node-deepstackai-trigger:latest
    restart: always
    depends_on:
    - deepstack-ai

    deepstack-ai:
    image: deepquestai/deepstack:latest
    restart: always
    volumes:
    - localstorage:/datastore
    environment:
    - VISION-DETECTION=True

    volumes:
    localstorage:

  18. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  19. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    {
    "$schema": "https://raw.githubusercontent.com/danecreekphotography/node-deepstackai-trigger/main/src/schemas/triggerConfiguration.schema.json",
    "triggers": [
    {
    "name": "Driveway detector",
    "watchPattern": "driveway*.jpg",
    "enabled": true,
    "threshold": {
    "minimum": 0,
    "maximum": 100
    },
    "handlers": {
    "mqtt": {
    "topic": "aimotion/triggers/driveway"
    }
    },
    "watchObjects": ["car", "truck", "person"]
    },
    {
    "name": "Doorbell detector",
    "watchPattern": "doorbell*.jpg",
    "enabled": true,
    "threshold": {
    "minimum": 0,
    "maximum": 100
    },
    "handlers": {
    "mqtt": {
    "messages": [{ "topic": "aimotion/triggers/doorbell" }]
    }
    },
    "watchObjects": ["person"]
    },
    {
    "name": "Front Door detector",
    "watchPattern": "/aiinput/FrontDoor*.jpg",
    "enabled": true,
    "threshold": {
    "minimum": 0,
    "maximum": 100
    },
    "handlers": {
    "mqtt": {
    "messages": [{ "topic": "aimotion/triggers/FrontDoor" }]
    }
    },
    "watchObjects": ["person"]
    },
    {
    "name": "Backyard detector",
    "watchPattern": "/aiinput/BackYard*.jpg",
    "enabled": true,
    "threshold": {
    "minimum": 0,
    "maximum": 100
    },
    "handlers": {
    "mqtt": {
    "messages": [{ "topic": "aimotion/triggers/backyard" }]
    }
    },
    "watchObjects": ["person"]
    },
    {
    "name": "Side door detector",
    "watchPattern": "GgSideDoor*.jpg",
    "enabled": true,
    "threshold": {
    "minimum": 0,
    "maximum": 100
    },
    "handlers": {
    "mqtt": {
    "messages": [{ "topic": "aimotion/triggers/side_door" }]
    }
    },
    "watchObjects": ["person"]
    }
    ]
    }

  20. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  21. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  22. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    aiinput

    Appears so for images....

  23. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    That's one thing that has always been concerning. No mqtt connection status messages. but i can get the container log to throw an error when i change the port to a bad one. changing it back just allows it to start without an mqtt connection error but no actual connection validation message (and nothing of course in mqtt itself)

  24. neilenns commented on Aug 9, 2022

    @neilenns
    Owner
  25. mikerenna commented on Aug 9, 2022

    @mikerenna
    Author

    thank you. feels challenging to me from a pc as well. :) Appreciate your help and please do so at your leisure.

  26. Repository owner locked and limited conversation to collaborators on Aug 9, 2022
  27. converted this issue into a discussion #457 on Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions