rtomayko / rack-cache

Real HTTP Caching for Ruby Web Apps
http://rtomayko.github.io/rack-cache/
Other
822 stars 126 forks source link

undefined method `upcase' for nil:NilClass #157

Open fadyZohdy opened 5 years ago

fadyZohdy commented 5 years ago

we are using jruby-9.2.4 with rails 5.2.2 and rack-cache 1.8.0 and are currently facing this issue

cache error: undefined method `upcase' for nil:NilClass
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/storage.rb:36:in `create_store'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/storage.rb:18:in `resolve_metastore_uri'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:34:in `metastore'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:173:in `lookup'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:66:in `call!'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:51:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/workspace/optima/BulkWhiz_commons/BulkWhiz/app/middleware/log_item_view.rb:31:in `_call'
/Users/fady/workspace/optima/BulkWhiz_commons/BulkWhiz/app/middleware/log_item_view.rb:7:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/workspace/optima/BulkWhiz_commons/BulkWhiz/app/middleware/log_request.rb:23:in `_call'
/Users/fady/workspace/optima/BulkWhiz_commons/BulkWhiz/app/middleware/log_request.rb:7:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/sentry-raven-2.7.4/lib/raven/integrations/rack.rb:51:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/aws-xray-sdk-0.11.1/lib/aws-xray-sdk/facets/rack.rb:43:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/newrelic_rpm-5.6.0.349/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/puma-3.12.0-java/lib/puma/configuration.rb:225:in `call'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/puma-3.12.0-java/lib/puma/server.rb:658:in `handle_request'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/puma-3.12.0-java/lib/puma/server.rb:472:in `process_client'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/puma-3.12.0-java/lib/puma/server.rb:332:in `block in run'
/Users/fady/.rvm/gems/jruby-9.2.4.0/gems/puma-3.12.0-java/lib/puma/thread_pool.rb:133:in `block in spawn_thread'

any help would be appreciated 🙏

grosser commented 5 years ago

https://github.com/rtomayko/rack-cache/blob/master/lib/rack/cache/storage.rb#L35

so the uri you are passing to the store has no scheme ... double check how you are setting it up or bundle open rack-cacke and dump what it is being called with