Project

General

Profile

v1.2.0 throws 302 http responses and then enters a 404 page

Added by Raidel del Peso almost 13 years ago

Hi since i updated to 1.2.0 i have been getting this problem when i try to update a ticket (ajax request don't trigger it). It shows me a 404 page, i looked at the logs and this is what i got:

Processing IssuesController#update (for ********* at 2011-06-07 18:37:37) [PUT]
  Parameters: {"time_entry"=>{"comments"=>"", "activity_id"=>"", "hours"=>""}, "commit"=>"Submit", "notes"=>"test", "action"=>"update", "_method"=>"put", "authenticity_token"=>"********", "id"=>"20", "issue"=>{"start_date"=>"2011-05-31", "estimated_hours"=>"****", "parent_issue_id"=>"18", "priority_id"=>"4", "is_private"=>"0", "lock_version"=>"9", "fixed_version_id"=>"6", "done_ratio"=>"40", "assigned_to_id"=>"3", "subject"=>"*****", "tracker_id"=>"2", "due_date"=>"*****", "status_id"=>"2", "description"=>""}, "controller"=>"issues", "attachments"=>{"1"=>{"description"=>""}}}
Redirected to http://*********/issues/20
Completed in 243ms (DB: 89) | 302 Found [http://********/issues/20]

Processing ApplicationController#index (for ****** at 2011-06-07 18:37:38) [GET]

ActionController::RoutingError (No route matches "/internal_error.html" with {:method=>:get}):
  /dh/passenger/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  /dh/passenger/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
  /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/utils.rb:184:in `safe_fork'
  /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:163:in `start'
  /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /home/**********/**********/public/404.html (404 Not Found)

Is throwing a 302 header code standard behaviour on redmine now?

Then after much clicking and struggling i got this too:

/!\ FAILSAFE /!\  Tue Jun 07 18:25:41 -0700 2011
  Status: 500 Internal Server Error
  undefined method `merge' for nil:NilClass
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/request.rb:385:in `parameters'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/base.rb:1290:in `assign_shortcuts'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/base.rb:527:in `process_without_filters'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/filters.rb:606:in `process'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/rescue.rb:65:in `call_with_exception'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:90:in `dispatch'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:121:in `_call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:29:in `call'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:29:in `call'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:9:in `cache'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:28:in `call'
    /home/****/.gems/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/string_coercion.rb:25:in `call'
    /home/****/.gems/gems/rack-1.1.1/lib/rack/head.rb:9:in `call'
    /home/****/.gems/gems/rack-1.1.1/lib/rack/methodoverride.rb:24:in `call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/params_parser.rb:15:in `call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:99:in `call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/failsafe.rb:26:in `call'
    /home/****/.gems/gems/rack-1.1.1/lib/rack/lock.rb:11:in `call'
    /home/****/.gems/gems/rack-1.1.1/lib/rack/lock.rb:11:in `synchronize'
    /home/****/.gems/gems/rack-1.1.1/lib/rack/lock.rb:11:in `call'
    /home/****/.gems/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:106:in `call'
    /dh/passenger/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    /dh/passenger/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
    /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
    /dh/passenger/lib/phusion_passenger/utils.rb:184:in `safe_fork'
    /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:163:in `start'
    /dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
    /dh/passenger/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /dh/passenger/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /dh/passenger/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    /dh/passenger/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    /dh/passenger/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /dh/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /dh/passenger/bin/passenger-spawn-server:61

Is there anything reported about this? i looked on tickets/google/forum and didn't find a single thing. More than likely I'm looking for the wrong thing. Let me know whatever you can about this, it's quite annoying to deal with it on a day to day basis.

Here is my system info:

About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.6
Rack version 1.1.1
Rails version 2.3.11
Active Record version 2.3.11
Active Resource version 2.3.11
Action Mailer version 2.3.11
Active Support version 2.3.11
Application root /home/****/*********
Environment production
Database adapter mysql
Database schema version 20110511000000

Thanks for your help!


Replies (22)

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Michael Carriere over 12 years ago

This happens with me as well, and seems to be a passenger-specific issue.

This guy used a redirect page to force the refresh: (google "a small trick to avoid 404 errors when redmine runs on dreamhost", the forum kept considering my post spam.)

But honestly, I'd love to know what the problem is, and if there's anything we can do to fix it.

Problem doesn't exist when I launch the server from the command line, but definitely occurs when Passenger/Apache is serving the pages.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

Same problem here. I'm running on dreamhost - so not sure if it's dreamhost related. It seems like maybe they're killing a process or something. Are you also running on dreamhost?

It would be nice to find a 'real' solution, but the one reload fix does help.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

Michael Mohr id like to avoid a work around, and get a fix from redmine instead, but i will investigate that workaround

Seth Gecko I'm hosted on DH too, but, i'd say that is not the process being killed, since it happens pretty constantly, even after i just restarted the process. (DH only kills it after certain ammount of time running as far as I'm concerned)

I will use the info on this topic and submit it as a bug sometime next week, also I will try the workaround and see if that offsets my frustration, thanks guys :)

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

Sounds good. Please let us know how it goes.

The workaround makes things useable for me, so it does help. But like you said, it is a bug and there should be a proper way to fix it.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Michael Carriere over 12 years ago

I'm fairly certain that it's got nothing to do with processes being killed, because I've got this running on Dreamhost as well, but on a VPS, where they don't touch any of the processes that are being run.

Interesting that we're all DH customers. Whoever writes up the bug, post a link to it here so we can check in on it. :)

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by David Muir over 12 years ago

Another DH customer with the same issue. Anybody filed a bug report yet?

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

The reason i haven't filled it is because 1.2.1 was out and I haven't had the time to test it. But i got to it today, after upgrading I no longer can reproduce the bug. Please upgrade as possible and let me know if upgrading fixed the issue for you too.

I will continue to monitor my site for problems but right now, after restarting 3 times, and making around 20 tests on different areas of the issues page (new ticket, and multiple types of updates) is working perfectly with no work around applied.

I hope upgrading helps everyone.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by David Muir over 12 years ago

I'm running Redmine 1.2.1.stable.6314 and still have the issue.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

I'm not sure if this could be it or not but I disabled the 'enhanced security' from dreamhost which I think disables mod_security. I didn't see this problem during that time. I enabled it back today and now I'm getting the problem again.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Michael Carriere over 12 years ago

I'm running Redmine 1.2.1.stable.6301, and still have this issue. I'll try disabling mod_security and see if that does anything.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

I tested it again today, and the error is back, apparently it only went away for some time (not quite sure why or how)

I tried Seth's suggestion of turning off "Extra Web Security" and so far is working perfectly. I will leave it like this and test it for a couple of days before confirming that this fixed the issue or not.

Maybe it is not redmine's fault after all, and the one to blame/question is DH :) Thanks for all your feedback/help guys.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Michael Carriere over 12 years ago

Just want to pipe in and confirm that disabling mod_security also fixed my issue.

It would seem though, that while this is a nice temporary fix, David should still keep the bug open to see if there's anything that can be done about it, especially since previous versions of redmine worked fine with mod_security on by default.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

It would help if we were able to get access to the mod_security logs. Are you on shared hosting? If we were able to get access to the log it may give a hint. I know on shared hosting it is possible to tweak mod_security, but we would need to know what needs to be tweaked in order to fix it.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

Another thing that i just clued in (don't know how i didn't notice before) is that in my log, it says:

ActionController::RoutingError (No route matches "/internal_error.html" with {:method=>:get}):

But i do not have any error logs of any kind, does anyone knows of some extra configuration i need to show that internal error somewhere? I would assume that running redmine on Passenger is using Apache, so why do i not have an error log for that 500 error that triggered a call to internal_error.html? Maybe some htaccess setting would help? any ideas?

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

I'm corresponding with DH support trying to figure out where the error logs for this issue are going to, maybe we can make some progress with that data.

Seth Gecko Yes, I'm using share hosting, but i can also use VPS, maybe is a good time to test it there too after DH support get's back to me. Thanks for the suggestion.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Raidel del Peso over 12 years ago

DH checked for every log there is, and could not find anything helpful.

I did test to see if the error log was working. I created a bogus invalid .htaccess file and the error log tracked the error as expected. So the only things that i can think of are:

  • Redmine is somehow suppressing the error
  • There is no error message, and is a simple 500 redirect somewhere in the code conflicting with mod_security

I will follow up when i test with my VPS later this week.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

I think I get the same error about internal_error.html. I think there's some conflict probably between some level of mod_security and redmine. It sounds like were getting closer though.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Seth Sandler over 12 years ago

Any more news regarding this?

Also, are you guys running on shared hosting or PS? I'm curious since I think I'm hitting a memory limit trying redmine on shared hosting on dreamhost. It gets the rails error that people have talked about before. I'm curious if there's any settings to lower the memory footprint. Or, which PS plan you're using to get things working for redmine. Would the lowest plan of 300mb work?

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Michael Carriere over 12 years ago

I've got a VPS, and was running redmine with as low as 512MB with none of the Passenger issues anymore. (The Broken Pipe messages are usually indicative that you're running out of memory)

I've got a feeling that 300MB would be fine, but I can't lower it any more, because the other web apps we're running require a bit more than that.

RE: v1.2.0 throws 302 http responses and then enters a 404 page - Added by Jérémy Chatard over 12 years ago

Hi all,

It looks like this is really close to Issue #8551.

Just to note, I don't have mod_security, but I do have passenger (aka mod_rails).

Jérémy

    (1-22/22)