Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange behavior in Rails 4.2.0.beta2 - Is this a bug?

Get a 500 error on every other window reload.

assets/application-CACHE-.js not found. No Idea what is causing it. Development environment. Using Unicorn as my webserver. Anyone know what this is?

17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /blog HTTP/1.1" 200 - 0.2885
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /about-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0110
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /blog-14053fca722628f43031ae06cb18c52c.css?body=1 HTTP/1.1" 304 - 0.0110
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /contact-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0112
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /layouts/partials/footer-71929e4ed77e723296d6a937e6469653.css?body=1 HTTP/1.1" 304 - 0.0116
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /portfolio-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0133
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /layouts/partials/navigation-1d28f98b6c63feaf0bd6b06fb5873475.css?body=1 HTTP/1.1" 304 - 0.0136
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /resources-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0130
17:07:13 web.1  | Rack::Lint::LintError: Content-Type header found in 304 response, not allowed
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:20:in `assert'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:651:in `block in check_content_type'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:647:in `each'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:647:in `check_content_type'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:58:in `_call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:37:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/showexceptions.rb:24:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/commonlogger.rb:33:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/chunked.rb:54:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/content_length.rb:15:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in `process_client'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in `worker_loop'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/unicorn:23:in `load'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/unicorn:23:in `<main>'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /resume-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0139
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /welcome-64845c436e75ac587deec98177291d4e.css?body=1 HTTP/1.1" 304 - 0.0138
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /jquery-6a50177757f6c64493882fb7aae952c3.js?body=1 HTTP/1.1" 304 - 0.0148
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/affix-04c58ad484d0bdbdf9514b7d09505d25.js?body=1 HTTP/1.1" 304 - 0.0141
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET %2Fassets%2Fapplication-2e47777fcdd4d7b3353ccfc1718b4f0c.css?body=1 HTTP/1.1" 500 68784 0.0266
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/button-c9d4d44342d7be7abeb23fb0edbe00b7.js?body=1 HTTP/1.1" 304 - 0.0219
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/carousel-b0f1e7b56803d98d500f5ccc15d550e3.js?body=1 HTTP/1.1" 304 - 0.0150
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/alert-8186e091f2fa7c9423e9cadae6ce4de4.js?body=1 HTTP/1.1" 304 - 0.0258
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/collapse-417aacb8b3257798b481ed397b421b7c.js?body=1 HTTP/1.1" 304 - 0.0158
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/tab-dec75af9b2ffeed03dc43eabdb771d48.js?body=1 HTTP/1.1" 304 - 0.0123
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/dropdown-f5a24e96d563b9a6d252c1c07a6ecc6b.js?body=1 HTTP/1.1" 304 - 0.0142
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/modal-82015eda5031618c5aba3ebf9fc2cf4b.js?body=1 HTTP/1.1" 304 - 0.0123
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/transition-3005c626234d995c29e4bcbd07b3ac0c.js?body=1 HTTP/1.1" 304 - 0.0138
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/scrollspy-f421d662af4612a610656bfeee3407d9.js?body=1 HTTP/1.1" 304 - 0.0140
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap-sprockets-99470846ba99b7073a929a36d4cee32a.js?body=1 HTTP/1.1" 304 - 0.0139
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/tooltip-5e9e765caafcbcb1672a3e72ef7f4a3a.js?body=1 HTTP/1.1" 304 - 0.0158
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /bootstrap/popover-df8ed104d2525bbc4b4dad060e68cf99.js?body=1 HTTP/1.1" 304 - 0.0211
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /jquery_ujs-03cb26c4b41579fc5e95ea8f47ac5e18.js?body=1 HTTP/1.1" 304 - 0.0148
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /turbolinks-ebcce04d6463d2d77b51c18291df6925.js?body=1 HTTP/1.1" 304 - 0.0162
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /about-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0140
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /blog-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0145
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /contact-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0164
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /portfolio-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0178
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /resources-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0131
17:07:13 web.1  | Rack::Lint::LintError: Content-Type header found in 304 response, not allowed
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:20:in `assert'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:651:in `block in check_content_type'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:647:in `each'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:647:in `check_content_type'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:58:in `_call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/lint.rb:37:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/showexceptions.rb:24:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/commonlogger.rb:33:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/chunked.rb:54:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/rack-1.6.0.beta/lib/rack/content_length.rb:15:in `call'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in `process_client'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in `worker_loop'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/unicorn:23:in `load'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/unicorn:23:in `<main>'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
17:07:13 web.1  |   /Users/fab/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /resume-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0131
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET /welcome-32740fa4bc301ff5ef2eca5d8d82335a.js?body=1 HTTP/1.1" 304 - 0.0147
17:07:13 web.1  | 127.0.0.1 - - [15/Oct/2014:17:07:13 -0400] "GET %2Fassets%2Fapplication-c17db73b14421ee3a4d7e97bd3a6041c.js?body=1 HTTP/1.1" 500 68757 0.0217

Every other page reload I get 500 internal error assets not found:

GET http://localhost:5000/assets/application-ddb2488b062b582487dc9a71475f69b3.css?body=1 
GET http://localhost:5000/assets/application-89761eef2e06fafdfbe675623cff99d7.js?body=1  
like image 884
MrPizzaFace Avatar asked Oct 15 '14 21:10

MrPizzaFace


1 Answers

Yes, it seems to be a bug (or not?). When assets was precompiled with:

RAILS_ENV=production bin/rake assets:precompile

and in config/environments/development.rb :

config.assets.digest = true

as it is true by default there in Rails 4.2 (Release Notes, Pull Request), you will be getting this bug in development environment, doesn't matter what server you use (I am getting it on both WEBrick and Thin). As I understand it, it tries to get precompiled assets from /public/assets, but fails because of

Content-Type header found in 304 response, not allowed

or something like this.

You could avoid this behaviour by cleaning /public/assets every time you start development with:

bin/rake assets:clobber

or by turning off asset digests in development config:

config.assets.digest = false

or by turning off static assets serving in development config:

config.assets.digest = true
config.serve_static_assets = false
like image 147
gpchelkin Avatar answered Oct 10 '22 07:10

gpchelkin