ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

NoMethodError occurrs when accessing a page that requires to be logged in (Bug #384)


Added by Felix Schupp at 2011-05-07 07:21 am. Updated at 2011-05-12 11:19 pm.


Status:Declined Start date:2011-05-07
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:1.3.0

Description

We get hundreds of these errors per day as Google crawls our site. The pages are either in the wiki or do not exist - so either a 404 or redirect to login should be displayed.

The code fragment below shows access to a non-existent Wiki page - a link that works fine when logged in by opening the wiki editor. ChiliProject issues a 500 error page, and the Redmine Exception Handler plugin sends me this email


A NoMethodError occurred in application#show:

  undefined method `keys' for nil:NilClass
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:79:in `collect_mimes_from_class_level'

-------------------------------
Request:
-------------------------------

  * URL       : http://code.softmethod.de/projects/blackray/wiki/Expression
  * IP address: 66.249.71.26
  * Parameters: {"project_id"=>"blackray", "action"=>"show", "id"=>"Expression", "controller"=>"wiki"}
  * Rails root: /srv/chiliproject/chiliproject-1.3.0

-------------------------------
Session:
-------------------------------

  * session id: nil
  * data: nil

-------------------------------
Environment:
-------------------------------

  * GATEWAY_INTERFACE                           : CGI/1.2
  * HTTP_ACCEPT                                 : */*
  * HTTP_ACCEPT_ENCODING                        : gzip,deflate
  * HTTP_CONNECTION                             : Keep-Alive
  * HTTP_FROM                                   : googlebot(at)googlebot.com
  * HTTP_HOST                                   : code.softmethod.de
  * HTTP_USER_AGENT                             : Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
  * HTTP_VERSION                                : HTTP/1.1
  * HTTP_VIA                                    : 1.1 code.softmethod.de
  * HTTP_X_FORWARDED_FOR                        : 66.249.71.26
  * HTTP_X_FORWARDED_HOST                       : code.softmethod.de
  * HTTP_X_FORWARDED_SERVER                     : code.softmethod.de
  * PATH_INFO                                   : /projects/blackray/wiki/Expression
  * QUERY_STRING                                :
  * REMOTE_ADDR                                 : 127.0.0.1
  * REQUEST_METHOD                              : GET
  * REQUEST_PATH                                : /projects/blackray/wiki/Expression
  * REQUEST_URI                                 : /projects/blackray/wiki/Expression
  * SCRIPT_NAME                                 :
  * SERVER_NAME                                 : code.softmethod.de
  * SERVER_PORT                                 : 80
  * SERVER_PROTOCOL                             : HTTP/1.1
  * SERVER_SOFTWARE                             : Mongrel 1.1.5
  * action_controller.request.path_parameters   : project_idblackrayactionshowidExpressioncontrollerwiki
  * action_controller.request.query_parameters  :
  * action_controller.request.request_parameters:
  * action_controller.rescue.request            : #<ActionController::Request:0x7f52b3dc7640>
  * action_controller.rescue.response           : #<ActionController::Response:0x7f52b3dc7618>
  * rack.errors                                 : #<IO:0x7f52c0c78ac0>
  * rack.input                                  : #<StringIO:0x7f52b3dcc410>
  * rack.multiprocess                           : true
  * rack.multithread                            : false
  * rack.request.query_hash                     :
  * rack.request.query_string                   :
  * rack.run_once                               : false
  * rack.session                                : session_idd9dbadd8a6c84d87f5bc0fd0e240adc4
  * rack.session.options                        : httponlytruedomainidd9dbadd8a6c84d87f5bc0fd0e240adc4expire_afterpath/key_session_id
  * rack.url_scheme                             : http
  * rack.version                                : 01

  * Process: 3603
  * Server : svn-2

-------------------------------
Backtrace:
-------------------------------

  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:79:in `collect_mimes_from_class_level'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:97:in `retrieve_response_from_mimes'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:58:in `respond_to'
  [RAILS_ROOT]/vendor/plugins/redmine-exception-handler-plugin/vendor/plugins/exception_notification/lib/exception_notifiable.rb:74:in `render_500'
  [RAILS_ROOT]/vendor/plugins/redmine-exception-handler-plugin/vendor/plugins/exception_notification/lib/exception_notifiable.rb:86:in `rescue_action_in_public'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:154:in `rescue_action_without_handler'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:74:in `rescue_action'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:162:in `perform_action_without_flash'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
  /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
  /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
  /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
  /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
  /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
  /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/cgi_process.rb:44:in `dispatch_cgi'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
  /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:27:in `dispatch'
  /usr/lib/ruby/1.8/mongrel/rails.rb:76:in `process'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `synchronize'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `process'
  /usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `each'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:282:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `each'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `run'
  /usr/bin/mongrel_rails:129:in `run'
  /usr/lib/ruby/1.8/mongrel/command.rb:212:in `run'
  /usr/bin/mongrel_rails:282

Environment Info:

ladmin@svn-2:~$ uname -a
Linux svn-2 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux
ladmin@svn-2:~$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
ladmin@svn-2:~$ gem --version
1.3.5

History

Updated by Felix Schäfer at 2011-05-08 05:22 pm

Bizarre, I can't remember having this sort of errors… Could you see if they occur without the exception handler to make sure the error isn't in the plugin?

Updated by Felix Schupp at 2011-05-08 08:59 pm

I disabled the redmine-exception-handler, but the page still results in a 500 error, and this is the log trace (production.log of mongrel):

Processing WikiController#show (for 93.133.95.183 at 2011-05-08 21:47:10) [GET]
  Parameters: {"project_id"=>"blackray", "action"=>"show", "id"=>"Expression", "controller"=>"wiki"}

NoMethodError (undefined method `keys' for nil:NilClass):
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:79:in `collect_mimes_from_class_level'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:97:in `retrieve_response_from_mimes'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:58:in `respond_to'
  app/controllers/application_controller.rb:299:in `render_error'
  app/controllers/application_controller.rb:287:in `render_404'
  app/controllers/wiki_controller.rb:59:in `show'
  /usr/lib/ruby/1.8/mongrel/rails.rb:76:in `process'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `synchronize'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `process'
  /usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `each'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:282:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `each'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `run'
  /usr/lib/ruby/1.8/mongrel/command.rb:212:in `run'

Rendering /srv/chiliproject/chiliproject-1.3.0/public/500.html (500 Internal Server Error)

So the application seems to try to render a 404 (although that is not really ideal, better would be a redirect to the login page) but instead crashes with a 500 error.

Updated by Felix Schupp at 2011-05-08 09:08 pm

With the handler plugin enabled the stack trace is different though:

Processing ApplicationController#show (for 93.133.95.183 at 2011-05-08 21:56:26) [GET]
  Parameters: {"project_id"=>"blackray", "action"=>"show", "id"=>"Expression", "controller"=>"wiki"}

NoMethodError (undefined method `keys' for nil:NilClass):
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:79:in `collect_mimes_from_class_level'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:97:in `retrieve_response_from_mimes'
  /var/lib/gems/1.8/gems/inherited_resources-1.0.6/lib/inherited_resources/legacy/respond_to.rb:58:in `respond_to'
  /usr/lib/ruby/1.8/mongrel/rails.rb:76:in `process'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `synchronize'
  /usr/lib/ruby/1.8/mongrel/rails.rb:74:in `process'
  /usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `each'
  /usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:285:in `run'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `new'
  /usr/lib/ruby/1.8/mongrel.rb:268:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:282:in `run'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `each'
  /usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `run'
  /usr/lib/ruby/1.8/mongrel/command.rb:212:in `run'

Rendering /srv/chiliproject/chiliproject-1.3.0/public/500.html (500 Error)
rendering section "request" 
rendering section "session" 
rendering section "environment" 
rendering section "backtrace" 

Updated by Eric Davis at 2011-05-10 11:30 pm

Felix Schupp:

The error is coming from the inherited_resources gem. Can you post the output of your script/about, I think a plugin might be pulling in inherited_resources and causing the error (could be one of fine too)

  • Category changed from Permissions to Wikis
  • Status changed from Open to Needs more information

Updated by Felix Schupp at 2011-05-10 11:41 pm

Glad I can help:

root@svn-2:/srv/chiliproject/chiliproject-current# RAILS_ENV=production ruby script/about

About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.3.5
Rack version              1.0
Rails version             2.3.5
Active Record version     2.3.5
Active Resource version   2.3.5
Action Mailer version     2.3.5
Active Support version    2.3.5
Application root          /srv/chiliproject/chiliproject-1.3.0
Environment               production
Database adapter          postgresql
Database schema version   20110131145123

About your Redmine plugins
Redmine Charts                         0.1.0
Graphviz Wiki-macro Plugin             0.2.0
Xapian search plugin                   1.1.2
Redmine Wiki Extensions plugin         0.3.3
Redmine Newissuealerts plugin          0.0.2
Redmine Contributor Licensing          0.1.0
Redmine Blogs plugin                   0.1.0
Redmine Stealth plugin                 0.1.0
Invoice plugin                         0.0.1
Redmine Codebook plugin                0.3.1
Redmine Opensearch plugin              0.1
Customer plugin                        0.2.0
Screenshot Paste                       1.1.0
Piwik plugin                           0.1.1
Knowledgebase                          0.2.5
Redmine Code Review plugin             0.4.1
Nabble Embedding Plugin                0.1.0
Timesheet Plugin                       0.6.0
Issues XLS export                      0.1.3
WebDav plugin                          0.2.1
Redmine Exception Handler plugin       0.2.0
Wiki External Filter Plugin            0.0.2
reCAPTCHA for user self registration   0.1.0
Redmine Logs plugin                    0.0.1
Ohloh Metrics Plugin                   0.1.0
Redmine Favicon plugin                 0.2

I do however believe there are more issues, although it might be one common reason. Other URLs also fail with a 500 error even though a 404 would be better, more on this later

Updated by Felix Schäfer at 2011-05-11 04:22 pm

Felix Schupp wrote:

Glad I can help:

Well there are a few :-) Could you see if you can grep which one calls gem 'inherited_resources' (probably in the init.rb file in the plugin), and if you have found a culprit see if the problem persists if you deactivate it?

Updated by Felix Schupp at 2011-05-11 05:00 pm

Actually, only the redmine_contributor_licensing plugin calls inherited_resources

Surely enough, deactivating the plugin does in fact solve the problem - however this is one of the crucial plugins for us..... Since your site is about the ChiliProject itself, i will close this bug here and open a new one at the plugin site :)

Updated by Felix Schupp at 2011-05-11 05:11 pm

The issue seems to be in the redmine_contributor_licensing plugin.

  • Status changed from Needs more information to Declined

Updated by Felix Schäfer at 2011-05-11 05:35 pm

Thanks for the feedback!

Updated by Eric Davis at 2011-05-12 11:19 pm

Felix Schupp wrote:

The issue seems to be in the redmine_contributor_licensing plugin.

Thanks, that is my plugin (unreleased). I made a note about it to look into it.

  • Category deleted (Wikis)

Also available in: Atom PDF