Git Product home page Git Product logo

Comments (6)

loomchild avatar loomchild commented on June 19, 2024

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.

breucode avatar breucode commented on June 19, 2024

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.

  1. Shutdown the server and delete the openproject container.
  2. Backup the pgdata volume.
  3. Delete the pgdata volume on docker.
  4. Restore the pgdata volume.
  5. 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.

loomchild avatar loomchild commented on June 19, 2024

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.

breucode avatar breucode commented on June 19, 2024

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.

loomchild avatar loomchild commented on June 19, 2024

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.

loomchild avatar loomchild commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.