Repository mirroring: 2:NoMethodError: undefined method 'id' for nil:NilClass

Summary

Repository mirroring fails with error 2:NoMethodError: undefined method 'id' for nil:NilClass on selfhosted Gitlab Community Edition 12.0.3.

Steps to reproduce

  1. Have 2 Gitlab instances server 1 and server 2.
  2. Activate 2FA Authentication on server 2.
  3. Create the same user testuser on both instances.
  4. Create a Personal Access Token with scope api on server 2 for testuser.
  5. Create a new project testproject with testuser on both Gitlab instances. On server 1 go to project settings > Repository > Mirroring repositories and use the following settings:

What is the expected correct behavior?

Repository testproject should be mirrored from server 1 to server 2.

Edited by gitlabuser