iotagent-json
iotagent-json copied to clipboard
Use of docker secrets not working
Hey there,
in the docker documentation it says that secrets can be used to prevent clear written passwords etc as environment files. I'm using version 1.17.2.
It seems that is not working since I always get a socket error and (0,5). It took me quite some while to figure that out cause the error message really didn't help here: ` time=2021-04-16T12:07:41.533Z | lvl=FATAL | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {} | comp=IoTAgent
time=2021-04-16T12:07:41.533Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: Callback was already called. | comp=IoTAgent`
After changing the - in this case mqtt - username and password to clear text it was working fine again. (the secrets have been properly mounted into the container).
Just let me know if you need any more information :)
Maybe @jason-fox could provide help on this. I think he was the one that implemented the secret system in docker in this repository (although I'm not fully sure :)
I have created a highly insecure debug branch on my personal fork - try building it and checking what comes out in the log?
docker build -t iot-agent . \
--build-arg GITHUB_ACCOUNT=jason-fox \
--build-arg GITHUB_REPOSITORY=iotagent-json \
--build-arg SOURCE_BRANCH=debug \
--target=distroless|pm2|slim