ActionController::RoutingError (No route matches {:controller=>"users", :action=>"show", :username=>nil}):
Closed
ActionController::RoutingError (No route matches {:controller=>"users", :action=>"show", :username=>nil}):
Created by: buh-rabbit
I get the following error:
ActionController::RoutingError (No route matches {:controller=>"users", :action=>"show", :username=>nil}):
app/helpers/events_helper.rb:6:in link_to_author' app/views/events/event/_note.html.haml:2:in
_app_views_events_event__note_html_haml__631284749464040337_17253768540'
app/views/events/_event.html.haml:12:in _app_views_events__event_html_haml__324368459914979753_17253506540' app/views/dashboard/show.js.haml:2:in
_app_views_dashboard_show_js_haml___1740372430569068073_17253280520'
app/controllers/dashboard_controller.rb:20:in `show'
I try to run bundle exec rake gitlab:enable_namespaces RAILS_ENV=production but i get another error:
Generate usernames for users without one
Done
Create directories for groups
Done
Move projects in groups into respective directories ... development / myproject ... already at /home/git/repositories/development/myproject.git
Done Rebuild Gitolite ... rake aborted! uninitialized constant Gitlab::Gitolite /usr/home/git/gitlab/lib/tasks/gitlab/enable_namespaces.rake:11:in `block (2 levels) in <top (required)>' Tasks: TOP => gitlab:enable_namespaces (See full trace by running task with --trace)
I'm using: ruby 1.9.3p385 git commit ab191963
Created by: jalada
It looks like a 'username' field has been added for users but the migrations aren't setting them to anything, so they are all nil, which causes the routes to fail.
I went into a Rails console and manually set a username for everyone.
Another fix would probably be to change
app/helpers/events_helper.rb
to check for existence of a username... Oops?By Administrator on 2013-02-26T09:34:07 (imported from GitLab project)
Created by: afraazali
I found a fix to my solution. I'm not a ruby developer, so I'm not sure why this worked. When looking at the database after the migration from 4.2 to master, I saw that the username for the admin user (id=1) was set to admin@local.host, in a clean install from master it is set to "root". Setting the username value to "root" fixed the issue.
By Administrator on 2013-03-02T04:14:42 (imported from GitLab project)
Created by: jalada
@afraazali Yeah, that isn't a fix in general. That only applies to if there is one user, I think.
The migration simply needs changing to auto-generate usernames for users that already exist, or not raise an exception if a user doesn't have a username.
@buh-rabbit Can you please reopen this issue so the maintainers can see it still needs fixing?
By Administrator on 2013-03-02T10:50:16 (imported from GitLab project)
Created by: caldwell
This is happening to me and it's a very confusing error to someone like me who doesn't know rails. My older users don't have usernames (NULL in the db). Updating them manually in the DB fixed the problem.
By Administrator on 2013-03-26T02:29:55 (imported from GitLab project)