How to resolve Rack Lint errors?

I noticed that some requests, especially from Uptime Robot to check page downtime, recently started to generate the following Rack Lint error in my Rails 3.1.x application:

21:47:05 web.1     | Started HEAD "/" for 74.86.158.106 at 2012-03-22 21:47:05 -0400
21:47:05 web.1     |   Processing by HomeController#index as */*
...
21:47:05 web.1     | /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/activesupport-3.1.4/lib/active_support/core_ext/string/output_safety.rb:23: warning: regexp match /.../n against to UTF-8 string
...
21:47:05 web.1     | Completed 200 OK in 81ms (Views: 60.3ms | ActiveRecord: 0.0ms)
21:47:05 web.1     | 74.86.158.106 - - [22/Mar/2012 21:47:05] "GET / HTTP/1.1" 200 31842 0.1993
21:47:05 web.1     | E, [2012-03-22T21:47:05.546848 #18938] ERROR -- : app error: Content-Length header was 31842, but should be 0 (Rack::Lint::LintError)
21:47:05 web.1     | E, [2012-03-22T21:47:05.546978 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/rack-1.3.6/lib/rack/lint.rb:19:in `assert'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547079 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/rack-1.3.6/lib/rack/lint.rb:501:in `verify_content_length'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547178 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/rack-1.3.6/lib/rack/lint.rb:525:in `each'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547277 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/rack-1.3.6/lib/rack/body_proxy.rb:23:in `method_missing'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547375 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/lib/unicorn/http_response.rb:41:in `http_response_write'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547476 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:538:in `process_client'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547574 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:604:in `worker_loop'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547672 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547770 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:137:in `start'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547867 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/gems/unicorn-4.2.0/bin/unicorn:121:in `<top (required)>'
21:47:05 web.1     | E, [2012-03-22T21:47:05.547966 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/bin/unicorn:19:in `load'
21:47:05 web.1     | E, [2012-03-22T21:47:05.548063 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125@project/bin/unicorn:19:in `<main>'

Any ideas on what could be happening here? I really do not find a solution right now that specifically decides what to do in this scenario in order to push and look for what can really happen.

+5
source share
2 answers

I know this is an old question, but I have the same problem. Requests from UptimeRobot and New Relic (and only from the IP addresses of the two) provide these log messages.

Both UptimeRobot and NewRelic report OK.

, , Rack::Lint , . . http_response_write ( ).

- .

UPDATE:

$ curl https://example.com -X HEAD -i
HTTP/1.1 200 OK
Server: nginx/1.6.2 (Ubuntu)
Date: Wed, 18 Nov 2015 09:17:11 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 18422
Connection: keep-alive
Status: 200 OK
...

curl: (18) transfer closed with 18422 bytes remaining to read

, , Rails HEAD .

UPDATE: . , , SSL.

+1

, Uptime . Content-length 0 ( ), 31842, , , .

- http, , , .

0

All Articles