Skip to content

Gitlab omnibus backup not working for AWS

Hi,

I am using the following configuration:

gitlab_rails['backup_upload_connection'] = {
          'provider'              => 'AWS',
          'region'                => 'ams3',
          'aws_access_key_id'     => 'XXXXXX',
          'aws_secret_access_key' => 'XXXXXX',
          'endpoint'              => 'https://ams3.digitaloceanspaces.com'
        }
        gitlab_rails['backup_upload_remote_directory'] = 'XXXXXX'
        gitlab_rails['backup_multipart_chunk_size'] = 104857600

so basically when I execute the backup command: gitlab-rake gitlab:backup:create --trace

I receive a strange exception related to missing Length:

Excon::Error::LengthRequired: Expected(200) <=> Actual(411 Length Required)
excon.error.response
  :body          => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>MissingContentLength</Code><BucketName>XXXXXX</BucketName><RequestId>tx0000000000000212200e0-005a3c0854-ae42-ams3a</RequestId><HostId>ae42-ams3a-ams3</HostId></Error>"
  :cookies       => [
  ]
  :headers       => {
    "Accept-Ranges"             => "bytes"
    "Content-Length"            => "215"
    "Content-Type"              => "application/xml"
    "Date"                      => "Thu, 21 Dec 2017 19:15:32 GMT"
    "Strict-Transport-Security" => "max-age=15552000; includeSubDomains; preload"
    "x-amz-request-id"          => "tx0000000000000212200e0-005a3c0854-ae42-ams3a"
  }
  :host          => "XXXXXXX.ams3.digitaloceanspaces.com"
  :local_address => "192.168.38.79"
  :local_port    => 49840
  :path          => "/1513883731_2017_12_21_10.2.5-ee_gitlab_backup.tar"
  :port          => 443
  :reason_phrase => "Length Required"
  :remote_ip     => "5.101.110.225"
  :status        => 411
  :status_line   => "HTTP/1.1 411 Length Required\r\n"
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/excon-0.57.1/lib/excon/middlewares/expects.rb:7:in `response_call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/excon-0.57.1/lib/excon/middlewares/response_parser.rb:9:in `response_call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/excon-0.57.1/lib/excon/connection.rb:388:in `response'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/excon-0.57.1/lib/excon/connection.rb:252:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-core-1.44.3/lib/fog/core/connection.rb:81:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml/connection.rb:9:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-aws-1.4.0/lib/fog/aws/storage.rb:612:in `_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-aws-1.4.0/lib/fog/aws/storage.rb:607:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-aws-1.4.0/lib/fog/aws/requests/storage/put_object.rb:47:in `put_object'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-aws-1.4.0/lib/fog/aws/models/storage/file.rb:219:in `save'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/fog-core-1.44.3/lib/fog/core/collection.rb:50:in `create'
/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/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `block in execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:181:in `invoke'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:153:in `invoke_task'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block (2 levels) in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:118:in `run_with_threads'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:103:in `top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:81:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:78:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/redis-rack-2.0.3/bin/rake:17:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/redis-rack-2.0.3/bin/rake:17:in `<top (required)>'
/opt/gitlab/embedded/bin/rake:23:in `load'
/opt/gitlab/embedded/bin/rake:23:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:backup:create

I am using the latest docker image and commercial EE product, but may be applied to Community version as well.

Please check what is happening.

root@gitlab-1596860584-p1pq4:/# gitlab-rake gitlab:env:info

System information
System:
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.3.5p376
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.1.0
Redis Version:	3.2.5
Git Version:	2.13.6
Sidekiq Version:5.0.4
Go Version:	unknown

GitLab information
Version:	10.2.5-ee
Revision:	3ec4b67
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
DB Version:	9.6.6
URL:		https://dockerhost.gitlab-889663.c66.me
HTTP Clone URL:	https://dockerhost.gitlab-889663.c66.me/some-group/some-project.git
SSH Clone URL:	git@dockerhost.gitlab-889663.c66.me:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	5.10.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks
Git:		/opt/gitlab/embedded/bin/git
Edited by Achilleas Pipinellis