Comments (6)
Thanks for reporting an issue.
I just tested it and it seems to preserve the permissions of the archived files correctly. Could you please describe precisely, step by step how to reproduce the problem? Are you talking about changing permissions for the mounted directory itself (it that case it's managed by Docker AFAIK)?
from volume-backup.
Sorry for the late reply.
To reproduce the issue, you can do the following:
1.
docker run -d --name openproject -e SECRET_KEY_BASE=secret \
-v pgdata:/var/lib/postgresql/9.4/main \
openproject/community:7
Watch the logs until you see the success message. That is the time, when the internal Postgres Server is successfully configured.
- Shutdown the server and delete the openproject container.
- Backup the pgdata volume.
- Delete the pgdata volume on docker.
- Restore the pgdata volume.
- Start the openproject container with the same command as step 1.
When you watch the logs of the container, it doesn't start up because the permissions of the /var/lib/postgresql/9.4/main are not 700 any more.
When I mounted the pgdata volume in a debian image (mountpoint /pgadata/ and executed chmod 700 /pgdata and started the openproject container again, it worked.
from volume-backup.
Thanks a lot for detailed description.
Since you are mounting the volume directly on /var/lib/postgresql/9.4/main, I think Docker is directly responsible for setting the permissions on the new one and volume-backup is not really touching it - it only recovers contents of the volume, not the volume itself.
Still it's an interesting and probably common use case, I will investigate and try to do something about it.
Could you clarify how do you create the deleted volume?
from volume-backup.
I restored the image with the following command:
docker run -v pgdata:/volume -v /home/USER:/backup --rm loomchild/volume-backup restore pgdata
from volume-backup.
Still no time to look into this, sorry..
In the meantime, I found this, perhaps it can serve as a workaround: https://github.com/lebokus/docker-volume-bindfs
from volume-backup.
Hi,
I finally managed to closer at the problem (sorry for a long wait) and I think it's not related to volume-backup
at all. The script properly recovers permissions, also for the volume root directory.
I can reproduce the issue by simply running, stopping, deleting and re-running the openproject
container (it corresponds to points 1, 2 and 6 in your reproduction path). At the moment I try to start it again, permissions change.
I think the issue is caused by a bug in https://github.com/opf/openproject/blob/dev/Dockerfile.public. This line seems to be responsible:
RUN rm -rf /var/lib/postgresql/9.6/main && mkdir -p /var/lib/postgresql/9.6/main && chown -R postgres:postgres /var/lib/postgresql/9.6
When I tried a simple test and included a similar line, it refreshed the permissions every time the container was created. Specifically mkdir
seems to be causing an issue here.
Please let me know if you would like to continue investigating this issue, otherwise I will close the ticket. I will also contact the project about the issue.
Jarek
from volume-backup.
Related Issues (20)
- Error while trying to restore the volume in other machine HOT 2
- add verbose mode to backup HOT 3
- Signals, such as Ctrl-C are not handled HOT 1
- restore from stdin expects bzip2 input HOT 3
- add option to include arbitrary tar options HOT 2
- include options for no-clobber HOT 4
- One-minute sleep should no longer be necessary HOT 2
- Cannot restore backuped volume: Archive file *.tar.bz2 does not exist HOT 3
- Fails to Run on Raspberry Pi 4 (aarch64) HOT 2
- Labels are not backuped / restored HOT 9
- Multi-arch builds for arm64 HOT 3
- Add image to ghcr.io repository HOT 1
- Stop containers before backup HOT 1
- Need 2x more space for backup HOT 13
- pbzip2 support? HOT 6
- Consider using parallel versions of algorithms by default HOT 2
- Automated monthly build (GitHub Actions) HOT 1
- Question: Why use `cat file |` instead of `< file`? HOT 3
- Consider an adaptive algorithm by default HOT 5
- Slow zstd compression HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volume-backup.