Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup restore doesn't work in Docker. #2519

Closed
ezynda3 opened this issue May 21, 2023 · 3 comments
Closed

Backup restore doesn't work in Docker. #2519

ezynda3 opened this issue May 21, 2023 · 3 comments

Comments

@ezynda3
Copy link

ezynda3 commented May 21, 2023

I have a docker instance of pocketbase running in the cloud. I make a backup of the db on my local machine which saves the backup to an S3 bucket. I have the cloud instance connected to the same S3 bucket. When I choose the back up file and try to restore it starts the process, reloads the page but doesn't actually change anything. All collections and user records are still empty.

@ganigeorgiev
Copy link
Member

Could you share your Dockerfile?

@ganigeorgiev
Copy link
Member

Generating backups inside a container works fine, but there seems to be an issue with the restore operation. I was able to reproduce it with the following minimal Dockerfile:

FROM alpine:3.16.3

ARG PB_VERSION

RUN apk add --no-cache \
    unzip

ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_arm64.zip /pocketbase/pb.zip

RUN unzip /pocketbase/pb.zip -d /pocketbase/

CMD ["/pocketbase/pocketbase", "serve", "--http=0.0.0.0:8090", "--debug"]

On restore the following log is printed:

failed to move the current pb_data to a temp location: rename /pocketbase/pb_data /pocketbase/pb_restore_Erjo/.pb_temp_to_delete/old_pb_data: device or resource busy

I guess it is because pb_data is a volume entry and probably can't be moved around so easily, but I'll try to investigate it further a little bit later.

@ganigeorgiev ganigeorgiev changed the title Backups run through the UI do not work when using Docker. Backup restore doesn't work in Docker. May 21, 2023
@ganigeorgiev
Copy link
Member

I've submitted a fix in master that manually moves each pb_data entry to avoid directly performing mv on the mounted volume dir.

The fix will be available with the next minor v0.16.1 release sometime later next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants