mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 10:38:41 -04:00
open /updater/data/config.json: no such file or directory #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Nov 6, 2019).
I am trying to get this container to run with no success.
I have other containers running with volume mounts which work fine.
I have made sure to set the permissions correctly on the data folder and config.json file.
Here is the error message:
{"level":"FATAL","ts":"2019-11-06T09:16:10.375Z","msg":"open /updater/data/config.json: no such file or directory","node_id":0}Here is the docker-compose.yml:
https://gist.github.com/Clownfused/9985b3dcc49ddfef67e167ab6089c5be
Any idea why this is happening?
Thanks
@qdm12 commented on GitHub (Nov 6, 2019):
Hi Clownfused,
Thanks for asking.
Is your config.json in
/etc/opt/ddns/data/?Try
ls -l /etc/opt/ddns/dataand send back the output?You can also run in the container:
PS: For permission testing, you can always run the container with
user: "root"to see if it works (most images out there run with root, I chose security over ease of use unfortunately or fortunately 😄 ).@ghost commented on GitHub (Nov 6, 2019):
Thanks for the quick reply
My config is in
/etc/opt/ddns/and here are the permissions for that directory:drwx------ 1 clownfused clownfused 512 Nov 6 04:25 ddnsHere is the permissions for config.json:
-r-------- 1 clownfused clownfused 465 Nov 5 07:37 config.jsonI am unable to run the commands in the container because the error is fatal and exits the container with
code 1Fortunately, I too choose security and don't want to run any container as root . In fact, I'm looking into switching from Docker to Podman which doesn't allow containers to run as root by default. So hopefully we can solve this without it.
@qdm12 commented on GitHub (Nov 6, 2019):
Cool, I will have a look 😄 although sometimes root is necessary unfortunately.
What's your user ID?
1000? (check withid -u)Try running with
entrypoint: /bin/sh -c "ls -l /updater/data"in your docker-compose.yml it will print out the list of files there@amesmich commented on GitHub (Nov 8, 2019):
First awesome job with this and thanks for writing it. Unfortunately I have the same issue. I know it cant find the config file because I don't know where to put it. I am running this in container station on my QNAP NAS (TS453 pro). I have other docker containers running fine, but I cant figure out how to access or add the config file in a docker container. I have SSH access to the host machine but cant figure out to find or access the path where the config file has to go. I can drill down to every level until I get the container roots and the IDs but that's where it ends. For example here's the root path for another container that's working and running.
/share/CACHEDEV1_DATA/Container/container-station-data/lib/docker/containers/d7d1a956e49a9e0012371491570aeffa3082fb56ad9f3ac7f84c0943082999aa/d7d1a956e49a9e0012371
Additionally the container fails on start up because of the missing config which means its harder to troubleshoot since its not running. Any advice? Sorry I know this is silly and not meant to be a how to. If I cant get it working Ill just run a VM instead.
Thanks,
Mike
@qdm12 commented on GitHub (Nov 8, 2019):
Hi Mike,
Not a problem at all, Docker is an amazing tool but we all went through the tough learning curve!
If you have ssh access then it's quite easy:
/my/path/ddns.jsonchown 1000 /my/path/ddns.jsonand read permission onlychmod 400 /my/path/ddns.jsondocker run -d -v /my/path/ddns.json:/config.json:ro qmcgaw/ddns-updater(check the readme for additional environment variables etc.).You can also use docker-compose.yml files with
docker stack deployordocker-compose up -dfor an easier maintenance and readability, see the docker-compose.yml file of this repository.One final note is that I'm reworking the code now, and might add some UI to allow adding config.json entries directly in the UI, but that's probably weeks away though.
@amesmich commented on GitHub (Nov 9, 2019):
Thanks for the feedback. After many iterations I just did it in root instead of using the "Container Station" app in my NAS. It now can find the config file but now I have a different error. Something in the config file. I want to update a dreamhost server and have the proper API key. My config file contains the following
The error it giving me is as follows:
I think I am getting closer. Thanks
@qdm12 commented on GitHub (Nov 9, 2019):
The line
"key": "EEDU3ZAM3CP99YPG",should not have a trailing coma 😉 Json can be annoying...