I have a standard Omnibus installation. Both gitlab and gitlab-ci run on the same internal server. I updated from 7.12.2 to 8.0.2, but am stuck migrating CI per http://doc.gitlab.com/ce/migrate_ci_to_ce/README.html on Step II. 1. Database encryption key:
tcsh 3% sudo gitlab-ci-rake backup:show_secretsMissing `secret_key_base` or `db_key_base` for 'production' environment. The secrets will be generated and stored in `config/secrets.yml`rake aborted!Errno::EACCES: Permission denied @ rb_sysopen - config/secrets.yml/opt/gitlab/embedded/service/gitlab-ci/config/initializers/secret_token.rb:39:in `initialize'.../opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.1.12/lib/rails/application.rb:276:in `require_environment!'/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.1.12/lib/rails/application.rb:405:in `block in run_tasks_blocks'Tasks: TOP => backup:show_secrets => environment(See full trace by running task with --trace)
The rake backup:show_secrets command appears to be available.
tcsh 4% sudo gitlab-ci-rake -T | grep backuprake backup:create # GITLAB | Create a backup of the GitLab CI databaserake backup:restore # GITLAB | Restore a previously created backuprake backup:show_secrets # GITLAB | Show database secrets
I am getting a similar error message re: config/secrets for Step II. Moving Data 2. SQL data and build traces.
tcsh 6% sudo gitlab-ci-rake backup:createMissing `secret_key_base` or `db_key_base` for 'production' environment. The secrets will be generated and stored in `config/secrets.yml`rake aborted!Errno::EACCES: Permission denied @ rb_sysopen - config/secrets.yml...
I removed /opt/gitlab/embedded/service/gitlab-ci/config/initializers/secret_token.rb.
Step II 1. Provided a reasonable response. As instructed, I copied gitlab_rails['db_key_base'] = nil to my /etc/gitlab/gitlab.rb file and ran sudo gitlab-ctl reconfigure. The instructions don't say to run reconfigure, but seemed logical.
Step II 2. Gave this error message:
tcsh 24% sudo gitlab-ci-rake backup:createApplying final database migrations ...rake aborted!PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'.../opt/gitlab/embedded/service/gitlab-ci/lib/tasks/backup.rake:9:in `block (2 levels) in <top (required)>'Tasks: TOP => db:migrate(See full trace by running task with --trace)
@marin I would love to get this resolved, if you have any suggestions. postgresql is up (sudo gitlab-ctl status) and both gitlab (sudo more /opt/gitlab/embedded/service/gitlab-rails/config/database.yml) and gitlab-ci (sudo more /opt/gitlab/embedded/service/gitlab-ci/config/database.yml) use port 5432. Could it have something to do with upgrading from 7.12.2, rather than 7.14, to 8.0.2?
@ayufan I am waiting to see if I can find a solution, so I don't have to recreate anything manually. As I mentioned above, I am stuck at Step II 2. SQL Data and build traces. I need to generate an "8.0" backup of my gitlab-ci data so I can eventually execute sudo gitlab-rake ci:migrate, but am getting errors.
tcsh 24% sudo gitlab-ci-rake backup:createApplying final database migrations ...rake aborted!PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'.../opt/gitlab/embedded/service/gitlab-ci/lib/tasks/backup.rake:9:in `block (2 levels) in <top (required)>'Tasks: TOP => db:migrate(See full trace by running task with --trace)
/opt/gitlab/embedded/service/gitlab-ci/builds doesn't exist. /opt/gitlab/embedded/service/gitlab-ci does. I could create the builds directory. Is it okay to run sudo gitlab-ci-rake backup:create again?
I am upgrading from 7.9 to 8.0.3 and I ran into the same error. (On the GitLab CE upgrade page I saw no notice that I should upgrade to 7.14 first and now it's too late to do that.)
Some have a _build.html.haml, show.html.haml and index.html.haml file. And there is '/var/opt/gitlab/gitlab-ci/builds' that is empty. Should I create a symlink to some of them or just create an empty directory as Celia suggested?
I see, but the upgrade to gitlab-ce 8.0.3 was successful and the gitlab-ci package has been removed, I do not have it any more. Not sure how I could get back to 7.14 now. Can I just download the gitlab-ci 7.14 package and install it? Would not it conflict with gitlab-ce 8.0.3?
I ran the chown command from the toubleshooting guide, I get this:
[root@cmiclab ~]# chown -R gitlab-ci:gitlab-ci /var/opt/gitlab/gitlab-ci/builds[root@cmiclab ~]# gitlab-ci-rake backup:createApplying final database migrations ... doneDumping database ... Dumping PostgreSQL database gitlab_ci_production ... [DONE]doneDumping builds ... rake aborted!Errno::ENOENT: No such file or directory @ realpath_rec - /opt/gitlab/embedded/service/gitlab-ci/builds/opt/gitlab/embedded/service/gitlab-ci/lib/backup/builds.rb:6:in `realpath'/opt/gitlab/embedded/service/gitlab-ci/lib/backup/builds.rb:6:in `initialize'/opt/gitlab/embedded/service/gitlab-ci/lib/tasks/backup.rake:17:in `new'/opt/gitlab/embedded/service/gitlab-ci/lib/tasks/backup.rake:17:in `block (2 levels) in <top (required)>'Tasks: TOP => backup:create(See full trace by running task with --trace)[root@cmiclab ~]#
I suspect we ought to create /opt/gitlab/embedded/service/gitlab-ci/builds, and rerun gitlab-ci-rake backup:create. Perhaps that directory was created at some point between 7.12 and 8.0.2. Do you want to try @mespak?
I was incorrect about the removed gitlab-ci package, as GitLab CI is integrated in the gitlab-ce package for about a year now. But I'm still not sure how I could get back to 7.14 or 7.9. I could restore the backup but then I would loose changes from today, e.g. wiki pages.
@celiao
I could, I'm just afraid that the contents of some of the builds folder should be migrated and they won't.
So perhaps it's okay to have /opt/gitlab/embedded/service/gitlab-ci/builds be empty.
Is /opt/gitlab/embedded/service/gitlab-rails/builds empty on your system @mespak?
that tells me that /opt/gitlab/embedded/service/gitlab-ci/builds should be a symlink to node['gitlab']['gitlab-ci']['builds_directory'] that is /var/opt/gitlab/gitlab-ci/builds.
When you created the CI backup with gitlab-ci-rake backup:create, you mentioned no file was created (or at least remains) in gitlab-ci/builds. Was a CI backup file created anywhere?
When you created the GitLab backup with gitlab-rake gitlab:backup:create, once the permissions were corrected, was a backup created in /var/opt/gitlab/backups?
No. The gitlab-ci backup was created under /opt/gitlab/embedded/service/gitlab-ci/tmp/backups, and the gitlab-ce backup was created where I configured it in /etc/gitlab/gitlab.rb by gitlab_rails['backup_path'].
The gitlab-ci backup command printed the path at the end. The gitlab-ce command printed just the file name.
It sounds like you should be ready to go, now that the permissions are corrected and the backups are created. Have you completed the rest of the steps and can you see your pre-8.0.3 CI builds/results?
I didn't need to change any permissions.
Thanks for joining in the conversation @mespak!
I thought I might need to add something to /etc/gitlab/gitlab.rc to address setting host: '/var/opt/gitlab/postgresql' in /opt/gitlab/embedded/service/gitlab-ci/config/database.yml, but I ran sudo gitlab-ctl reconfigure and host: was still set in database.yml.
Now that directory (/var/opt/gitlab/gitlab-ci/builds) is owned by 'git', not 'gitlab-ci'. It has 700 permissions and the "gitlab-rake gitlab:backup:create SKIP=repositories,uploads" command succeeds. I did not change the owner manually, but it got changed somehow at a later step of the upgrade.
I have to think that the troubleshooting guide is wrong and the chown command should look like this: