`bundle exec rake spec` raises error in `geo/database_tasks.rb`
I am getting the following error when running bin/rake spec
in gitlab
project.
$ bundle exec rake spec
Failed to open config/database_geo.yml. Consult the documentation on how to set up GitLab Geo.
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/path/to/gitlab/ee/lib/gitlab/geo/database_tasks.rb:191:in `set_db_env'
/path/to/gitlab/ee/lib/gitlab/geo/database_tasks.rb:187:in `ensure in with_geo_db'
/path/to/gitlab/ee/lib/gitlab/geo/database_tasks.rb:187:in `with_geo_db'
/path/to/gitlab/ee/lib/gitlab/geo/database_tasks.rb:144:in `purge'
/path/to/gitlab/ee/lib/tasks/geo.rake:154:in `block (4 levels) in <main>'
/path/to/gitlab/ee/lib/tasks/geo.rake:144:in `block (4 levels) in <main>'
Tasks: TOP => geo:db:test:load => geo:db:test:purge
It does not happen when running specific spec task bin/rake spec:api
$ bundle exec rake spec:api
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
==> Setting up Gitaly...
Checking gitaly-ruby Gemfile...
Checking gitaly-ruby bundle...
The Gemfile's dependencies are satisfied
Trying to connect to gitaly: ........ OK
Gitaly set up in 1.593543 seconds...
==> Setting up GitLab Elasticsearch Indexer...
GitLab Elasticsearch Indexer set up in 0.000527 seconds...
GDK config geo.enabled
is set to false
and Gitlab::Geo.enabled?
in rails console
is also false
.
From slack: https://gitlab.slack.com/archives/C2Z9A056E/p1578885213110100
/cc @ashmckenzie
Edited by Albert Salim