Error 500 when browsing *.md on restored GitLab

Version

We checked the problem in the following 2 versions:

  • GitLab CE 12.10.2 (omnibus version)
  • GitLab CE 12.10.10 (omnibus version)

Environment

We use the following two GitLabs:

  • [main gitlab]
  • [backup gitlab]

In addition, we backup and restore according to the official web page "Backing up and restoring GitLab".

Steps to reproduce

Maybe you can reproduce the problem, if you execute the following steps:

  1. Create a new project: http://[main gitlab]/[user or group]/[project]
    • Important: Do not click the [wiki] page in the new project.
  2. Create a new markdown page. We assume the URL is http://[main gitlab]/[user or group]/[project]/-/blob/master/README.md .
  3. Execute backup and restore commands.
  4. Browse the markdown page in the [backup gitlab] . From the assumption in the step 2., the URL is http://[backup gitlab]/[user or group]/[project]/-/blob/master/README.md .
  5. After that, you may get the 500 Error.

Log

When I browsed the URL http://[backup gitlab]/[user or group]/[project]/-/blob/master/README.md , the following error message appears in /var/log/gitlab/gitlab-rails/production.log .

In this trial, the configurations are as follows:

  • The Project Visibility is Public .
  • I broused that URL without login into [backup gitlab] .
Started GET "/[user or group]/[project]/blob/master/README.md" for 127.0.0.1 at 2020-06-07 12:59:06 +0900
Processing by Projects::BlobController#show as */*
  Parameters: {"namespace_id"=>"[user or group]", "project_id"=>"[project]", "id"=>"master/README.md"}
Completed 500 Internal Server Error in 226ms (ActiveRecord: 19.8ms | Elasticsearch: 0.0ms | Allocations: 35466)

ActionView::Template::Error (5:GetRepoPath: not a git repository '/var/opt/gitlab/git-data/repositories/[user or group]/[project].wiki.git'):
    1: - blob = local_assigns.fetch(:blob)
    2: - auxiliary_viewer = blob.auxiliary_viewer
    3: - if auxiliary_viewer && auxiliary_viewer.render_error.nil? && auxiliary_viewer.visible_to?(current_user)
    4:   .well-segment.blob-auxiliary-viewer
    5:     = render 'projects/blob/viewer', viewer: auxiliary_viewer

Best regards.