Cannot upload to S3

Summary

Error while uploading backup to S3

Steps to reproduce

sudo gitlab-rake gitlab:backup:create

What is the current bug behavior?

Uploading backup archive to remote storage backup.xxx.com/ 
rake aborted!
Nokogiri::XML::SyntaxError: 1:1: FATAL: Extra content at the end of the document
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:189:in `connect_to_remote_directory'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:40: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

Results of GitLab environment info

System information
System:		Ubuntu 16.04
Current User:	gitlab
Using RVM:	no
Ruby Version:	2.3.7p456
Gem Version:	2.6.14
Bundler Version:1.13.7
Rake Version:	12.3.1
Redis Version:	3.2.11
Git Version:	2.16.4
Sidekiq Version:5.0.5
Go Version:	unknown

GitLab information
Version:	10.8.4
Revision:	2268d0c
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
URL:		https://xxx
HTTP Clone URL:	https://xxx/some-group/some-project.git
SSH Clone URL:	gitlab@gxxx:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	7.1.2
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks
Git:		/opt/gitlab/embedded/bin/git

#### Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 7.1.2 ? ... OK (7.1.2)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by gitlab:root, or gitlab:gitlab?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
2/3 ... ok
2/4 ... ok
3/5 ... ok
3/6 ... ok
7/8 ... ok
7/9 ... ok
3/12 ... ok
3/13 ... ok
3/14 ... ok
3/15 ... ok
3/17 ... ok
7/18 ... ok
2/21 ... ok
16/22 ... repository is empty
16/23 ... repository is empty
7/24 ... ok
7/26 ... ok
3/28 ... ok
3/29 ... 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

Reply by email is disabled in config/gitlab.yml
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/3 ... yes
2/4 ... yes
3/5 ... yes
3/6 ... yes
7/8 ... yes
7/9 ... yes
3/12 ... yes
3/13 ... yes
3/14 ... yes
3/15 ... yes
3/17 ... yes
7/18 ... yes
2/21 ... yes
16/22 ... yes
16/23 ... yes
7/24 ... yes
7/26 ... yes
3/28 ... yes
3/29 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.3.7)
Git version >= 2.9.5 ? ... yes (2.16.4)
Git user has default SSH configuration? ... yes
Active users: ... 15

Checking GitLab ... Finished
Edited by Stan Hu