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

Restoring a backup gives error #588

Open
MartinLesterSynamedia opened this issue Feb 28, 2020 · 5 comments
Open

Restoring a backup gives error #588

MartinLesterSynamedia opened this issue Feb 28, 2020 · 5 comments
Labels

Comments

@MartinLesterSynamedia
Copy link

@MartinLesterSynamedia MartinLesterSynamedia commented Feb 28, 2020

When I try and restore a backup, I get an error:

cd backup-utils/bin
./ghe-restore my-debug-server.mycompany.com
Checking for leaked keys in the backup snapshot that is being restored ...
* No leaked keys found
Connect ############################:122 OK (v2.19.6)

WARNING: All data on GitHub Enterprise appliance ############################ (v2.19.6)
         will be overwritten with data from snapshot 20200228T031511.
Please verify that this is the correct restore host before continuing.
Type 'yes' to continue: yes

Starting restore of ########################:122 with backup-utils v2.19.1 from snapshot 20200228T031511
/home/github/backup-utils/share/github-backup-utils/bm.sh: line 54: /mnt/github-backup/production/20200228T031511/benchmarks/benchmark.20200228T104648.log: Permission denied
Warning: storing backup-utils version remotely failed.
Stopping cron and github-timerd ...
Restoring UUID ...
Restoring MySQL database ...
/home/github/backup-utils/share/github-backup-utils/bm.sh: line 54: /mnt/github-backup/production/20200228T031511/benchmarks/benchmark.20200228T104648.log: Permission denied

It seems that because the docker container is creating all the files and folders as 755 root:root and my user github is not a member of root that I could not write to the folder and the restore fails.

I think I have fixed the issue with sudo chmod g+s production and then making all the folders in that path owned by the github group.

This was not obvious, took quite a while to find as a solution and still meant I had to retrospectively chgrp the entire backup folder which takes a long while. I am also not sure it is enough as the default is 755 not 775 and in an effort to discover if the backups are valid simply did chmod -r 775 current, which also takes a long while.

Am I doing something wrong?
Should I just be running the restore as root?
Should I be running the restore using your docker container?

@stoe stoe added the question label Mar 4, 2020
@stoe
Copy link
Member

@stoe stoe commented Mar 4, 2020

@github/backup-utils for awareness 👀

@stoe
Copy link
Member

@stoe stoe commented Mar 4, 2020

#484 might be related.

@djdefi
Copy link
Member

@djdefi djdefi commented Mar 4, 2020

The current Dockerfile does assume that it is being run via root essentially.

We probably should setup a nonprivileged user within the image for Docker best practices reasons, and to allow the image to be run by non root users in different environments.

@MartinLesterSynamedia
Copy link
Author

@MartinLesterSynamedia MartinLesterSynamedia commented Mar 5, 2020

So is the answer for now to run the restore as root?

@cainejette
Copy link
Contributor

@cainejette cainejette commented Jun 23, 2020

Worth a shot @MartinLesterSynamedia !

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.