Hello guys, I’m developing a new app in Rails, and every now and then
I get an ActiveRecord error, I cannot reproduce exactly what triggers
it, hope you can help me, or give me tips on debugging this kind of
stuff. This time I got the error reporting page, but normally I would
just see the 500.html page, with no info about what went wrong.
This is the error (it’s the complete text from the error page):
===============================================================
ActiveRecord::StatementInvalid in ShopController#new_order
Mysql::Error: Lost connection to MySQL server during query: UPDATE
sessions SET data =
‘BAh7BzoIYmFnbzoIQmFnCDoLQGl0ZW1zWwA6DUBpbnZvaWNlMDoMQGNsaWVu\ndDAiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh\nc2h7AAY6CkB1c2VkewA=\n’,
session_id = ‘3b490c37bd1d8b9553807982b19e23bd’, updated_at =
‘2006-10-16 17:41:00’ WHERE id = 1
RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:122:in
log' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:224:inexecute’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:239:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1781:inupdate_without_lock’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:60:in
update_without_callbacks' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:inupdate_without_timestamps’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/timestamp.rb:48:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1774:increate_or_update_without_callbacks’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:242:in
create_or_update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1530:insave_without_validation’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/validations.rb:749:in
save_without_transactions' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:120:insave’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:86:intransaction’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:112:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:120:insave’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:863:insilence’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in
update' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:314:inclose’
c:/development/ruby/lib/ruby/1.8/cgi/session.rb:330:in close' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1155:inclose_session’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1200:in
process_cleanup_without_flash' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/flash.rb:146:inprocess_cleanup_without_filters’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:657:in
process_cleanup_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:inprocess_cleanup_without_components’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/components.rb:176:in
process_cleanup' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:432:inprocess_without_filters’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:620:in
process_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:inprocess’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in
process' #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:indispatch’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/rails.rb:73:in
process' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:551:inprocess_client’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in
process_client' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:956:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:127:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:357:in
load' #{RAILS_ROOT}/vendor/rails/railties/lib/commands/servers/mongrel.rb:48 c:/development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:364:in
require' #{RAILS_ROOT}/vendor/rails/railties/lib/commands/server.rb:39 c:/development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
script/server:3
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:122:in
log' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:224:inexecute’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:239:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1781:inupdate_without_lock’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:60:in
update_without_callbacks' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:inupdate_without_timestamps’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/timestamp.rb:48:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1774:increate_or_update_without_callbacks’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:242:in
create_or_update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1530:insave_without_validation’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/validations.rb:749:in
save_without_transactions' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:120:insave’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:86:intransaction’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:112:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:120:insave’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:863:insilence’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:307:in
update' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:314:inclose’
c:/development/ruby/lib/ruby/1.8/cgi/session.rb:330:in close' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1155:inclose_session’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1200:in
process_cleanup_without_flash' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/flash.rb:146:inprocess_cleanup_without_filters’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:657:in
process_cleanup_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:inprocess_cleanup_without_components’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/components.rb:176:in
process_cleanup' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:432:inprocess_without_filters’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:620:in
process_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:inprocess’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in
process' #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:indispatch’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/rails.rb:73:in
process' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:551:inprocess_client’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in
process_client' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:956:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:127:in
run' c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:inrun’
c:/development/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:357:in
load' #{RAILS_ROOT}/vendor/rails/railties/lib/commands/servers/mongrel.rb:48 c:/development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/dependencies.rb:364:in
require' #{RAILS_ROOT}/vendor/rails/railties/lib/commands/server.rb:39 c:/development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
script/server:3
Request
Parameters: None
Show session dump
:bag: !ruby/object:Bag
client:
invoice:
items: []
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers: {“Status”=>“500 Internal Error”, “cookie”=>[],
“Content-Type”=>“text/html; charset=utf-8”,
“Cache-Control”=>“no-cache”}
===============================================================
Thanks in advance.
Adrián.