Unable to open database file..... #2

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

Originally created by @danmed on GitHub (Apr 29, 2019).

2019/04/29 15:36:32 Info: Node 0: Found 1 records to update
#################################
##### DDNS Universal Updater ####
######## by Quentin McGaw #######
######## Give some ❤ at #########
# github.com/qdm12/ddns-updater #
#################################
2019/04/29 15:36:32 Info: Node 0: unable to open database file
Originally created by @danmed on GitHub (Apr 29, 2019). ``` 2019/04/29 15:36:32 Info: Node 0: Found 1 records to update ################################# ##### DDNS Universal Updater #### ######## by Quentin McGaw ####### ######## Give some ❤ at ######### # github.com/qdm12/ddns-updater # ################################# 2019/04/29 15:36:32 Info: Node 0: unable to open database file ```
Author
Owner

@danmed commented on GitHub (Apr 29, 2019):

I'm an idiot.

@danmed commented on GitHub (Apr 29, 2019): I'm an idiot.
Author
Owner

@qdm12 commented on GitHub (Apr 29, 2019):

Don't be harsh on you, it happens to all of us 😄

However, did the line 2019/04/29 15:36:32 Info: Node 0: Found 1 records to update came before the rest? That seems odd and should not happen 🤔

Also you might want to pull the last image as I fixed several things today. Thanks !

@qdm12 commented on GitHub (Apr 29, 2019): Don't be harsh on you, it happens to all of us 😄 However, did the line `2019/04/29 15:36:32 Info: Node 0: Found 1 records to update` came before the rest? That seems odd and should not happen 🤔 Also you might want to pull the last image as I fixed several things today. Thanks !
Author
Owner

@danmed commented on GitHub (Apr 29, 2019):

I may have incorrectly copied the output.. I had simply forgotten to set
permissions on the data folder :)

On Mon, 29 Apr 2019, 16:43 Quentin McGaw, notifications@github.com wrote:

Don't be harsh on you, it happens to all of us 😄

However, did the line 2019/04/29 15:36:32 Info: Node 0: Found 1 records
to update came before the rest? That seems odd and should not happen 🤔


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/qdm12/ddns-updater/issues/4#issuecomment-487632018,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5S4WULK4ZCZXQYATXXSEDPS4JQ5ANCNFSM4HJENY6Q
.

@danmed commented on GitHub (Apr 29, 2019): I may have incorrectly copied the output.. I had simply forgotten to set permissions on the data folder :) On Mon, 29 Apr 2019, 16:43 Quentin McGaw, <notifications@github.com> wrote: > Don't be harsh on you, it happens to all of us 😄 > > However, did the line 2019/04/29 15:36:32 Info: Node 0: Found 1 records > to update came before the rest? That seems odd and should not happen 🤔 > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub > <https://github.com/qdm12/ddns-updater/issues/4#issuecomment-487632018>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AA5S4WULK4ZCZXQYATXXSEDPS4JQ5ANCNFSM4HJENY6Q> > . >
Author
Owner

@UntouchedWagons commented on GitHub (Dec 24, 2019):

What did you do to fix this? I'm having the same issue and have no idea what the problem is. https://xkcd.com/979/

@UntouchedWagons commented on GitHub (Dec 24, 2019): What did you do to fix this? I'm having the same issue and have no idea what the problem is. https://xkcd.com/979/
Author
Owner

@qdm12 commented on GitHub (Dec 24, 2019):

Please post back the output from ls -l on the directory containing the database file to see permissions and ownership.

Merry Christmas 🎄 !

@qdm12 commented on GitHub (Dec 24, 2019): Please post back the output from `ls -l` on the directory containing the database file to see permissions and ownership. Merry Christmas :christmas_tree: !
Author
Owner

@UntouchedWagons commented on GitHub (Dec 24, 2019):

$ls -l /docker/ddns-updater 
total 5
-rw-r--r-- 1 root root 295 Dec 25 02:09 config.json
@UntouchedWagons commented on GitHub (Dec 24, 2019): $ls -l /docker/ddns-updater total 5 -rw-r--r-- 1 root root 295 Dec 25 02:09 config.json
Author
Owner

@qdm12 commented on GitHub (Dec 25, 2019):

Yes it's owned by root that's why it doesn't work.

Run this to make it owned by user ID 1000 and group ID 1000:

chown 1000:1000 /docker/ddns-updater/config.json
@qdm12 commented on GitHub (Dec 25, 2019): Yes it's owned by `root` that's why it doesn't work. Run this to make it owned by user ID 1000 and group ID 1000: ```sh chown 1000:1000 /docker/ddns-updater/config.json ```
Author
Owner

@UntouchedWagons commented on GitHub (Dec 25, 2019):

Still says unable to open database file {"node_id": 0} in logs

[Edit]

I changed the ownership of /docker/ddns-updater to 1000:1000 and it's sort of working now.

[Edit #2]

Yeah it's fine now, I added an A+ Dynamic DNS Record and it's fine now.

I had seen the instructions that the config file was to be owned by the user docker used, but I've never had to do that for any other docker container before so I was a bit confused.

@UntouchedWagons commented on GitHub (Dec 25, 2019): Still says `unable to open database file {"node_id": 0}` in logs [Edit] I changed the ownership of `/docker/ddns-updater` to 1000:1000 and it's sort of working now. [Edit #2] Yeah it's fine now, I added an A+ Dynamic DNS Record and it's fine now. I had seen the instructions that the config file was to be owned by the user docker used, but I've never had to do that for any other docker container before so I was a bit confused.
Author
Owner

@qdm12 commented on GitHub (Dec 25, 2019):

If you bind mount the directory, you have to change the ownership of the directory too, forgot to mention. In my case I only bind mount the config file.

Most containers out there use the root user by default, which is dangerous as anyone getting access to the container can almost do anything your host root user can do, see this for more information for example.

Sometimes root user is needed (i. e. run a VPN) but 90% of the time it's not.

The disadvantage is that you have to match the bind mounted files with the user running the container. Note that you can change the user running the container with --user=1001:1001 for example or --user="root".

@qdm12 commented on GitHub (Dec 25, 2019): If you bind mount the directory, you have to change the ownership of the directory too, forgot to mention. In my case I only bind mount the config file. Most containers out there use the root user by default, which is dangerous as anyone getting access to the container can almost do anything your host root user can do, see [this for more information for example](https://medium.com/@mccode/processes-in-containers-should-not-run-as-root-2feae3f0df3b). Sometimes root user is needed (i. e. run a VPN) but 90% of the time it's not. The disadvantage is that you have to match the bind mounted files with the user running the container. Note that you can change the user running the container with `--user=1001:1001` for example or `--user="root"`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#2