Gitlab Transfer Project Error


I used the Transfer project functionality as shown on the picture below to transfer a project to some other user at which point an error 500 occurred.

Now, whenever accessing the “Admin area” tab (as well as some other functionalities) in the Gitlab web interface, a 500 error occurs, which prints the following into the log file:

    Started GET "/admin" for at 2015-03-06 13:47:10 +0100
Processing by Admin::DashboardController#index as HTML
Completed 500 Internal Server Error in 52ms

ActionView::Template::Error (undefined method `+' for nil:NilClass):
    112:       %hr
    113:       - @projects.each do |project|
    114:         %p
    115:           = link_to project.name_with_namespace, [:admin, project], class: 'str-truncated'
    116:           %span.light.pull-right
    117:             #{time_ago_with_tooltip(project.created_at)}
  app/models/project.rb:444:in `name_with_namespace'
  app/views/admin/dashboard/index.html.haml:115:in `block in _app_views_admin_dashboard_index_html_haml__112669828022108010_128410640'
  app/views/admin/dashboard/index.html.haml:113:in `_app_views_admin_dashboard_index_html_haml__112669828022108010_128410640'

This is a fresh copy of the latest Gitlab version, where I’ve imported the Mysql data as well as copied over the reposotories/ directory. Can somebody tell me how to identify what is going on and how to fix the issue. I’m guessing that there’s some inconsistent state in the DB/Repositories, which is causing the problems, but I’m not sure how to identify the issue and possibly fix it.

Another problem is that I don’t remember, which repository I tried to assign to another user, which makes the problem slightly harder to debug.

Any suggestions on how to identify and correct the problem are most welcome.

Thank you

If it is possible, take a backup of your previous installation and then restore it in the newer. I don’t understand, didn’t you just upgrade? Since you already had a db and repositories that means there was an older GitLab, no?


Yes, I’ve had an older version of Gitlab installed and then I’ve transferred the project, which caused this issue. Afterwards, I through an upgrade will solve the problem, so I upgraded to the newest Gitlab version, but the problem persists even in this version.

If I try to restore an older Gitlab version, I get the following error:

git@host:~/gitlab$ bundle exec rake gitlab:backup:restore RAILS_ENV=production
Unpacking backup … done
GitLab version mismatch:
Your current GitLab version (7.8.2) differs from the GitLab version in the backup!
Please switch to the following version and try again:
version: 6.7.3

Hint: git checkout v6.7.3

Any thoughts? I would much rather solve the problem by manually deleting a stale reference from the mysql database than install 6.7.3 again, restore and upgrade again.

Any ideas what I would have to change in the database in order to fix the problem. I guess I would have to find the project that was transfered and assign the corrent owner to that project, which would possibly eliminate a stale reference.

The problem was happening because the namespace_id was incorrectly set and pointing to the wrong namespace. First I had to identify which project was causing problems by removing one reference at a time by running. After being able to open the /projects, the ID of the project was identifies, which was 11 in my case.

DELETE from projects where id=11;

Of course after DELETing entries in the DB, you have to have a backup and restore the DB after you’ve identified the erroneous entry. After restoring the DB, you have to update the namespace to the correct ID, which was done with the following query.

UPDATE projects SET namespace_id=1 WHERE id=11;

Problem solved.