Open dkhgh opened 8 years ago
Perhaps an audit log of a deleted user? I don't think you can easily delete users, so it must have been a hard delete in the database
I am having the same problem. I have hosted it on Heroku. Whenever I go to /Users, app crashes this is the log from Heroku,
2017-08-31T17:21:16.363452+00:00 app[web.1]: ActionView::Template::Error (No route matches {:action=>"show", :controller=>"users", :id=>nil} missing required keys: [:id]): 2017-08-31T17:21:16.363453+00:00 app[web.1]: 7: - @users.each do |user| 2017-08-31T17:21:16.363454+00:00 app[web.1]: 8: %tr 2017-08-31T17:21:16.363455+00:00 app[web.1]: 9: %td 2017-08-31T17:21:16.363456+00:00 app[web.1]: 10: = link_to user.full_name, user_path(user) if user.confirmed? 2017-08-31T17:21:16.363456+00:00 app[web.1]: 11: %td= user.email 2017-08-31T17:21:16.363457+00:00 app[web.1]: 12: %td 2017-08-31T17:21:16.363458+00:00 app[web.1]: 13: - unless user.accepted_or_not_invited? 2017-08-31T17:21:16.363459+00:00 app[web.1]: app/views/users/index.html.haml:10:in
block in _app_views_users_index_html_haml_659651559752492815_70194425770680'
2017-08-31T17:21:16.363460+00:00 app[web.1]: app/views/users/index.html.haml:7:in `_app_views_users_index_htmlhaml659651559752492815_70194425770680'
2017-08-31T17:21:16.363461+00:00 app[web.1]:
2017-08-31T17:21:16.363461+00:00 app[web.1]: `
Now I wonder, How do I fix it without losing my Data?
The error you see, does not seem related. Your app crashes because the template tries to iterate over users without an id. From the code, I can't figure out which user(s) that could be: the controller assigns User.all
to @users
, which the template iterates over and constructs links for each user using its id.
So, the question is: What does your database's Users table contain? Have you changed the primary key of the users table? What database do you use and is it fully migrated?
On the audit log of certain projects I get a 500 error, caused by a missing user ID it seems. This is not happening on all projects, not sure why.