redmine_wiki_permissions
redmine_wiki_permissions copied to clipboard
undefined method `level' for nil:NilClass
This is on redmine r3683 and the latest version of this plugin. I think the error happens when a user does a search of all project wiki's and there is a wiki page under permissions control in a project that the user is not a member of.
A NoMethodError occurred in search#index:
undefined method level' for nil:NilClass [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:103:in
user_permission_greater?'
Request:
- URL : https://redmine.X.co.nz/search?q=netbeans
- IP address: 117.104.180.242
- Parameters: {"action"=>"index", "controller"=>"search", "q"=>"netbeans"}
- Rails root: /mnt/redmine
Session:
- session id: nil
- data: nil
Environment:
- CONTENT_LENGTH : 0
- DOCUMENT_ROOT : /mnt/redmine/public
- HTTPS : on
- HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
- HTTP_ACCEPT_CHARSET : ISO-8859-1,utf-8;q=0.7,*;q=0.7
- HTTP_ACCEPT_ENCODING : gzip,deflate
- HTTP_ACCEPT_LANGUAGE : en-us,en;q=0.5
- HTTP_CONNECTION : keep-alive
- HTTP_HOST : redmine.X.co.nz
- HTTP_KEEP_ALIVE : 300
- HTTP_REFERER : https://redmine.X.co.nz/
- HTTP_USER_AGENT : Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.19) Gecko/2010040116 Ubuntu/9.04 (jaunty) Firefox/3.0.19
- PASSENGER_APP_SPAWNER_IDLE_TIME : -1
- PASSENGER_APP_TYPE : rails
- PASSENGER_ENVIRONMENT : production
- PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME : -1
- PASSENGER_SPAWN_METHOD : smart-lv2
- PASSENGER_USE_GLOBAL_QUEUE : false
- PATH_INFO : /search
- QUERY_STRING : q=netbeans
- REMOTE_ADDR : X
- REMOTE_PORT : 50320
- REQUEST_METHOD : GET
- REQUEST_URI : /search?q=netbeans
- SCGI : 1
- SCRIPT_NAME :
- SERVER_ADDR : X
- SERVER_NAME : redmine.X.co.nz
- SERVER_PORT : 443
- SERVER_PROTOCOL : HTTP/1.1
- SERVER_SOFTWARE : nginx/0.7.64
- _ : _
- action_controller.request.path_parameters : actionindexcontrollersearch
- action_controller.request.query_parameters : qnetbeans
- action_controller.request.request_parameters:
- action_controller.rescue.request : #ActionController::Request:0x2ba625db7d00
- action_controller.rescue.response : #ActionController::Response:0x2ba625db7a58
- rack.errors : #IO:0x2ba61cbf4eb8
- rack.input : #Rack::RewindableInput:0x2ba625db8a98
- Hide quoted text -
- rack.multiprocess : true
- rack.multithread : false
- rack.request.query_hash : qnetbeans
- rack.request.query_string : q=netbeans
- rack.run_once : false
- rack.url_scheme : https
- rack.version : 10
- Process: 20120
- Server : X
Backtrace:
[RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:103:in user_permission_greater?' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:120:in
can_view?'
[RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:13:in index' [RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:11:in
delete_if'
[RAILS_ROOT]/vendor/plugins/redmine_wiki_permissions/lib/wiki_permissions.rb:11:in index' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in
send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in
call_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:in
realtime'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
Same bug
Installed latest stable redmine and latest version of plugin
Some users getting same error while searching.
Similar problem here: half of our users get Error 500 when the plugin is installed. Usually these are users that were Reporters at some point and were promoted to Developers. Removing the plugin solves the problem. Here is the production.log output:
Processing SearchController#index (for 192.1.2.3 at 2010-06-23 18:14:38) [GET] Parameters: {"action"=>"index", "q"=>"now", "controller"=>"search"}
NoMethodError (undefined method level' for nil:NilClass): passenger (2.2.14) lib/phusion_passenger/rack/request_handler.rb:92:in
process_request'
passenger (2.2.14) lib/phusion_passenger/abstract_request_handler.rb:207:in main_loop' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:441:in
start_request_handler'
passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:381:in handle_spawn_application' passenger (2.2.14) lib/phusion_passenger/utils.rb:252:in
safe_fork'
passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:377:in handle_spawn_application' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in
send'
passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in main_loop' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:in
start_synchronously'
passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:163:in start' passenger (2.2.14) lib/phusion_passenger/railz/application_spawner.rb:222:in
start'
passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:262:in spawn_rails_application' passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:126:in
lookup_or_add'
passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:256:in spawn_rails_application' passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:80:in
synchronize'
passenger (2.2.14) lib/phusion_passenger/abstract_server_collection.rb:79:in synchronize' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:255:in
spawn_rails_application'
passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:154:in spawn_application' passenger (2.2.14) lib/phusion_passenger/spawn_manager.rb:287:in
handle_spawn_application'
passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in __send__' passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:352:in
main_loop'
passenger (2.2.14) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
Rendering /path/to/redmine/public/500.html (500 Internal Server Error)
And here is the output of ruby script/about : Ruby version 1.8.7 (i386-freebsd7) RubyGems version 1.3.7 Rack version 1.2 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 Edge Rails revision unknown Application root /path/to/redmine Environment development Database adapter postgresql Database schema version 20100407184912
About your Redmine plugins Redmine Local Avatars plugin 0.0.2 Forward to Diffs 0.1 Google Calendar Plugin 0.1.2 Scrumdashboard plugin 1.2 Stuff To Do Plugin 0.4.0 Redmine Codebook plugin 0.2.1 Redmine Code Review plugin 0.3.1 Redmine Bugcloud plugin 0.0.2.1 Redmine Wiki Issue Details plugin 0.1.0 Redmine Todo Lists plugin 0.0.4.1 Latex Wiki-macro Plugin 0.0.3 Single Project Forward 0.1 Redmine Wiki Extensions plugin 0.2.2 Bots filter 1.02 Bulk Time Entry 0.5.0 Redmine Graphs plugin 0.1.0 Redmine Wiki Permissions plugin 0.0.1 Redmine Drafts plugin 0.1.1 Timesheet Plugin 0.6.0 Redmine Version Burndown Charts plugin 0.0.5 Redmine Issue History Tabs plugin 0.0.2 Issue Due Date 0.1.0 Redmine Stealth plugin 0.1.0 Redmine Require Closing Note plugin 0.0.1 Redmine Charts 0.1.0 Redmine Question plugin 0.3.0
Any updates on this? Still doesn't work in 1.0.1 (Error 500 for some users)