Error 500 after having deleted a user with issues assigned #1092

Closed
skrew opened this Issue Jul 14, 2012 · 5 comments

Comments

Projects
None yet
5 participants

skrew commented Jul 14, 2012

Hi,

On dashboard or project home page, i got error 500:

 Started GET "/" for xx.xx.xx.xx at 2012-07-14 20:41:54 +0200
 Processing by DashboardController#index as HTML
   Rendered events/_event_issue.html.haml (4.2ms)
   Rendered events/_event.html.haml (4.6ms)
   Rendered dashboard/index.html.haml within layouts/application (11.5ms)
 Completed 500 Internal Server Error in 19ms

 ActionController::RoutingError (No route matches {:action=>"show", :controller=>"issues", :project_id=>#<Project id: 3, name: "xxxx", path: "xxxx", description: nil, created_at: "2012-07-01 13:29:41", updated_at: "2012-07-01 13:29:41", private_flag: true, code: "xxxx", owner_id: 1, default_branch: "master", issues_enabled: true, wall_enabled: true, merge_requests_enabled: true, wiki_enabled: true>, :id=>nil}):
   app/views/events/_event_issue.html.haml:5:in `_app_views_events__event_issue_html_haml___529116932_93543190'
   app/views/events/_event.html.haml:4:in `_app_views_events__event_html_haml__675314158_94533910'
   app/views/dashboard/index.html.haml:13:in `_app_views_dashboard_index_html_haml___804243436_99355210'
   app/controllers/dashboard_controller.rb:12:in `index'

(NOT GOOD, SEE SOLUTION IN BOTTOM) Quick (and ugly) fix for getting gitlab back: remove these 2 lines in app/views/events/_event_issue.html.haml:

 = link_to project_issue_path(event.project, event.issue) do
   %strong= truncate event.issue_title

How to reproduce:

-> Create one user XX
-> Create an issue in a project for the new user XX
-> Delete user XX

EDIT: Confirmed, table events contain rows with target_id pointing to no-more existing entries in issues table. issues was deleted with user, but not events->issues

Same thing happened to me. Very huge issue as the dashboard doesn't work once you have this issue. Luckily mine only had 1 commit, so it was not a huge loss to remove the project and start again.

not fixed...

ActionController::RoutingError (No route matches {:action=>"show", :controller=>"issues", :project_id=>#<Project id: 28, name: "test", path: "test", description: nil, created_at: "2012-09-21 16:45:24", updated_at: "2012-09-21 16:45:24", private_flag: true, code: "test", owner_id: 1, default_branch: nil, issues_enabled: true, wall_enabled: true, merge_requests_enabled: true, wiki_enabled: true>, :id=>nil}):
  app/views/events/_event_issue.html.haml:5:in `_app_views_events__event_issue_html_haml__1563789901955902024_59495340'
  app/views/events/_event.html.haml:4:in `_app_views_events__event_html_haml___1334859804925125548_41606100'
  app/views/dashboard/index.html.haml:6:in `_app_views_dashboard_index_html_haml__780452767832663610_40944760'
  app/controllers/dashboard_controller.rb:9:in `index'

@ghost

ghost commented Oct 2, 2012

Administrators are also unable to admin projects created by a deleted user. Generates 500 error:

Started GET "/admin/projects/scratch2" for 127.0.0.1 at 2012-10-02 10:50:03 -0400
Processing by Admin::ProjectsController#show as HTML
  Parameters: {"id"=>"scratch2"}
  Rendered admin/projects/show.html.haml within layouts/admin (3.6ms)
Completed 500 Internal Server Error in 12ms

ActionView::Template::Error (undefined method `name' for nil:NilClass):
    31:       %b
    32:         Owner:
    33:     %td
    34:       = @admin_project.owner.name
    35:   %tr
    36:     %td
    37:       %b
  app/views/admin/projects/show.html.haml:34:in `_app_views_admin_projects_show_html_haml___1884749349554675229_312143360'
Contributor

koenpunt commented Dec 3, 2012

Issues created for a specific user are deleted when the user gets deleted, so that shouldn't cause any problems anymore. Also #1906 fixes the problem of administering projects created by deleted users because users can't be deleted if they are a owner of project.

@riyad this one can be closed.

Contributor

riyad commented Dec 4, 2012

@koenpunt Thanks.

@riyad riyad closed this Dec 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment