All Sidekiq jobs fail when using AWS Elasticache Redis 6.0.5

Summary

When using AWS Elasticache Redis 6.0.5 all Sidekiq jobs fail. A very large number of errors will be logged by Sidekiq along these lines:

Error fetching job: ERR unknown command `resque:gitlab:queue:irker`, with args beginning with:"

This appears to be limited to Elasticache Redis 6, I encountered no issues when using a local Redis 6.0.6, and Elasticache Redis 5 also functions as expected.

Steps to reproduce

  1. Install Omnibus GitLab on an EC2 instance
  2. Create an Elasticache Redis cluster (NOT in cluster mode), version 6.0.5
  3. Configure GitLab to use the Elasticache cluster
  4. Errors will immediately begin to be logged in by Sidekiq, all background jobs fail

What is the current bug behavior?

Background jobs do not function when using Elasticache Redis 6.

What is the expected correct behavior?

Sidekiq functions normally with Elasticache 6.

Relevant logs and/or screenshots

{"severity":"ERROR","time":"2020-11-12T00:04:38.832Z","message":"Error fetching job: ERR unknown command `resque:gitlab:queue:irker`, with args beginning with:"}
{"severity":"ERROR","time":"2020-11-12T00:04:38.870Z","message":"Error fetching job: ERR unknown command `resque:gitlab:queue:cronjob:gitlab_usage_ping`, with args beginning with:"}
{"severity":"ERROR","time":"2020-11-12T00:04:38.873Z","message":"Error fetching job: ERR unknown command `resque:gitlab:queue:pipeline_default:ci_trigger_downstream_subscriptions`, with args beginning with:"}
{"severity":"ERROR","time":"2020-11-12T00:04:38.876Z","message":"Error fetching job: ERR unknown command `resque:gitlab:queue:cronjob:requests_profiles`, with args beginning with:"}
{"severity":"ERROR","time":"2020-11-12T00:04:38.878Z","message":"Error fetching job: ERR unknown command `resque:gitlab:queue:pipeline_default:pipeline_notification`, with args beginning with:"}

Here's the chain of events for the failed requests:

GitLab sends a SET request to create a lock:

*6
$3
set
$43
resque:gitlab:reliable-fetcher-cleanup-lock
$1
1
$2
EX
$4
3600
$2
NX

Redis returns $-1, indicating that the SET was not successful, presumably because the key already exists.

The GitLab client makes a initial, successful, BRPOP call:

*348
$5
brpop
$75
resque:gitlab:queue:cronjob:analytics_instance_statistics_count_job_trigger
...
resque:gitlab:queue:project_update_repository_storage
$1
2

Redis return a nil array *-1, and GitLab immediately makes a second BRPOP request:

*348
$5
brpop
$48
resque:gitlab:queue:invalid_gpg_signature_update
...
resque:gitlab:queue:incident_management:incident_management_pager_duty_process_incident
$1
2

This time Redis returns 399 lines of errors, corresponding exactly with the last 399 lines of the second BRPOP:

-ERR unknown command `resque:gitlab:queue:pages_domain_ssl_renewal`, with args beginning with: 
-ERR unknown command `$44`, with args beginning with: 
-ERR unknown command `resque:gitlab:queue:project_daily_statistics`, with args beginning with: 
-ERR unknown command `$55`, with args beginning with: 
...
-ERR unknown command `resque:gitlab:queue:incident_management:incident_management_pager_duty_process_incident`, with args beginning with: 
-ERR unknown command `$1`, with args beginning with: 
-ERR unknown command `2`, with args beginning with: 

Full pcap attached redis-pcap.tar.gz, see stream 9 for an example of this behavior.

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:         Ubuntu 20.04
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   2.6.6p146
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  5.0.9
Git Version:    2.28.0
Sidekiq Version:5.2.9
Go Version:     unknown

GitLab information
Version:        13.5.3-ee
Revision:       b9d194b6b91
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     11.9
Elasticsearch:  no
Geo:            no
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        13.11.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.11.0 ? ... OK (13.11.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.24.0 ? ... yes (2.28.0) Git user has default SSH configuration? ... yes Active users: ... 1 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 6.x - 7.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

/cc @joshlambert

Edited by Will Chandler (ex-GitLab)