SamSaffron / MiniProfiler

A simple but effective mini-profiler for ASP.NET MVC, ASP.NET and Ruby.
http://miniprofiler.com
1.05k stars 220 forks source link

Fragment cache can't modify frozen object error rails 3 #106

Open nazarhussain opened 11 years ago

nazarhussain commented 11 years ago

Hi, I faced some issues with fragment caching while using that gem. Please look at the link http://stackoverflow.com/questions/14347602/fragment-cache-cant-modify-frozen-object-error-rails-3/14377501#14377501 for more details.

Please address the issue, is it some bug in your gem or some other issue in AR.

quainjn commented 11 years ago

I experienced the exact same issue and removing this gem fixed it for me.

SamSaffron commented 11 years ago

I think I just pulled a PR that fixes this, can you try grabbing latest from github to confirm its fixed?

quainjn commented 11 years ago

Still broken for me. Re-added the gem yesterday, and immediately started getting the same error: "NoMethodError: undefined method `result' for #<RuntimeError: can't modify frozen object>"

[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1147:in `translate_exception'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:284:in `rescue in log'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in `exec_query'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/relation.rb:66:in `insert'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/persistence.rb:367:in `create'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/timestamp.rb:58:in `create'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/callbacks.rb:268:in `block in create'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:403:in `_run__2623713900290707479__create__4318799009460945156__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/callbacks.rb:268:in `create'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/persistence.rb:348:in `create_or_update'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/callbacks.rb:264:in `block in create_or_update'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:480:in `_run__2623713900290707479__save__4318799009460945156__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/callbacks.rb:264:in `create_or_update'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/persistence.rb:84:in `save'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/validations.rb:50:in `save'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/attribute_methods/dirty.rb:22:in `save'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:208:in `transaction'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:259:in `block in save'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
[GEM_ROOT]/gems/activerecord-3.2.13/lib/active_record/transactions.rb:258:in `save'
ryancheung commented 11 years ago

Me too! The lasted branch still broke!

etagwerker commented 11 years ago

I'm also running into this issue. I'm trying with master and I'm getting this:

RuntimeError: can't modify frozen object: ROLLBACK

ActiveRecord::StatementInvalid (RuntimeError: can't modify frozen object: UPDATE `users` SET `last_request_at` = '2013-07-04 18:40:00', `perishable_token` = 'qenY3ShlD5ofURVg3oD', `updated_at` = '2013-07-04 18:40:00' WHERE `users`.`id` = 8):
  app/controllers/application_controller.rb:80:in `current_user_session'
  app/controllers/application_controller.rb:66:in `current_user'
  app/helpers/liquid/application_helper.rb:114:in `wrapped_product'
  app/helpers/liquid/application_helper.rb:121:in `block in wrapped_products'
  app/helpers/liquid/application_helper.rb:121:in `map'
  app/helpers/liquid/application_helper.rb:121:in `wrapped_products'
  app/controllers/products_controller.rb:117:in `products_index'
  app/controllers/products_controller.rb:34:in `index'

Any ideas? Thanks!

variousred commented 11 years ago

getting the same exact error as @etagwerker rack-mini-profiler (0.1.31)

z5h commented 10 years ago

Same error rack-mini-profiler (0.1.31)

rahult commented 10 years ago

Same error rack-mini-profiler (0.9.0)

EverybodyKurts commented 10 years ago

I get this error as well. This happens to me in my custom Devise::OmniauthCallbacksController. Removing rack-mini-profiler immediately fixes this problem.

jamilabreu commented 10 years ago

+1 for this error on edge rails (4.1.0.rc1)

d4rky-pl commented 10 years ago

Yep, still a problem.

manuelmeurer commented 10 years ago

Seems like it's fixed in 0.9.1.