open /updater/data/config.json: no such file or directory #11

Closed
opened 2025-11-20 04:18:42 -05:00 by saavagebueno · 7 comments
Owner

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

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
Author
Owner

@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/data and send back the output?

You can also run in the container:

docker exec -it ddns /bin/sh
ls -l /updater/data
cat /updater/data/config.json
exit

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 😄 ).

@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/data` and send back the output? You can also run in the container: ``` docker exec -it ddns /bin/sh ls -l /updater/data cat /updater/data/config.json exit ``` 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 :smile: ).
Author
Owner

@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 ddns

Here is the permissions for config.json:

-r-------- 1 clownfused clownfused 465 Nov 5 07:37 config.json

I am unable to run the commands in the container because the error is fatal and exits the container with code 1

Fortunately, 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.

@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 ddns` Here is the permissions for config.json: `-r-------- 1 clownfused clownfused 465 Nov 5 07:37 config.json` I am unable to run the commands in the container because the error is fatal and exits the container with `code 1` Fortunately, 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](https://podman.io/) which doesn't allow containers to run as root by default. So hopefully we can solve this without it.
Author
Owner

@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 with id -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

@qdm12 commented on GitHub (Nov 6, 2019): Cool, I will have a look :smile: although sometimes root is necessary unfortunately. What's your user ID? `1000`? (check with `id -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
Author
Owner

@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

@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
Author
Owner

@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:

  1. create a file config.json anywhere on your machine, in example /my/path/ddns.json
  2. Ensure its ownership with chown 1000 /my/path/ddns.json and read permission only chmod 400 /my/path/ddns.json
  3. launch the Docker container using the terminal with docker 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 deploy or docker-compose up -d for 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.

@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: 1. create a file config.json anywhere on your machine, in example `/my/path/ddns.json` 1. Ensure its ownership with `chown 1000 /my/path/ddns.json` and read permission only `chmod 400 /my/path/ddns.json` 1. launch the Docker container using the terminal with `docker 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 deploy` or `docker-compose up -d` for 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.
Author
Owner

@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

{
     "settings": [
         
         {
             "provider": "dreamhost",
             "domain": "my FQDN here",
             "host": "subdomain",
             "ip_method": "provider",
             "key": "EEDU3ZAM3CP99YPG",
         }
     ]
 }

The error it giving me is as follows:

######## Give some ❤ at #########                                                                                                                            
# github.com/qdm12/ddns-updater #                                                                                                                            
#################################                                                                                                                            
                                                                                                                                                             
{"level":"FATAL","ts":"2019-11-09T21:22:34.672Z","msg":"unexpected end of JSON input","node_id":0}                                                           
#################################                                                                                                                            
##### DDNS Universal Updater ####                                                                                                                            
######## by Quentin McGaw #######                                                                                                                            
######## Give some ❤ at #########                                                                                                                            
# github.com/qdm12/ddns-updater #                                                                                                                            
#################################                                                                                                                            
                                                                                                                                                             
{"level":"FATAL","ts":"2019-11-09T21:41:33.909Z","msg":"invalid character '}' looking for beginning of object key string","node_id":0} 

I think I am getting closer. Thanks

@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 ```json { "settings": [ { "provider": "dreamhost", "domain": "my FQDN here", "host": "subdomain", "ip_method": "provider", "key": "EEDU3ZAM3CP99YPG", } ] } ``` The error it giving me is as follows: ``` ######## Give some ❤ at ######### # github.com/qdm12/ddns-updater # ################################# {"level":"FATAL","ts":"2019-11-09T21:22:34.672Z","msg":"unexpected end of JSON input","node_id":0} ################################# ##### DDNS Universal Updater #### ######## by Quentin McGaw ####### ######## Give some ❤ at ######### # github.com/qdm12/ddns-updater # ################################# {"level":"FATAL","ts":"2019-11-09T21:41:33.909Z","msg":"invalid character '}' looking for beginning of object key string","node_id":0} ``` I think I am getting closer. Thanks
Author
Owner

@qdm12 commented on GitHub (Nov 9, 2019):

The line "key": "EEDU3ZAM3CP99YPG", should not have a trailing coma 😉 Json can be annoying...

@qdm12 commented on GitHub (Nov 9, 2019): The line `"key": "EEDU3ZAM3CP99YPG",` should not have a trailing coma :wink: Json can be annoying...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#11