sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.88k stars 2.14k forks source link

gitlab Backup get Bundler::GemfileNotFound #1749

Open zer01ike opened 5 years ago

zer01ike commented 5 years ago

I try to backup gitlab(11.4.0) using

docker-compose run --rm gitlab app:rake gitlab:backup:create

from the README.md and get Error GRPC::Unavailable: 14:Connect Failed that is same as #1744

Then I try to sovle it using the solution in #1655

/sbin/entrypoint.sh app:rake gitlab:backup:create

then I get the Error

Running raketask gitlab:backup:create...
Could not locate Gemfile or .bundle/ directory
Bundler::GemfileNotFound: Could not locate Gemfile or .bundle/ directory
/var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler.rb:223:in `rescue in root'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler.rb:219:in `root'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler.rb:80:in `bundle_path'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/shared_helpers.rb:230:in `validate_bundle_path'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/shared_helpers.rb:312:in `set_path'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/shared_helpers.rb:90:in `set_bundle_environment'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/cli/exec.rb:25:in `run'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/cli.rb:424:in `exec'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/cli.rb:27:in `dispatch'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/cli.rb:18:in `start'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/exe/bundle:30:in `block in <top (required)>'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
  /var/lib/gems/2.4.0/gems/bundler-1.16.6/exe/bundle:22:in `<top (required)>'
  /usr/local/bin/bundle:23:in `load'
  /usr/local/bin/bundle:23:in `<main>'

lt looks like not installing bundler or some service did not start

I have do some search but can't sovle it

bjcone commented 5 years ago

+1

I tried to manually run a backup (as my automated backups haven't been working for a few weeks) and got the same error;

root@f54f226bfefc:/var/log/gitlab# su - git
git@f54f226bfefc:~$ bundle exec rake gitlab:backup:create
Could not locate Gemfile or .bundle/ directory

As a (potentially) related issue, my automated backups are configured to keep daily backups for the default time of 7 days. However, since upgrading to 11.3.4 on 10/10/18 I don't show any new backup files though my database is successfully backed up each day. I am currently running 11.4.0

git@f54f226bfefc:~$ ls -l /home/git/data/backups/
total 71029489
-rw-------  1 git  git 10393528320 Oct  4 04:12 1538626202_2018_10_04_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393569280 Oct  5 04:13 1538712608_2018_10_05_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393651200 Oct  6 04:12 1538799002_2018_10_06_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393640960 Oct  7 04:12 1538885400_2018_10_07_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393651200 Oct  8 04:13 1538971808_2018_10_08_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393681920 Oct  9 04:12 1539058213_2018_10_09_11.1.4_gitlab_backup.tar
-rw-------  1 git  git 10393671680 Oct 10 04:13 1539144637_2018_10_10_11.1.4_gitlab_backup.tar

This is deployed in Rancher with the following env variables:

GITLAB_BACKUP_SCHEDULE = daily 
GITLAB_BACKUP_ARCHIVE_PERMISSIONS = 0644 
GITLAB_BACKUP_DIR = /home/git/data/backups
QuickJack commented 5 years ago

I am just trying to upgrade my 11.1.4 instance. I was wondering why the user profile themes were updated (#1762). I then wanted to go back for my testing instance and was running into the backup restore issue.

There is another problem when trying to restore a backup:

(...)
date: invalid date '@1542068726_2018_11_13_11.1.4'
‣ 1542068726_2018_11_13_11.1.4_gitlab_backup.tar (created at )

Select a backup to restore:

It would be nice if these backup/restore problems could be fixed or if we would have at least a workaround.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.