Geo: `checksummable?` method fails if file is not present
The project import fails if LFS files are present and Geo is enabled. This happens because we initially create the database record then update it with the downloaded file path.
The method checksummable?
has to return false instead. The fix is to better handle the absent files as well as write a shared example spec and include it for every SSF blob replicator.
NoMethodError undefined method `exists?' for nil:NilClass ["/opt/gitlab/embedded/service/gitlab-rails/ee/app/models/concerns/geo/blob_replicator_strategy.rb:98:in `file_exists?'"
"/opt/gitlab/embedded/service/gitlab-rails/ee/app/models/concerns/geo/blob_replicator_strategy.rb:119:in `checksummable?'"
"/opt/gitlab/embedded/service/gitlab-rails/ee/app/models/concerns/geo/verifiable_replicator.rb:282:in `should_primary_verify_after_save?'"
"/opt/gitlab/embedded/service/gitlab-rails/ee/app/models/concerns/geo/verifiable_replicator.rb:218:in `after_verifiable_update'"
"/opt/gitlab/embedded/service/gitlab-rails/ee/app/models/concerns/geo/blob_replicator_strategy.rb:35:in `handle_after_create_commit'"
"/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/replicable_model.rb:11:in `block (2 levels) in <module:ReplicableModel>'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:427:in `instance_exec'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:427:in `block in make_lambda'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:260:in `block in conditional'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:516:in `block in invoke_after'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:516:in `each'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:516:in `invoke_after'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:107:in `run_callbacks'"
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.1/lib/active_support/callbacks.rb:824:in `_run_commit_callbacks'"
Workaround
Patch !80280 (merged) using https://about.gitlab.com/handbook/support/workflows/patching_an_instance.html or disable LFS file verification through Feature.disable(:geo_lfs_object_verification)