500 on saving mirroring changes

Summary

In GitLab EE 9.3.6, it seems the remove_mirror_repository_reference method in the EE::Project model is calling EE::Repository::MIRROR_REMOTE instead of what I think should be Repository::MIRROR_REMOTE. This is giving seemingly random users on an instance a 500 error after saving changes to their mirroring Pull options.

Steps to reproduce

Unable to reproduce locally in 9.3.5 or 9.3.6

What is the current bug behavior?

Users on a customer's instance have gone to their project settings and attempt to add their username/password/token to the remote url. Some users are able to successfully make the change and others get a 500 page and the below log error.

What is the expected correct behavior?

It should be a successful change.

Relevant logs and/or screenshots

==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 500 Internal Server Error in 66ms (ActiveRecord: 6.5ms | Elasticsearch: 0.0ms)

NameError (uninitialized constant EE::Repository::MIRROR_REMOTE):
  app/models/ee/project.rb:287:in `remove_mirror_repository_reference'
  app/controllers/projects/mirrors_controller.rb:15:in `update'
  lib/gitlab/i18n.rb:39:in `with_locale'
  lib/gitlab/i18n.rb:45:in `with_user_locale'
  app/controllers/application_controller.rb:307:in `set_locale'
  lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb:16:in `call'
  lib/gitlab/middleware/multipart.rb:93:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  lib/gitlab/middleware/go.rb:16:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/readonly_geo.rb:30:in `call'
  lib/gitlab/request_context.rb:18:in `call'

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: RedHatEnterpriseServer 6.8 Proxy: https_proxy: MZKXK:*******@xxxxxx:8080 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.13.0 Sidekiq Version:5.0.0 Go Version: unknown GitLab information Version: 9.3.6-ee Revision: 7046350 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.3 URL: https://xxxxxxxx HTTP Clone URL: https://xxxxxx/some-group/some-project.git SSH Clone URL: git@xxxxxx:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no GitLab Shell Version: 5.1.1 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Possible fixes

This constant doesn't exist at EE::Repository::MIRROR_REMOTE but at Repository::MIRROR_REMOTE

  • https://gitlab.com/gitlab-org/gitlab-ee/blob/v9.3.6-ee/app/models/repository.rb#L18
  • https://gitlab.com/gitlab-org/gitlab-ee/blob/v9.3.6-ee/app/models/ee/repository.rb

The customer's ticket: https://gitlab.zendesk.com/agent/tickets/80159

Edited Jul 14, 2017 by Harish Ramachandran
Assignee Loading
Time tracking Loading