Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nazarhussain opened this issue Jan 17, 2013 · 12 comments
Open

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

nazarhussain opened this issue Jan 17, 2013 · 12 comments

Comments

@nazarhussain
Copy link

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
Copy link

quainjn commented Apr 3, 2013

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

@SamSaffron
Copy link
Owner

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

@quainjn
Copy link

quainjn commented Jun 4, 2013

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
Copy link

Me too! The lasted branch still broke!

@etagwerker
Copy link

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
Copy link

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

@SamSaffron SamSaffron reopened this Sep 26, 2013
@z5h
Copy link

z5h commented Dec 20, 2013

Same error rack-mini-profiler (0.1.31)

@rahult
Copy link

rahult commented Feb 10, 2014

Same error rack-mini-profiler (0.9.0)

@EverybodyKurts
Copy link

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

@jamilabreu
Copy link

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

@d4rky-pl
Copy link

d4rky-pl commented Mar 6, 2014

Yep, still a problem.

@manuelmeurer
Copy link

Seems like it's fixed in 0.9.1.

dgmstuart added a commit to dgmstuart/swing-out-london that referenced this issue Oct 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests