Closed neilenns closed 3 years ago
@TonyBrobston I'm digging into this but if you have a few minutes and can look at it too it would be appreciated. Looks like we missed something during the code reviews and a straight upgrade to the new release breaks existing installs.
This looks like it's two separate problems. The one I'm seeing in local development is because replaceSecrets
doesn't check for a null secrets before attempting to do a replacement.
Adding this to the function resolves that problem in the local dev environment:
// If no secrets were provided don't attempt to do a replacement
if (!secrets) return;
That gets me past the issue to the same one that I see in my deployed instance. Looking into that now.
Ok I think I figured this out. This happens when:
The above code really needs to be:
// If no secrets were provided don't attempt to do a replacement
if (!secrets) return settings;
Ok this still isn't fully fixed. Looks like there is an issue where if it fails to load from /run/secrets/settings it never attempts to load from /config/settings.json.
Looks like the remaining issue is in readSettings()
which was throwing an exception instead of just logging and returning null, which prevented the .some()
from proceeding to try and load from the alternate locations.
Confirmed this now works on my real deployment. Just waiting for the latest build to pass with updated unit tests then I'll release this.
@danecreekphotography I'm just now seeing this thread.
Sounds good.
FIXED: secrets.json needs to be created in the secrets folder along with settings.json and triggers.json.
Setting this up for the first time.
Configured my docker-compose file as follows, and I am seeing the error reported for this issue i.e. "[Settings] Unable to read the secrets file: ENOENT: no such file or directory, open '/run/secrets/secrets'."
deepstack-ai:
container_name: deepstack-ai
image: deepquestai/deepstack:latest
restart: always
volumes:
- /mnt/storage/deepstack:/datastore
environment:
- VISION-DETECTION=True
trigger:
container_name: trigger
volumes:
- //192.168.0.88//aiinput:/aiinput
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
ports:
- "4242:4242"
secrets:
- triggers
- settings
image: danecreekphotography/node-deepstackai-trigger:latest
restart: always
depends_on:
- deepstack-ai```
Describe the bug Latest release with the new secrets stuff fails to start up
Log entries
This is what I get on my actual deployed instance:
And this is what I get in the main branch trying to debug this: