LoadError: No such file to load -- ee/app/replicators/geo/package_file_replicator.rb
#202044 (closed) described an issue in which a Geo constant was not loaded. In !24425 (merged) an attempt was made to fix this by explicitly requiring the file.
In the ops migration job https://ops.gitlab.net/gitlab-com/gl-infra/deployer/-/jobs/886789 we ran into the following error:
fatal: [deploy-01-sv-gstg.c.gitlab-staging-1.internal]: FAILED! => changed=true
cmd: SKIP_POST_DEPLOYMENT_MIGRATIONS=1 /usr/bin/gitlab-rake db:migrate
delta: '0:00:27.041161'
end: '2020-02-05 12:46:12.717282'
msg: non-zero return code
rc: 1
start: '2020-02-05 12:45:45.676121'
stderr: |-
rake aborted!
LoadError: No such file to load -- ee/app/replicators/geo/package_file_replicator.rb
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/zz_metrics.rb:163:in `block in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>
It seems that the path here may not be correct, or perhaps the file somehow does not exist.
An explicit require in theory should not be need if the ee/app/replicators
directory is in the autoload path and the class is defined in the correct namespace. It might be worth investigating that instead of using explicit requires.