Completed 500 Internal Server Error, Gitlab::Git::CommandError (13:cannot skip to offset: offset 40 is invalid: <nil>.)

Hi.
From time to time, we began to find errors in the logs like this:

Completed 500 Internal Server Error in 206ms (ActiveRecord: 42.8ms | Elasticsearch: 0.0ms | Allocations: 8324)
Started POST "/api/v4/internal/allowed" for 127.0.0.1 at 2021-05-19 12:41:23 +0500

Gitlab::Git::CommandError (13:cannot skip to offset: offset 40 is invalid: <nil>.):

lib/gitlab/git/wraps_gitaly_errors.rb:15:in `rescue in wrapped_gitaly_errors'
lib/gitlab/git/wraps_gitaly_errors.rb:6:in `wrapped_gitaly_errors'
lib/gitlab/git/repository.rb:354:in `log'
lib/gitlab/git/commit.rb:47:in `where'
app/models/repository.rb:158:in `commits'
lib/gitlab/metrics/instrumentation.rb:160:in `block in commits'
lib/gitlab/metrics/method_call.rb:27:in `measure'
lib/gitlab/metrics/instrumentation.rb:160:in `commits'
app/controllers/projects/commits_controller.rb:77:in `set_commits'
app/controllers/application_controller.rb:536:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:341:in `allow_ref_name_caching'
app/controllers/application_controller.rb:535:in `allow_gitaly_ref_name_caching'
app/controllers/application_controller.rb:485:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:476:in `set_session_storage'
lib/gitlab/i18n.rb:73:in `with_locale'
lib/gitlab/i18n.rb:79:in `with_user_locale'
app/controllers/application_controller.rb:470:in `set_locale'
app/controllers/application_controller.rb:463:in `block in set_current_context'
lib/gitlab/application_context.rb:70:in `block in use'
lib/gitlab/application_context.rb:70:in `use'
lib/gitlab/application_context.rb:27:in `with_context'
app/controllers/application_controller.rb:454:in `set_current_context'

Please tell me how to diagnose this error? What logs or settings to watch?

GitLab 13.11.3, CentOS Linux release 7.7.1908 (Core).

Thank you.

It seems to be a bug in Gitaly. Have you raised an issue to GitLab? Issues · GitLab.org / GitLab · GitLab

Hi. Thank you. The issue was created: Completed 500 Internal Server Error, cannot skip to offset: offset 40 is invalid (#331491) · Issues · GitLab.org / GitLab · GitLab