A Quick Note on GitLab 7.4 and Remote Storage Backups

So, 7.4 came out today and among other things, includes sending backups to remote storage like  Amazon S3 storage.

Here’s a quick tip or two about getting it setup.

Example from my gitlab.yml:

## Backup settings
path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
keep_time: 604800 # default: 0 (forever) (in seconds)
# Fog storage connection settings, see http://fog.io/storage/ .
provider: AWS
region: us-east-1
aws_access_key_id: _Access-ID-ID_
aws_secret_access_key: '_Access_KEY_'
# The remote 'directory' to store your backups. For S3, this would be the bucket name.
remote_directory: 'unique_backup_bucket'

I kept hitting 2 walls when getting things working.

First, the region. In the docs they use a EU region. I couldn’t recall the region for the default USA region. Here are the S3 regions.

Second, was whitespace. .yml files are picky.

Settingslogic::MissingSetting: Missing setting 'remote_directory' in 'upload' section in 'backup' section in /home/git/gitlab/config/gitlab.yml
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:189:in `missing_key'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:117:in `method_missing'
/home/git/gitlab/lib/backup/manager.rb:33:in `upload'
/home/git/gitlab/lib/backup/manager.rb:29:in `pack'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:15:in `block (3 levels) in '
Tasks: TOP => gitlab:backup:create
(See full trace by running task with --trace)

This means you have extra whitespace before the remote_directory stanza. It should align with the connection stanza.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: