Redmine: error en la vista de perfil de usuario

Me sale este error:

Processing MyController#account (for 127.0.0.1 at 2012-01-31 13:22:55) [GET]
  Parameters: {"action"=>"account", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/account

ActionView::TemplateError (undefined method `-' for nil:NilClass) on line #11 of app/views/my/_sidebar.html.erb:
8: 
9: <p>
10: <% if @user.rss_token %>
11: <%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %>
12: <% else %>
13: <%= l(:label_missing_feeds_access_key) %>
14: <% end %>

    app/views/my/_sidebar.html.erb:11
    app/views/my/account.html.erb:48
    app/helpers/application_helper.rb:980:in `content_for'
    app/views/my/account.html.erb:47
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:528:in `process_client'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:600:in `worker_loop'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:135:in `start'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:209
    /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19:in `load'
    /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19

Rendering /home/redmine/redmine-buildout/parts/redmine/public/500.html (500 Internal Server Error)

for some users (not all) when trying to see /my/account.

If I try to see that user's profile as an admin I get:

Processing UsersController#show (for 2.157.30.187 at 2012-02-01 14:26:40) [GET]
  Parameters: {"action"=>"show", "id"=>"9", "controller"=>"users"}

NoMethodError (undefined method `<=>' for nil:NilClass):
  lib/redmine/activity/fetcher.rb:80:in `events'
  lib/redmine/activity/fetcher.rb:80:in `sort!'
  lib/redmine/activity/fetcher.rb:80:in `events'
  app/controllers/users_controller.rb:74:in `show'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:528:in `process_client'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:600:in `worker_loop'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:135:in `start'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:209
  /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19:in `load'
  /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19

Rendering /home/redmine/redmine-buildout/parts/redmine/public/500.html (500 Internal Server Error)

My (uneducated) guess is that the user misses a rss auth token.

If that is the case, can you point me to some docs about how to regenerate it?

preguntado el 01 de febrero de 12 a las 13:02

2 Respuestas

Have you recently upgraded Redmine?

Just to be on the safe side I'd suggest running a post-upgrade migration to make sure that all the tables are setup correctly.

rake generate_session_store
rake db:migrate RAILS_ENV=production
rake db:migrate_plugins RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear

Once the commands have completed restart your web server and see if that has helped.

Respondido 01 Feb 12, 18:02

Thanks, but this is not the case: it's a fresh install. I probably found the cause: I noticed a user creted yesterday (January 31st) was reported to be one month old. I guess it has to do with postgres db configuration and month/day ordering. - Silviot

A misunderstanding between postgresql and redmine on string date formats seemed to be the root cause (see my comment on Declan Lynch answer).

ALTER DATABASE redmine SET DATESTYLE=US;

solved all my problems.

Respondido 01 Feb 12, 19:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.