Backup rake task fails

I suppose that this must be something stupid but I am unable to run this task, please help! How can I get more information from this process?

    /home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production --trace
    ** Invoke gitlab:backup:create (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Execute gitlab:backup:create
    ** Invoke gitlab:backup:db:create (first_time)
    ** Invoke environment
    ** Execute gitlab:backup:db:create
    Dumping database ...
    Dumping PostgreSQL database gitlabhq_production ... [FAILED]
    Backup failed
    /home/git/gitlab# sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

    Checking Environment ...
    Git configured for git user? ... yes
    Checking Environment ... Finished
    Checking GitLab Shell ...
    GitLab Shell version >= 2.5.4 ? ... OK (2.5.4)
    Repo base directory exists? ... yes
    Repo base directory is a symlink? ... no
    Repo base owned by git:git? ... yes
    Repo base access is drwxrws---? ... yes
    Satellites access is drwxr-x---? ... yes
    hooks directories in repos are links: ...
    Running /home/git/gitlab-shell/bin/check
    Check GitLab API access: OK
    Check directories and files:
            /home/git/repositories/: OK
            /var/opt/gitlab/.ssh/authorized_keys: OK
    Test redis-cli executable: redis-cli 2.8.4
    Send ping to redis server: PONG
    gitlab-shell self-check successful
    Checking GitLab Shell ... Finished
    Checking Sidekiq ...

    Running? ... yes
    Number of Sidekiq processes ... 1
    Checking Sidekiq ... Finished

Wait. In the check command I see

Check directories and files:
    /home/git/repositories/: OK
    /var/opt/gitlab/.ssh/authorized_keys: OK

Aren’t you using a manual installation? How come you have /var/opt/gitlab/.ssh/authorized_keys in there? Also the output is not full.

Sorry, I’ve left the end of the output but now it can be found here:
I don’t know how the keys file gone into /var/opt/gitlab. I’ve done a manual installation by the method at There are three keys in the file and all of them points to /home/git/gitlab-shell/bin/gitlab-shell
Should I move them somewhere else?

Anyway, thanks for your help!

It is still not working. :frowning:
How can I get detailed information about what went wrong during the Dumping PostgreSQL database gitlabhq_production ... [FAILED] process?
Is it a postgresql dump command that wants to run? According to the postgresql documentation it needs the database to be offline but I don’t think that this gives such an error.

I’ve found lib/backup/database.rb and that contains pg_dump as db backup method. I’ve tried pg_dump manually by the command sudo -u git pg_dump -h /var/run/postgresql gitlabhq_production > backup and that creates the file as expected. (Altough I’m curious whether this file will be usable or not in emergency according to the postgresql documentation.) So the problem should be the command before the pg_dump that is: pg_env that is likely to be:

def pg_env
  ENV['PGUSER']     = config["username"] if config["username"]
  ENV['PGHOST']     = config["host"] if config["host"]
  ENV['PGPORT']     = config["port"].to_s if config["port"]
  ENV['PGPASSWORD'] = config["password"].to_s if config["password"]

My config looks like this:

  adapter: postgresql
  encoding: unicode
  database: gitlabhq_production
  pool: 10
  # username: git
  # password:
  # host: localhost
  # port: 5432
  # socket: /tmp/postgresql.sock

What can go wrong with this?