Defect #10432
closedRack 1.1.3 NoMethodError (private method `gsub' called for :autologin:Symbol)
0%
Description
Hi everyone, I'm running latest Redmine 1.3.2.stable.9236 (MySQL). I upgraded correctly the application (no errors with rake db:migrate RAILS_ENV=production --trace) and the website is working without any visible error (I checked the logs too to be absolutely sure). I've enabled the WebService REST calls to import some Issues from MS Project via a third-party application. Redmine is installed in Ubuntu 10.04 LTS with the ruby and redmine PPA. The versions of ruby, rails and gems seems right to me accordling to your installation requirements:
xxx@redmine:/usr/share/redmine$ ruby --version ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux] xxx@redmine:/usr/share/redmine$ rails --version Rails 2.3.14 xxx@redmine:/usr/share/redmine$ gem list *** LOCAL GEMS *** actionmailer (2.3.14) actionpack (2.3.14) activerecord (2.3.14) activeresource (2.3.14) activesupport (2.3.14) cgi_multipart_eof_fix (2.5.0) daemons (1.1.8) fastthread (1.0.7) gem_plugin (0.2.3) i18n (0.4.2) mongrel (1.1.5) mysql (2.8.1) rack (1.1.3) rails (2.3.14) rake (0.8.7)
when the WS is called I receive this error call stack:
Processing IssuesController#create to xml (for 192.168.2.10 at 2012-03-12 16:30:28) [POST] Parameters: {"format"=>"xml", "issue"=>{"due_date"=>"2012-08-10", "project_id"=>"xxx-b2c", "start_date"=>"2012-08-09", "estimated_hours"=>"8.0", "status_id"=>"1", "done_ratio"=>"0", "tracker_id"=>"2", "parent_issue_id"=>"613", "subject"=>" (IF APPLICABLE) Create Client Specific DR failover documentation", "description"=>nil}, "controller"=>"issues", "action"=>"create"} NoMethodError (private method `gsub' called for :autologin:Symbol): /usr/lib/ruby/vendor_ruby/rack/backports/uri/common.rb:24:in `encode_www_form_component' /usr/lib/ruby/vendor_ruby/rack/utils.rb:23:in `escape' /usr/lib/ruby/vendor_ruby/rack/utils.rb:201:in `set_cookie_header!' /usr/lib/ruby/vendor_ruby/rack/utils.rb:238:in `delete_cookie_header!' app/controllers/application_controller.rb:32:in `handle_unverified_request' /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:95:in `process_request' /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:374:in `start_request_handler' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:330:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:209:in `start' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/phusion_passenger/passenger-spawn-server:61 Rendering /usr/share/redmine/public/500.html (500 Internal Server Error)
The error seems very similar to bug #9118 but the given patch doesn't work with the current 1.1.3 Rack installation.
second part of the patch:
@@ -204,7 +204,7 @@ # generate a key and set cookie if autologin if params[:autologin] && Setting.autologin? token = Token.create(:user => user, :action => 'autologin') - cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now } + cookies[:autologin.to_s] = { :value => token.value, :expires => 1.year.from_now } end call_hook(:controller_account_success_authentication_after, {:user => user }) redirect_back_or_default :controller => 'my', :action => 'page'
doesn’t match with the new version of the file. The code Is now:
# generate a key and set cookie if autologin if params[:autologin] && Setting.autologin? set_autologin_cookie(user) end
Here's some detailed information of my Redmine installation and MySql version:
xxx@redmine:/usr/share/redmine$ RAILS_ENV=production ruby script/about NOTE: SourceIndex.new(hash) is deprecated; From /var/lib/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:100:in `new'. About your application's environment Ruby version 1.8.7 (x86_64-linux) RubyGems version 1.7.2 Rack version 1.1.3 Rails version 2.3.14 Active Record version 2.3.14 Active Resource version 2.3.14 Action Mailer version 2.3.14 Active Support version 2.3.14 Application root /usr/share/redmine Environment production Database adapter mysql Database schema version 20110902000000 mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1
Thanks in advance to everyone that we'll help me on this bug... It's about two days that I'm banging my head against the wall without a solution...
Related issues
Updated by Fayez Naccache almost 13 years ago
I am getting a similar error when PUT time entry via REST API with PHP.
Here is the log:
Processing TimelogController#update to xml (for 192.168.56.1 at 2012-03-26 11:35:12) [PUT] Parameters: {"id"=>"12", "key"=>"9d397a2c132f676a38c5e9e023c2a8be640c8bf3", "controller"=>"timelog", "format"=>"xml", "action"=>"update", "time_entry"=>{"comments"=>nil, "issue"=>{"id"=>"1"}, "activity"=>{"id"=>"8", "name"=>"Conception"}, "user"=>{"id"=>"1", "name"=>"Redmine Admin"}, "spent_on"=>"2012-03-08", "hours"=>"4", "created_on"=>"2012-03-05T11:21:33+01:00", "project"=>{"id"=>"1", "name"=>"projet1"}, "updated_on"=>"2012-03-05T11:21:33+01:00"}} NoMethodError (private method `gsub' called for :autologin:Symbol): /usr/lib/ruby/vendor_ruby/rack/backports/uri/common.rb:24:in `encode_www_form_component' /usr/lib/ruby/vendor_ruby/rack/utils.rb:23:in `escape' /usr/lib/ruby/vendor_ruby/rack/utils.rb:201:in `set_cookie_header!' /usr/lib/ruby/vendor_ruby/rack/utils.rb:238:in `delete_cookie_header!' /usr/lib/ruby/vendor_ruby/rack/response.rb:63:in `delete_cookie' /usr/lib/ruby/vendor_ruby/action_controller/cookies.rb:94:in `delete' app/controllers/application_controller.rb:32:in `handle_unverified_request' /usr/lib/ruby/vendor_ruby/action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `send' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `evaluate_method' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:166:in `call' /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:225:in `call' /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:629:in `run_before_filters' /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:615:in `call_filters' /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in `perform_action_without_benchmark' /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in `perform_action_without_flash' /usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:in `perform_action' /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `send' /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `process_without_filters' /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in `process' /usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:in `process' /usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in `call' /usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:in `call' /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in `dispatch' /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in `_call' /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in `build_middleware_stack' /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call' /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call' /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in `cache' /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:in `call' /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:in `call' /usr/lib/ruby/vendor_ruby/rack/head.rb:9:in `call' /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:24:in `call' /usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in `call' /usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:in `call' /usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in `call' /usr/lib/ruby/vendor_ruby/rack/lock.rb:15:in `call' /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in `call' /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:95:in `process_request' /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:374:in `start_request_handler' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:330:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start' /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:209:in `start' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application' /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop' /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /usr/lib/phusion_passenger/passenger-spawn-server:61 Rendering /usr/share/redmine/public/500.html (500 Internal Server Error)
Some help please!!
Iam running redmine 1.3.0 stable
Updated by Christian Korff almost 13 years ago
I thought I got a similar issue but it's not reproducable. You may see issue #10549 if you're intrested
Updated by Go MAEDA almost 5 years ago
- Status changed from New to Closed
- Resolution set to Cant reproduce
I am closing this issue because Redmine 1.3, Rack 1.1.3, and Ruby 1.8.7 are too old.
Please reopen this issue if you still experience the problem with the latest version of Redmine and middlewares.