Project

General

Profile

Large cookies and error 500

Added by Kirill Chernousov almost 12 years ago

Hello all.
I have such configuration:

[redmine-1.3.2] > env RAILS_ENV=production script/about
About your application's environment
Ruby version              1.8.7 (amd64-freebsd8)
RubyGems version          1.3.6
Rack version              1.1
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
Edge Rails revision       unknown
Application root          /usr/home/user/domains/%servername%/public_html/redmine-1.3.2
Environment               production
Database adapter          mysql
Database schema version   20120705075147

About your Redmine plugins
Redmine Issue Checklist plugin   1.0.0
Redmine ChangeAuthor plugin      0.0.2
Redmine Whining plugin           0.0.6
Timesheet Plugin                 0.6.0

running on FreeBSD 8.0-RELEASE. (Apache + Passenger)

Sometimes i have an error 500 with following message in logs

Processing IssuesController#create (for %client IP% at 2012-07-05 18:00:56) [POST]
  Parameters: {"commit"=>"Создать", "project_id"=>"estimations", "action"=>"create", "authenticity_token"=>"%some token%", "issue"=>{"start_date"=>"2012-07-05", "est
Sending email notification to: v**@**.ua, a**@**.ua, l**@**.ua
Saving attachment '/usr/home/user/domains/%servername%/public_html/redmine-1.3.2/files/120705180056_happy_lrg.jpg' (9764 bytes)
Saving attachment '/usr/home/user/domains/%servername%/public_html/redmine-1.3.2/files/120705180056_happy_lrg2.JPG' (35078 bytes)
Redirected to http://%servername%/issues/7114
Completed in 426ms (DB: 20) | 302 Found [http://%servername%/projects/estimations/issues]
/!\ FAILSAFE /!\  Thu Jul 05 18:00:56 +0200 2012
  Status: 500 Internal Server Error
  ActionController::Session::CookieStore::CookieOverflow
    /usr/home/user/domains/%servername%/public_html/redmine-1.3.2/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:111:in `call'
    /usr/home/user/domains/%servername%/public_html/redmine-1.3.2/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
    /usr/home/user/domains/%servername%/public_html/redmine-1.3.2/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/utils.rb:479:in `safe_fork'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:180:in `start'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/helper-scripts/passenger-spawn-server:99

As far as i know problem is in large cookies, over 4Kb.
Can anybody help me with this issue?


Replies (6)

RE: Large cookies and error 500 - Added by William Roush almost 12 years ago

ActiveRecord limitation, apparently you can change your session store type:

http://www.ruby-forum.com/topic/187935

However, you shouldn't be getting 4kb cookies... are these being created by other apps on the server? A runaway plug-in?

RE: Large cookies and error 500 - Added by Kirill Chernousov almost 12 years ago

Seems like timesheet plugin trying to save lots of info in cookies

When i try to change session store (to both active record and memcached) i can't login into redmine.
Logs show

Processing AccountController#login (for %ip% at 2012-07-12 13:04:36) [POST]
  Parameters: {"back_url"=>"http%3A%2F%2F%servername%%3A3000%2F", "action"=>"login", "authenticity_token"=>"%token%", "username"=>"%username%", "controller"=>"account", "password"=>"[FILTERED]", "login"=>"Вход »"}
Redirected to http://%servername%:3000/
Filter chain halted as [:delete_broken_cookies] rendered_or_redirected.

and
Processing WelcomeController#index (for %ip% at 2012-07-12 13:04:37) [GET]
  Parameters: {"action"=>"index", "controller"=>"welcome"}
  Setting Columns (1.1ms)   SHOW FIELDS FROM `settings`
  SQL (0.0ms)   SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings`
  Setting Load (0.0ms)   SELECT * FROM `settings` WHERE (`settings`.`name` = 'rest_api_enabled') LIMIT 1
  AnonymousUser Columns (1.2ms)   SHOW FIELDS FROM `users`
  AnonymousUser Load (0.1ms)   SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1
  Setting Load (0.0ms)   SELECT * FROM `settings` WHERE (`settings`.`name` = 'login_required') LIMIT 1
Redirected to http://%servername%:3000/login?back_url=http%3A%2F%2F%servername%%3A3000%2F
Filter chain halted as [:check_if_login_required] rendered_or_redirected.
Completed in 15ms (DB: 3) | 302 Found [http://altima.com.ua/]
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0

Looks like session can't be stored at all.

RE: Large cookies and error 500 - Added by William Roush almost 12 years ago

I'd maybe look into getting the timesheet plugin fixed, it should NOT be abusing cookies like that...

RE: Large cookies and error 500 - Added by Kirill Chernousov almost 12 years ago

I understand that plugin fix would be preffered, but i'm not so good in Ruby to do it :)

RE: Large cookies and error 500 - Added by Kirill Chernousov over 11 years ago

Maybe you know some examples of well documented redmine installations with memcached/active record storages?

    (1-6/6)