[www-apps/gitlab-13.12.1] emerge --config fails because configs in /opt/gitlab/gitlab/config aren't synced from /etc/gitlab/ before first start
The symptom of this is:
# emerge --config gitlab
Configuring pkg...
* Checking configuration files ...
* Set the Administrator/root password: *
* Set the Administrator/root email: <redacted>
* Initializing database ...
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes
Dropped database 'gitlabhq_production'
Created database 'gitlabhq_production'
psql:/opt/gitlab/gitlab/db/structure.sql:9: NOTICE: extension "btree_gist" already exists, skipping
psql:/opt/gitlab/gitlab/db/structure.sql:11: NOTICE: extension "pg_trgm" already exists, skipping
== Seed from /opt/gitlab/gitlab/db/fixtures/production/001_application_settings.rb
Creating the default ApplicationSetting record.
== Seed from /opt/gitlab/gitlab/db/fixtures/production/002_admin.rb
Administrator account created:
login: root
password: <redacted>
rake aborted!
Redis::CannotConnectError: Error connecting to Redis on localhost:6382 (Errno::ECONNREFUSED)
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:362:in `rescue in establish_connection'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:343:in `establish_connection'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis/client.rb:125:in `call'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis.rb:806:in `block in set'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/redis-4.1.3/lib/redis.rb:804:in `set'
/opt/gitlab/gitlab/lib/gitlab/exclusive_lease.rb:78:in `block in try_obtain'
/opt/gitlab/gitlab/lib/gitlab/redis/wrapper.rb:18:in `block in with'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
/opt/gitlab/gitlab/lib/gitlab/redis/wrapper.rb:18:in `with'
/opt/gitlab/gitlab/lib/gitlab/exclusive_lease.rb:77:in `try_obtain'
/opt/gitlab/gitlab/app/models/concerns/update_highest_role.rb:28:in `block in update_highest_role'
/opt/gitlab/gitlab/lib/after_commit_queue.rb:29:in `instance_eval'
/opt/gitlab/gitlab/lib/after_commit_queue.rb:29:in `run_after_commit_or_now'
/opt/gitlab/gitlab/app/models/concerns/update_highest_role.rb:24:in `update_highest_role'
/opt/gitlab/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/callbacks.rb:428:in `block in make_lambda'
&c. finally
* ERROR: www-apps/gitlab-13.12.1::gitlab failed (config phase):
* failed to run rake gitlab:setup
*
* Call stack:
* ebuild.sh, line 127: Called pkg_config
* environment, line 2601: Called pkg_config_initialize
* environment, line 2760: Called die
* The specific snippet of code:
* ${BUNDLE} exec rake gitlab:setup RAILS_ENV=${RAILS_ENV} GITLAB_ROOT_PASSWORD=${pw} GITLAB_ROOT_EMAIL=${email}" || die "failed to run rake gitlab:setup"
*
* If you need support, post the output of `emerge --info '=www-apps/gitlab-13.12.1::gitlab'`,
* the complete build log and the output of `emerge -pqv '=www-apps/gitlab-13.12.1::gitlab'`.
* The complete build log is located at '/var/tmp/portage/www-apps/gitlab-13.12.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/www-apps/gitlab-13.12.1/temp/environment'.
* Working directory: '/var/tmp/portage/www-apps/gitlab-13.12.1/homedir'
* S: '/var/tmp/portage/www-apps/gitlab-13.12.1/work/gitlab-13.12.1'
worked-around by:
cp /opt/gitlab/gitlab/resque.yml.example /etc/gitlab/resque.yml
cp /etc/gitlab/resque.yml /opt/gitlab/gitlab/config/