Upload backup on Digital Ocean spaces returns 400 Bad Request
Summary
When I create a backup with gitlab-rake gitlab:backup:create
the upload failed.
I use Digital Ocean spaces to store my backups. Uploads was working until I upgrade GitLab to 10.4.0 (gitlab-ci
with omnibus).
Steps to reproduce
Just create a new backup with gitlab-rake gitlab:backup:create
. And use Digital Ocean spaces to store file.
What is the current bug behavior?
When the archive is created, task try to upload the file but failed.
What is the expected correct behavior?
The archive file must be uploaded.
Relevant logs and/or screenshots
Uploading backup archive to remote storage my-backups ... rake aborted!
Excon::Error::BadRequest: Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>InvalidRequest</Code><BucketName>my-backups</BucketName><RequestId>tx000000000000000179fe4-005a6dea53-6a4b8-ams3a</RequestId><HostId>6a4b8-ams3a-ams3</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Content-Length" => "226"
"Content-Type" => "application/xml"
"Date" => "Sun, 28 Jan 2018 15:20:51 GMT"
"Strict-Transport-Security" => "max-age=15552000; includeSubDomains; preload"
"x-amz-request-id" => "tx000000000000000179fe4-005a6dea53-6a4b8-ams3a"
}
:host => "my-backups.ams3.digitaloceanspaces.com"
:local_address => "x.x.x.x"
:local_port => 52612
:path => "/1517152734_2018_01_28_10.4.1_gitlab_backup.tar"
:port => 443
:reason_phrase => "Bad Request"
:remote_ip => "x.x.x.x"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:42:in `upload'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:27:in `block in pack'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:11:in `chdir'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:11:in `pack'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:21:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:backup:create
(See full trace by running task with --trace)
Results of GitLab environment info
Expand for output related to GitLab environment info
$ gitlab-rake gitlab:env:infoSystem information System: Debian 8.10 Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknown
GitLab information Version: 10.4.1 Revision: be80a97 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git..** HTTP Clone URL: https://git../some-group/some-project.git SSH Clone URL: git@git.****.:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.11.0 Repository storage paths:
- default: /mnt/storage/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
$ gitlab-rake gitlab:check SANITIZE=true Checking GitLab Shell ...GitLab Shell version >= 5.11.0 ? ... OK (5.11.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 2/1 ... ok 2/2 ... ok 4/3 ... ok 6/5 ... ok 2/6 ... ok 18/7 ... ok 2/10 ... ok 4/11 ... ok 2/12 ... ok 4/13 ... ok 2/14 ... ok 25/20 ... ok 2/23 ... ok 2/24 ... repository is empty 2/25 ... ok 2/29 ... ok 2/31 ... ok 2/34 ... ok 12/51 ... ok 13/52 ... ok 12/54 ... ok 23/55 ... ok 2/56 ... ok 15/59 ... ok 2/61 ... ok 18/62 ... ok 18/68 ... ok 18/70 ... ok 18/72 ... repository is empty 18/73 ... ok 18/74 ... ok 2/75 ... ok 23/76 ... repository is empty 23/77 ... ok 23/79 ... ok 18/80 ... ok 20/81 ... ok 18/82 ... ok 18/83 ... repository is empty 23/84 ... ok 23/85 ... ok 23/86 ... ok 18/87 ... repository is empty 4/88 ... ok 18/89 ... ok 23/90 ... ok 24/91 ... ok 26/92 ... ok 26/93 ... ok 2/94 ... ok 2/95 ... repository is empty 31/96 ... ok 31/97 ... ok 23/98 ... ok 2/99 ... ok 31/100 ... ok 33/101 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 4/3 ... yes 6/5 ... yes 2/6 ... yes 18/7 ... yes 2/10 ... yes 4/11 ... yes 2/12 ... yes 4/13 ... yes 2/14 ... yes 25/20 ... yes 2/23 ... yes 2/24 ... yes 2/25 ... yes 2/29 ... yes 2/31 ... yes 2/34 ... yes 12/51 ... yes 13/52 ... yes 12/54 ... yes 23/55 ... yes 2/56 ... yes 15/59 ... yes 2/61 ... yes 18/62 ... yes 18/68 ... yes 18/70 ... yes 18/72 ... yes 18/73 ... yes 18/74 ... yes 2/75 ... yes 23/76 ... yes 23/77 ... yes 23/79 ... yes 18/80 ... yes 20/81 ... yes 18/82 ... yes 18/83 ... yes 23/84 ... yes 23/85 ... yes 23/86 ... yes 18/87 ... yes 4/88 ... yes 18/89 ... yes 23/90 ... yes 24/91 ... yes 26/92 ... yes 26/93 ... yes 2/94 ... yes 2/95 ... yes 31/96 ... yes 31/97 ... yes 23/98 ... yes 2/99 ... yes 31/100 ... yes 33/101 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 9
Checking GitLab ... Finished