[GH-ISSUE #56] [HELP] need help making the database writeable by user 10001 #44

Closed
opened 2026-02-27 10:15:27 +03:00 by kerem · 6 comments
Owner

Originally created by @back-lacking on GitHub (Jun 9, 2024).
Original GitHub issue: https://github.com/matze/wastebin/issues/56

So im trying to get wastebin running using docker compose. the main part im having trouble with is trying to make the data base writable. i tried running these commands to make the data base file writable, but all have failed

chmod 755 data/
sudo chown 10001 ./data/
sudo chmod 644 ./data/

trying to run docker compose up -d to get it up, but it wouldnt start and the logs would report that the database was read only.
can I know the proper command in order to get this up and running?

Originally created by @back-lacking on GitHub (Jun 9, 2024). Original GitHub issue: https://github.com/matze/wastebin/issues/56 So im trying to get wastebin running using docker compose. the main part im having trouble with is trying to make the data base writable. i tried running these commands to make the data base file writable, but all have failed ```bash chmod 755 data/ sudo chown 10001 ./data/ sudo chmod 644 ./data/ ``` trying to run `docker compose up -d` to get it up, but it wouldnt start and the logs would report that the database was read only. can I know the proper command in order to get this up and running?
kerem closed this issue 2026-02-27 10:15:28 +03:00
Author
Owner

@matze commented on GitHub (Jun 9, 2024):

I personally don't use docker compose but could it be that 10001 is not the correct user?

<!-- gh-comment-id:2156736542 --> @matze commented on GitHub (Jun 9, 2024): I personally don't use docker compose but could it be that 10001 is not the correct user?
Author
Owner

@back-lacking commented on GitHub (Jun 9, 2024):

I personally don't use docker compose but could it be that 10001 is not the correct user?

im not sure, i was just following the default docker compose you gave. and there was a note saying "make sure ./data is writable by user 10001."

<!-- gh-comment-id:2156739937 --> @back-lacking commented on GitHub (Jun 9, 2024): > I personally don't use docker compose but could it be that 10001 is not the correct user? im not sure, i was just following the default docker compose you gave. and there was a note saying "make sure ./data is writable by user 10001."
Author
Owner

@back-lacking commented on GitHub (Jun 9, 2024):

i tried just looking up how to make a folder writable by a certain user, and the sudo chown command was what i did

<!-- gh-comment-id:2156740489 --> @back-lacking commented on GitHub (Jun 9, 2024): i tried just looking up how to make a folder writable by a certain user, and the `sudo chown` command was what i did
Author
Owner

@matze commented on GitHub (Jun 10, 2024):

I did not write those instructions but perhaps @NiFNi can help out :-)

<!-- gh-comment-id:2157519097 --> @matze commented on GitHub (Jun 10, 2024): I did not write those instructions but perhaps @NiFNi can help out :-)
Author
Owner

@NiFNi commented on GitHub (Jun 10, 2024):

The UID in the Dockerfile is 10001 as you can see here: github.com/matze/wastebin@f13fcd077b/Dockerfile (L10)
Permissions like this work for me:
image

In case the database file is already created make sure it is also owned by 10001. Best is to just run these commands to get the default permissions:

chmod 755 data
chmod 644 data/state.db
chown -R 10001:10001 data

One hint: keep in mind that a user needs executable permissions of a folder to view the content of the folder in UNIX systems. So the user 10001 has to have the read+executable permission of the data folder and the read+write permissions of the state.db file which will be achieved by the commands above.

<!-- gh-comment-id:2157547709 --> @NiFNi commented on GitHub (Jun 10, 2024): The UID in the Dockerfile is 10001 as you can see here: https://github.com/matze/wastebin/blob/f13fcd077b15c974c1e145cfb19534fa8be85964/Dockerfile#L10 Permissions like this work for me: ![image](https://github.com/matze/wastebin/assets/11833155/497894a2-ca86-4c51-98ef-fda3b9a721ee) In case the database file is already created make sure it is also owned by 10001. Best is to just run these commands to get the default permissions: ``` chmod 755 data chmod 644 data/state.db chown -R 10001:10001 data ``` One hint: keep in mind that a user needs executable permissions of a folder to view the content of the folder in UNIX systems. So the user 10001 has to have the read+executable permission of the data folder and the read+write permissions of the state.db file which will be achieved by the commands above.
Author
Owner

@back-lacking commented on GitHub (Jun 11, 2024):

Running those commands fixed the issue

<!-- gh-comment-id:2159727225 --> @back-lacking commented on GitHub (Jun 11, 2024): Running those commands fixed the issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#44
No description provided.