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
  backup:
  path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
  keep_time: 604800 # default: 0 (forever) (in seconds)
  upload:
  # Fog storage connection settings, see http://fog.io/storage/ .
    connection:
      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.

A Quick Fix for a minor GitLab GUI Error

So I recently encountered a weird error in the Admin Dashboard of GitLab:

No GitLab-Shell Version

It wasn’t a gitlab-shell error, the bin/check script ran fine. Git and Ruby at accepted versions from the rake gitlab:check command but it did show an error:

GitLab Shell version &gt;= 1.7.9 ? ... <span style="color: #ff0000;">FAIL. Please update gitlab-shell to 1.7.9 from Unknown</span>

The fix is simple, a wrong path in gitlab.yml:

187   ## GitLab Shell settings
188     gitlab_shell:
189     path: /wrong/git/gitlab-shell/

(Some of the machine I administer use a different /home path.)

So, simply fix the path, restart gitlab and things will work.

Screenshot 2014-01-30 12.34.33

rake gitlab:check complains about git version

With the 5.2 version of gitlab, the

bundle exec rake gitlab:check RAILS_ENV=production

command complains about the current distro’s version of git:

Your git bin path is “/usr/bin/git”
Git version >= 1.7.10 ? … no
Try fixing it:
Update your git to a version >= 1.7.10 from 1.7.9
Please fix the error above and rerun the checks.

Checking GitLab … Finished

Here’s how to compile from source to a local (or system wide) location.

Continue reading “rake gitlab:check complains about git version”