Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

instance of IO needed (Rails 3.2.0.rc1) #4042

Closed
leandromaioral opened this Issue · 24 comments
@leandromaioral

I'm keep getting this error in Rails 3.2.0.rc1 (previously using Rails 3.1.3 without errors):

instance of IO needed

Extracted source (around line #17):

14:     = favicon_link_tag asset_path('apple-touch-icon.png'), rel: 'apple-touch-icon', type: 'image/png'
15: 
16:     /[if lt IE 9]
17:       = javascript_include_tag "html5"
18:       = javascript_include_tag "chrome_frame"
19: 
20:     = stylesheet_link_tag "application"
@tenderlove
Owner

Can you paste in the full stack trace? Thanks.

@leandromaioral

Here is the full trace, thanks!

activesupport (3.2.0.rc1) lib/active_support/cache.rb:581:in `load'
activesupport (3.2.0.rc1) lib/active_support/cache.rb:581:in `value'
activesupport (3.2.0.rc1) lib/active_support/cache.rb:325:in `block in read'
activesupport (3.2.0.rc1) lib/active_support/cache.rb:521:in `instrument'
activesupport (3.2.0.rc1) lib/active_support/cache.rb:316:in `read'
sprockets (2.1.2) lib/sprockets/caching.rb:70:in `cache_get'
sprockets (2.1.2) lib/sprockets/caching.rb:45:in `cache_get_hash'
sprockets (2.1.2) lib/sprockets/caching.rb:15:in `cache_asset'
sprockets (2.1.2) lib/sprockets/index.rb:88:in `build_asset'
sprockets (2.1.2) lib/sprockets/base.rb:163:in `find_asset'
sprockets (2.1.2) lib/sprockets/index.rb:56:in `find_asset'
sprockets (2.1.2) lib/sprockets/environment.rb:74:in `find_asset'
sprockets (2.1.2) lib/sprockets/base.rb:171:in `[]'
actionpack (3.2.0.rc1) lib/sprockets/helpers/rails_helper.rb:126:in `asset_for'
actionpack (3.2.0.rc1) lib/sprockets/helpers/rails_helper.rb:27:in `block in javascript_include_tag'
actionpack (3.2.0.rc1) lib/sprockets/helpers/rails_helper.rb:26:in `collect'
actionpack (3.2.0.rc1) lib/sprockets/helpers/rails_helper.rb:26:in `javascript_include_tag'
app/views/layouts/application.html.haml:17:in `_app_views_layouts_application_html_haml___2703650624366173367_70271109244140'
actionpack (3.2.0.rc1) lib/action_view/template.rb:143:in `block in render'
activesupport (3.2.0.rc1) lib/active_support/notifications.rb:121:in `instrument'
actionpack (3.2.0.rc1) lib/action_view/template.rb:141:in `render'
actionpack (3.2.0.rc1) lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
actionpack (3.2.0.rc1) lib/action_view/renderer/template_renderer.rb:37:in `render_template'
actionpack (3.2.0.rc1) lib/action_view/renderer/template_renderer.rb:12:in `render'
actionpack (3.2.0.rc1) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.2.0.rc1) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.2.0.rc1) lib/abstract_controller/rendering.rb:115:in `_render_template'
actionpack (3.2.0.rc1) lib/action_controller/metal/streaming.rb:225:in `_render_template'
actionpack (3.2.0.rc1) lib/abstract_controller/rendering.rb:109:in `render_to_body'
actionpack (3.2.0.rc1) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
actionpack (3.2.0.rc1) lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
actionpack (3.2.0.rc1) lib/abstract_controller/rendering.rb:94:in `render'
actionpack (3.2.0.rc1) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.0.rc1) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/Leandro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
activesupport (3.2.0.rc1) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.0.rc1) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:39:in `render'
actionpack (3.2.0.rc1) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.2.0.rc1) lib/action_controller/metal/mime_responds.rb:268:in `block in retrieve_response_from_mimes'
actionpack (3.2.0.rc1) lib/action_controller/metal/mime_responds.rb:195:in `call'
actionpack (3.2.0.rc1) lib/action_controller/metal/mime_responds.rb:195:in `respond_to'
app/controllers/posts_controller.rb:14:in `index'
actionpack (3.2.0.rc1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.0.rc1) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.0.rc1) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.0.rc1) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:421:in `_run__201954251865145123__process_action__4096402866541878466__callbacks'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:412:in `__run_keyed_callback'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:389:in `_run_process_action_callbacks'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0.rc1) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.0.rc1) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.0.rc1) lib/active_support/notifications.rb:119:in `block in instrument'
activesupport (3.2.0.rc1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.0.rc1) lib/active_support/notifications.rb:119:in `instrument'
actionpack (3.2.0.rc1) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.0.rc1) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
activerecord (3.2.0.rc1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.0.rc1) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.0.rc1) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.0.rc1) lib/action_controller/metal.rb:199:in `dispatch'
actionpack (3.2.0.rc1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.0.rc1) lib/action_controller/metal.rb:242:in `block in action'
actionpack (3.2.0.rc1) lib/action_dispatch/routing/route_set.rb:66:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/routing/route_set.rb:66:in `dispatch'
actionpack (3.2.0.rc1) lib/action_dispatch/routing/route_set.rb:30:in `call'
journey (1.0.0.rc1) lib/journey/router.rb:60:in `block in call'
journey (1.0.0.rc1) lib/journey/router.rb:48:in `each'
journey (1.0.0.rc1) lib/journey/router.rb:48:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/routing/route_set.rb:570:in `call'
omniauth (1.0.1) lib/omniauth/strategy.rb:168:in `call!'
omniauth (1.0.1) lib/omniauth/strategy.rb:148:in `call'
omniauth (1.0.1) lib/omniauth/builder.rb:34:in `call'
sass (3.1.12) lib/sass/plugin/rack.rb:54:in `call'
client_side_validations (3.1.3) lib/client_side_validations/middleware.rb:18:in `call'
warden (1.1.0) lib/warden/manager.rb:35:in `block in call'
warden (1.1.0) lib/warden/manager.rb:34:in `catch'
warden (1.1.0) lib/warden/manager.rb:34:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.5) lib/rack/etag.rb:23:in `call'
rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.0.rc1) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:395:in `_run_call_callbacks'
activesupport (3.2.0.rc1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/reloader.rb:63:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0.rc1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0.rc1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0.rc1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0.rc1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0.rc1) lib/rails/engine.rb:479:in `call'
rack (1.3.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.0.rc1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
/Users/Leandro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/Leandro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/Leandro/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
@kaluznyo

Same : This error is thrwon for each GET assets like : Started GET "/assets/facebook_connect.png" for 127.0.0.1 at 2011-12-20 11:31:28 +0100

@virtualfunction

+1, again using HAML, this seems to be a trend here given some other HAML uses seem to have raised this

@feldpost

This is not HAML related. I'm having the same issue using ERB. Both javascript_include_tag and stylesheet_link_tag are causing this error. (Ruby 1.9.3, pow)

@trosen-r7

Also having same issue /w ERB, also using Ruby 1.9.3

@kennyj
Collaborator

Hey every one !

According to the stacktrace, it seems that Marshal.load throws exception and the @value (in cache.rb) is not IO (or ducktyping other classes).

Please tell us your cache configuration(config.cache_classes / config.cache_store / config.action_controller.perform_caching ...and so on), Rails.env.
And could you provide a minimum reproducible application ? (if it is easy, you could tell us reproduce step)

@leandromaioral

My "config/environments/development.rb":

MyApp::Application.configure do
  config.cache_classes = false
  config.whiny_nils = true
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.action_mailer.raise_delivery_errors = false
  config.active_support.deprecation = :log
  config.action_dispatch.best_standards_support = :builtin
  config.assets.compress = false
  config.assets.debug = true
  config.action_mailer.default_url_options = { host: AppConfiguration::DOMAIN }
  config.action_mailer.delivery_method = :ses
end

The only diference between this and a newly generated Rails 3.2.0.rc1 app is:

+ config.active_record.mass_assignment_sanitizer = :strict
+ config.active_record.auto_explain_threshold_in_seconds = 0.5

- config.action_mailer.default_url_options = { host: AppConfiguration::DOMAIN }
- config.action_mailer.delivery_method = :ses
@feldpost

@kennyj is correct. What gets passed to Marshal.load (active_support/cache.rb Line 581) is not an IO type but instead a Hash:

{"class":"BundledAsset","logical_path":"application.css","pathname":"$root/app/assets/stylesheets/application.css","content_type":"text/css","mtime":"2011-11-17T20:31:58-06:00","length":54633,"digest":"b7a8d3bf38f870a8afc0e0318d0bb5cd","source":"<the css source>","required_assets_digest":"5079cf852a3b47d768bb1c8f84c31d90","_version":"334780944ca955913e695585788b2def"}
@michaelsd

I'm having exactly the same problem. Upgraded from Rails 3.1 to 3.2.0rc1. First problem was the file quiet_assets.rb in config/initializers. After deleting it rails would start, but as soon as i access the index page rails will throw the aforementioned error. This is a very basic app, a simple webshop without any fancy stuff going on. The only complex piece is device as authentication controller.
Exception is:

instance of IO needed

Extracted source (around line #6):

6: <%= stylesheet_link_tag "application", :media => "all" %>

Is there any solution found yet?

@bwalding

It's a crime against monkey-patching (and probably has some unexpected side-effects somewhere else, but at least it got my app back up and running after the upgrade)

# Add to config/initializers/cache.rb
module ActiveSupport
  module Cache
    class Entry
      def value
        if @value
          return @value.to_s if @value.is_a?(Hash)
          Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value)
        end
      end
    end
  end
end
@tenderlove
Owner

@bwalding can you do a puts caller when the @value is a hash? I'd like to see the trace when the value is a hash.

Also, I can't seem to reproduce this, so if anyone could push a minimal app the reproduces it, I would appreciate it.

@bwalding

@tenderlove Interestingly, I removed the monkey-patch that I had above, and now the bug isn't triggered any more. I'm not 100% sure where that "@value" is coming from - is it coming out of memcached?

If so, perhaps resetting memcached would have fixed it in development. If I see it happen again I will post back here.

(For reference I upgraded from 3.1.3 to 3.2.0rc1 - no application changes (it was my first attempted page load on 3.2.0rc1) - using memcached)

@kaluznyo

@tenderlove

If I add your puts callers I have this :

"/Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/cache.rb:325:in block in read' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/cache.rb:521:ininstrument' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/cache.rb:316:in read' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/caching.rb:70:incache_get' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/caching.rb:45:in cache_get_hash' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/caching.rb:15:incache_asset' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/index.rb:88:in build_asset' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/base.rb:163:infind_asset' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/index.rb:56:in find_asset' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/environment.rb:74:infind_asset' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.1.2/lib/sprockets/server.rb:47:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.0.rc3/lib/journey/router.rb:60:inblock in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.0.rc3/lib/journey/router.rb:48:in each' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.0.rc3/lib/journey/router.rb:48:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/routing/route_set.rb:570:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.1/lib/omniauth/strategy.rb:168:incall!' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.1/lib/omniauth/strategy.rb:148:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.1/lib/omniauth/builder.rb:34:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/airbrake-3.0.9/lib/airbrake/rack.rb:27:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/best_standards_support.rb:17:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/etag.rb:23:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/conditionalget.rb:25:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/head.rb:14:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/params_parser.rb:21:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/flash.rb:242:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:195:incontext' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:190:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/cookies.rb:338:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0.rc1/lib/active_record/query_cache.rb:64:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:395:in_run_call_callbacks' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:81:in run_callbacks' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/callbacks.rb:27:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/reloader.rb:63:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/remote_ip.rb:31:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/show_exceptions.rb:56:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/rack/logger.rb:26:in call_app' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/rack/logger.rb:16:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/request_id.rb:22:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/methodoverride.rb:24:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/runtime.rb:17:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0.rc1/lib/active_support/cache/strategy/local_cache.rb:72:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/lock.rb:15:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0.rc1/lib/action_dispatch/middleware/static.rb:53:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/airbrake-3.0.9/lib/airbrake/user_informer.rb:12:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/engine.rb:479:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/content_length.rb:14:in call' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0.rc1/lib/rails/rack/log_tailer.rb:14:incall' /Users/olivierkaluzny/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/handler/webrick.rb:59:in service' /Users/olivierkaluzny/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:inservice' /Users/olivierkaluzny/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in run' /Users/olivierkaluzny/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:inblock in start_thread'"

But like @bwalding, the @value is a hash only the first time. After, the "monkey-patch" is useless. and the error isn't triggerd.

FYI : If I load my app with my front (asset/front) with the "monkey-patch" it's work without next, but in my back, (asset/admin) I need to load my app also with the patch. So the patch must be load, on each "folder" on asset. Something like this...

UPDATE : Sometime.. this bug come back.. just don't know when

@juwalter

Hi guys,

had the same troubles - albeit only on my CI server and thankfully reproducible, since I didn't clear the ActiveSupport::Cache::FileStore for each run ... rails runner "Rails.cache.clear" fixed the issue for me.

I also upgraded from Rails 3.1 to 3.2.0.rc1 and I noticed that this commit https://github.com/rails/rails/blob/a263f377978fc07515b42808ebc1f7894fafaa3a/activesupport/lib/active_support/cache.rb#L577 changed the default handling of cache entries: from now on, all cache entries (values) get the Marshalling treatment, whereas before, the values were only marshalled when cache compression was on.

Not sure, how to deal with this, I can imagine a lot of long faces when folks start upgrading their pre 3.2 apps (no problem when they start with a fresh 3.2 app) and run into that issue.

Can you think of a good way to notify/warn those who are upgrading??

@tenderlove
Owner

@juwalter thanks for tracking this down. Not totally sure how to handle this. Let me think for a bit.

Maybe @bdurand has ideas.

@tenderlove tenderlove was assigned
@gazay

Same thing in rails 4.0.0beta. For me helps removing tmp/cache.
I think the problem is in different marshaling with 3.1:
I can't here paste text from my cache files, but you can get them from gist: https://gist.github.com/1520922

@gazay

I made a patch #4196

@thelazycamel

rails runner "Rails.cache.clear" worked for me thanks @juwalter

@michaelsd

After using @bwalding 's monkey patch my application was working fine again. I removed the patch and it's still working. So i guess it has the same effect as @juwalter 'cache clear' solution. Thanks to all of you for your help.

@tenderlove
Owner

I've merged @gazay's patch, so I'm closing this.

@tenderlove tenderlove closed this
@kieranklaassen

Rails.cache.clear did the trick for me too in Rails 3.2.1

@mech

I have an issue with it. I have 2 production Rails app in 1 machine. Rails 3.0.7 for website and Rails 3.2.0 for mobile site.
I want to share 1 single memcached server between these 2 app. But because of the way value is implemented, I always get back String if 3.2.0 is the first guy getting key. This causes 3.0.7 to get back String while 3.2.0 is okay.

If 3.0.7 is the first guy request the key, then both app will work. It is only when 3.2.0 request first, then it return string :( instead of Ruby object.

@apolzon

Using Rails 3.2.5. Rails.cache.clear fixed the issue. Only see this problem on Heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.