Skip to content

Geo: Fix type error in Geo:EventWorker

Summary

Sentry on staging-ref is reporting that Sidekiq/Geo::EventWorker is crashing with TypeError - no implicit conversion of String into Array.

This started on Sept 13, the day #514251 (closed) was closed.

The new implementation for selective sync by organization seems to have introduced this,

What is the current bug behavior?

Sidekiq/Geo::EventWorker is crashing.

What is the expected correct behavior?

Sidekiq/Geo::EventWorker completes execution.

Relevant logs and/or screenshots

See https://new-sentry.gitlab.net/organizations/gitlab/issues/1921807/events/5a41368ede604c9daa9348a52746eb7c/ for a full stacktrace.

Possible fixes

In selective_sync.rb:

@@ -14,7 +14,7 @@ def selective_sync?
       # If someone enables the FF, tries selective sync by org, and finally disables the FF:
       # 1. We won't raise unknown selective sync type error
       # 2. But we will assume that they want selective sync to be disabled (sync everything).
-      types -= 'organizations' unless ::Gitlab::Geo.geo_selective_sync_by_organizations_enabled?
+      types -= ['organizations'] unless ::Gitlab::Geo.geo_selective_sync_by_organizations_enabled?
 
       types.include?(selective_sync_type)
     end

It might be worth adding a test case as well?

Patch release information for backports

No need for a backport as 18.5 is not out yet. ⬅️ this appears to be wrong, and the bug made its way into 18.4 just before cutoff.

So this fix needs to be backported to 18.4.

Edited by 🤖 GitLab Bot 🤖