404 after deleted user
Closed
404 after deleted user
Created by: icholy
- Created user
foo
- Added user
foo
to projectmy-project
- Created a new issue and assigned it to
foo
- Closed issue as project master
- Deleted user
foo
Then the index/root page started giving me (and every other user) a 404
Started GET "/" for 127.0.0.1 at 2012-05-10 16:27:39 -0400
Processing by ProjectsController#index as HTML
Rendered events/_event_issue.html.haml (4.8ms)
Rendered events/_event.html.haml (5.3ms)
Rendered projects/index.html.haml within layouts/application (14.2ms)
Completed 500 Internal Server Error in 21ms
ActionController::RoutingError (No route matches {
:action=>"show",
:controller=> "issues",
:project_id=>#<Project
id: 6,
name: "my-project",
path: "my-project",
description: nil,
created_at: "2012-05-08 13:57:18",
updated_at: "2012-05-09 16:14:34",
private_flag: true,
code: "my-project",
owner_id: 2,
default_branch: "master",
issues_enabled: true,
wall_enabled: true,
merge_requests_enabled: true,
wiki_enabled: false
>,
:id=>nil
}):
app/views/events/_event_issue.html.haml:5:in `_app_views_events__event_issue_html_haml___439338695_115969750'
app/views/events/_event.html.haml:4:in `_app_views_events__event_html_haml__972233839_116011430'
app/views/projects/index.html.haml:13:in `_app_views_projects_index_html_haml__331061_115976090'
I've deleted everything related to gitlab/unicorn from /tmp/
and /home/gitlab/gitlab/tmp/
and restarted the server but to no avail.
Created by: nmickuli
I ran into this issue as well. From what I can tell, Gitlab fails to clean up the events table after deleting a user. It needs to remove all of the events associated with the deleted author id. I had to go into my database and manually do it before the 404 would go away.
If you want to keep these around, the user record could be turned into a "tombstone", where it remains in the database but is marked as deleted. This will make keep the events table's refs valid. The code should check to make sure a user isn't deleted before listing on project pages, etc.
By Administrator on 2012-05-28T00:39:14 (imported from GitLab project)
Created by: nmickuli
Also, the events table references issues that get deleted along with the user. If you delete a user, the issues that the user submitted should NOT be deleted. They could be valid issues which need to be addressed by the project developers, even though the submitter is no longer in the system. Again, the user tombstone thing I suggested would fix this.
If you're wondering why I didn't just block the user if I wanted to keep all of the issues around, etc., it's because blocked users still show up in admin dashboards and the API. I have scripts that do actions based on all of the users blocked or not. I do not want deleted users to be processed by this script, but any blocked users should be.
By Administrator on 2012-05-28T00:58:07 (imported from GitLab project)