Controllers not passed as a parameter causing an error

Hi!

I have an app that is already working on a shared host, but I need to
run this on another server that was setup from scratch. Currently, the
server has the following specs:

OS: ubuntu
Apache 2
MySQL 5
Rails 2.3 (but I’m using 2.0/2.1)
Ruby 1.8.6
FastCGI(mod_fcgid)

So far the application works fine but during the submitting of forms I
sometimes get an error and on the log file was

Processing ApplicationController#index (for 122.55.107.51 at
2010-03-01 18:18:36) [PUT]
Session ID:
BAh7EjoRY291bnRkb3duMTU1aQA6DmxvZ2ludGltZXU6CVRpbWUNKogbgN6i
Q0k6CHdob2kHOg5hY2NvdW50aWRpAZs6CW1pbmVGOhB0aGlzYWNjb3VudG86
DEFjY291bnQTOgpAY2hhdDA6HEBuZXdfcmVjb3JkX2JlZm9yZV9zYXZlMDoP
QGd1aWRhbmNlczA6CkBkaWZmZhAwLjMwNzMxMQDeGjoPQG1lZF9maWxlczA6
FkBzdHVkZW50X3BheW1lbnRzMDoQQGF0dHJpYnV0ZXN7FSIJbmFtZSIQQWFy
b24gSmFtZXMiD2NyZWF0ZWRfYXQiGDIwMTAtMDMtMDEgMDk6NDU6MzkiEGRl
c2lnbmF0aW9uIglUZXN0Ig91cGRhdGVkX2F0dTsHDSqIG4DFCA9KIg11c2Vy
bmFtZSINYWppYmFuZGEiCWxvY2siBjAiB2lkIggxNTUiDWxhc3RfbG9nIhgy
MDEwLTAzLTAxIDEwOjE3OjAyIhFzY2hvb2xfbGV2ZWwwIhFsb2dpbl9zdHJp
bmciDXd6a3BAZ2ZAIg5sYXN0X25hbWUiCkJhbmRhIg9pc0xvZ2dlZEluVCIN
cGFzc3dvcmQiDWFqaWJhbmRhIhBhY2NvdW50dHlwZSIGMiIKZW1haWwiF2Fq
aWJhbmRhQGdtYWlsLmNvbSIQbWlkZGxlX25hbWUiDUlsbGVzY2FzOhRAcHJp
dmF0ZV90b3BpY3MwOhZAYXR0cmlidXRlc19jYWNoZXsGIg1sYXN0X2xvZ1U6
IEFjdGl2ZVN1cHBvcnQ6OlRpbWVXaXRoWm9uZVsIdTsHDSqIG4AAACBEIgtU
YWlwZWl1OwcNMogbgAAAIEQ6FkBwcml2YXRlX21lc3NhZ2VzMDoOQGFjY291
bnRzMDoOQG1lZGljYWxzMDoMQGVycm9yc286GUFjdGl2ZVJlY29yZDo6RXJy
b3JzBzsaewA6CkBiYXNlQAc6GEBjaGFuZ2VkX2F0dHJpYnV0ZXN7ADoWc2No
b29sX3NldF9ub3RpY2UwOgxjc3JmX2lkIiU3MGUzODRkYTQ4NTRhOWU5YjRk
ZDMyYmNjYWQzNTMzODoNbGFzdF9sb2dAKjoQYXV0aF9zdHJpbmdAHDoQc2No
b29sX3R5cGVvOg9TY2hvb2xJbmZvBzsTexEiC3NjaG9vbCIJdGhpcyIJbmFt
ZSIkU3lzdGVtcyBQbHVzIENvbGxlZ2UgRm91bmRhdGlvbiIMYWRkcmVzcyIs
TWNBcnRodXIgSGlnaHdheSwgQmFsaWJhZ28gQW5nZWxlcyBDaXR5IgtyZWdp
b24iACIPY3JlYXRlZF9hdCIYMjAwOS0xMi0xMSAwOTowODo0OSINZGlzdHJp
Y3QiACIPdXBkYXRlZF9hdCIYMjAxMC0wMS0yMSAwMTo1MDozNSINZGl2aXNp
b24iACIHaWQiBjEiCnBob25lIi0oNjMpICgwNDUpIDMyMi02OTY2LCAoNjMp
ICgwNDUpIDYyNS04MTg4IhBzY2hvb2xfdHlwZSIMREVGQVVMVCIKZW1haWwi
GG5vcmVwbHlAZGVmYXVsdC5jb207FXsAIgpmbGFzaElDOidBY3Rpb25Db250
cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewY6C2FjY2VzczAGOgpAdXNlZHsG
OyVUOgp3aG9pc0AT–b79de4b228fd131633b0e57a1b637a76f2b1daac
Parameters: {“commit”=>“Apply Changes”,
“authenticity_token”=>“caee96526e0e6c3739958d67171d74066065605c”,
“_method”=>“put”, “color”=>{“navbarbg”=>"#069", “navbarin”=>"#9cf",
“fcolor”=>"#333", “bgcolor”=>"#369"}}

NameError (uninitialized constant
ActionController::CgiRequest::Encoding):
/vendor/rails/activerecord/lib/…/…/activesupport/lib/
active_support/dependencies.rb:492:in const_missing' /vendor/rails/actionpack/lib/action_controller/cgi_process.rb: 68:inbody’
/vendor/rails/actionpack/lib/action_controller/request.rb:297:in
raw_post' /vendor/rails/actionpack/lib/action_controller/request.rb:391:inparse_formatted_request_parameters’
/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:
80:in request_parameters' /vendor/rails/actionpack/lib/action_controller/request.rb:304:inparameters’
/vendor/rails/actionpack/lib/action_controller/request.rb:22:in
request_method' /vendor/rails/actionpack/lib/action_controller/request.rb:35:inmethod’
/vendor/rails/actionpack/lib/action_controller/routing/
route_set.rb:431:in extract_request_environment' /vendor/rails/actionpack/lib/action_controller/routing/ route_set.rb:384:inrecognize’
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:
148:in handle_request' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb: 107:indispatch’
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:
104:in synchronize' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb: 104:indispatch’
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:
120:in dispatch_cgi' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:indispatch’
/vendor/rails/railties/lib/fcgi_handler.rb:103:in
process_request' /vendor/rails/railties/lib/fcgi_handler.rb:153:inwith_signal_handler’
/vendor/rails/railties/lib/fcgi_handler.rb:101:in
process_request' /vendor/rails/railties/lib/fcgi_handler.rb:78:inprocess_each_request’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:612:in
each_cgi' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:609:ineach’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:609:in
each_cgi' /vendor/rails/railties/lib/fcgi_handler.rb:77:inprocess_each_request’
/vendor/rails/railties/lib/fcgi_handler.rb:76:in catch' /vendor/rails/railties/lib/fcgi_handler.rb:76:inprocess_each_request’
/vendor/rails/railties/lib/fcgi_handler.rb:50:in process!' /vendor/rails/railties/lib/fcgi_handler.rb:24:inprocess!’
/public/dispatch.fcgi:26

The weird part here is I don’t know, when and how it usually happens
since most of the time it would work fine but sometimes it appears.
before I thought it has something to do with my session expiration
feature, but as I was checking it seems that this usually happens
during the submitting of forms. Does anyone know the cause of this?

Actually this error causes problems on session after it happens… I
prove it since I cannot login after this happens. Also I usually use
this command to fix this temporarily…

[sudo] killall -TERM dispatch.fcgi

EDIT: after some more testings, I found out that sometimes the
controller and action parameters are not being passed and the
controller that is being executed is the Application Controller. Does
any one knows how this happens?

See on the database is there is any row with out id
if not then pass id to controller by this
:id = object.id

On Tue, Mar 2, 2010 at 9:58 AM, ajibanda [email protected] wrote:

Ruby 1.8.6
DEFjY291bnQTOgpAY2hhdDA6HEBuZXdfcmVjb3JkX2JlZm9yZV9zYXZlMDoP
IEFjdGl2ZVN1cHBvcnQ6OlRpbWVXaXRoWm9uZVsIdTsHDSqIG4AAACBEIgtU
b24iACIHaWQiBjEiCnBob25lIi0oNjMpICgwNDUpIDMyMi02OTY2LCAoNjMp
NameError (uninitialized constant
80:in request_parameters' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb: dispatch’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:609:in `each’

[sudo] killall -TERM dispatch.fcgi
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Thanks:
Rajeev sharma

Thanks kannav for replying

I’m pretty sure that every row has an ID. I’ve been trying to look for
more details on this error and I found out more updates on this one. One
of these is that it happens randomly and this time not just on form
submitting. An example of this is on the Ajax part generated by
periodically_call_remote function on ruby that calls on a function that
has nothing to do with the database. I did check the log files and found
out that again it sends out only the authenticity_token where it suppose
to send the controller and action also. Weird thing is I can’t figure
out how and when this happen. I also notice that this only occurs on
POST requests only but that happens at a random events.

The bad thing about this is once the error occur, all the POST request
causes the same error for all session users. That makes also logging-in
on the application impossible. For me to make it work again, I usually
kill all dispatch.fcgi process.

I just hope you or someone can help me figure out this problem since
this one is urgent…:frowning:

Thanks,
Aj

kannav rajeev wrote:

See on the database is there is any row with out id
if not then pass id to controller by this
:id = object.id

On Tue, Mar 2, 2010 at 9:58 AM, ajibanda [email protected] wrote:

Ruby 1.8.6
DEFjY291bnQTOgpAY2hhdDA6HEBuZXdfcmVjb3JkX2JlZm9yZV9zYXZlMDoP
IEFjdGl2ZVN1cHBvcnQ6OlRpbWVXaXRoWm9uZVsIdTsHDSqIG4AAACBEIgtU
b24iACIHaWQiBjEiCnBob25lIi0oNjMpICgwNDUpIDMyMi02OTY2LCAoNjMp
NameError (uninitialized constant
80:in request_parameters' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb: dispatch’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:609:in `each’

[sudo] killall -TERM dispatch.fcgi
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Thanks:
Rajeev sharma

I did some checking on this and found out a line in vendor/rails/
action/pack/lib/action_controller/cgi_process.rb that goes like this

raw_post.force_encoding(Encoding::BINARY) if raw_post.respond_to?
(:force_encoding)

I commented this out and the application seems to work now, but I’m
not sure what this line is for… Can someone tell me?

TIA!