From: Joe Van Dyk <joe@tanga.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Rack content-length Rack::Lint::LintErrors errors with unicorn
Date: Fri, 12 Aug 2011 12:22:32 -0700 [thread overview]
Message-ID: <CACfv+pKdx-W=jU+mioHJHwzfxQE5CbxT43rqATwzdCkJbPZbSQ@mail.gmail.com> (raw)
In-Reply-To: <CACfv+pJZbptb=Q-yhZa-DeTPiSkU5CtvAtPq0Rv+6+OXxgGXEw@mail.gmail.com>
On Fri, Aug 12, 2011 at 11:09 AM, Joe Van Dyk <joe@tanga.com> wrote:
> On Thu, Aug 11, 2011 at 10:42 PM, Eric Wong <normalperson@yhbt.net> wrote:
>> Joe Van Dyk <joe@tanga.com> wrote:
>>> Has anyone seen anything like this before? I can get it to happen all
>>> the time if I issue a HEAD request, but it only happens very
>>> intermittently on GET requests.
>>>
>>> I'm using Ruby 1.9.2p180.
>>>
>>> Any ideas on where to start debugging?
>>
>> What web framework and other middlewares are you running? Are you using Rack::Head to
>> generate HEAD responses or something else?
>
> Rails 3.0. I'm not doing anything special with HEAD requests. I
> actually don't care about the HEAD requests -- you'll note that I'm
> doing a GET request below. The Content-Length is 37902 (which is
> should be), but apparently there's nothing in the response body?
Here's another example, the body is apparently empty, but the
content-length is set on a 302 request. Unfortunately, I can't
reproduce the problem consistently. :( I'd expect the body to not be
0 here.
216.14.95.14, 10.195.114.81 - - [12/Aug/2011 12:00:46] "GET
/deals/current/good_till_gone HTTP/1.0" 302 195 0.0148
app error: Content-Length header was 195, but should be 0
(Rack::Lint::LintError)
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/rack-1.2.3/lib/rack/lint.rb:19:in
`assert'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/rack-1.2.3/lib/rack/lint.rb:501:in
`verify_content_length'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/rack-1.2.3/lib/rack/lint.rb:525:in
`each'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_response.rb:41:in
`http_response_write'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:526:in
`process_client'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:585:in
`worker_loop'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/newrelic_rpm-3.0.1/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:12:in
`call'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/newrelic_rpm-3.0.1/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:12:in
`block (4 levels) in <top (required)>'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:475:in
`spawn_missing_workers'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/lib/unicorn/http_server.rb:135:in
`start'
/mnt/data/tanga/current/bundler/ruby/1.9.1/gems/unicorn-4.0.1/bin/unicorn:121:in
`<top (required)>'
/data/tanga/current/sites/tanga/bin/unicorn:16:in `load'
/data/tanga/current/sites/tanga/bin/unicorn:16:in `<main>'
>
>>> 204.93.223.151, 10.195.114.81 - - [11/Aug/2011 21:03:50] "GET /
>>> HTTP/1.0" 200 37902 0.5316
>>> app error: Content-Length header was 37902, but should be 0
>>> (Rack::Lint::LintError)
>>> /mnt/data/tanga/current/bundler/ruby/1.9.1/gems/rack-1.2.3/lib/rack/lint.rb:19:in
>>> `assert'
>>> /mnt/data/tanga/current/bundler/ruby/1.9.1/gems/rack-1.2.3/lib/rack/lint.rb:501:in
>>> `verify_content_length'
>>
>> Looking at the 1.2.3 rack/lint.rb code, it should've set @head_request to true
>> when env["REQUEST_METHOD"] == "HEAD" (rack/lint.rb line 56).
>> Do you happen to have any middlewares that might rewrite REQUEST_METHOD?
>>
>> I would edit rack/lint.rb and put some print statements to show the
>> value of @head_request and env["REQUEST_METHOD"]
>>
>> --
>> Eric Wong
>> _______________________________________________
>> Unicorn mailing list - mongrel-unicorn@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
>> Do not quote signatures (like this one) or top post when replying
>>
>
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
next prev parent reply other threads:[~2011-08-12 19:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 4:39 Rack content-length Rack::Lint::LintErrors errors with unicorn Joe Van Dyk
2011-08-12 5:42 ` Eric Wong
2011-08-12 18:09 ` Joe Van Dyk
2011-08-12 19:22 ` Joe Van Dyk [this message]
2011-08-12 22:36 ` Eric Wong
2011-08-13 4:09 ` Joe Van Dyk
2011-08-13 4:51 ` Eric Wong
2011-08-13 7:24 ` Joe Van Dyk
2011-08-13 8:29 ` Eric Wong
2011-08-13 7:29 ` Joe Van Dyk
2011-08-13 8:17 ` Eric Wong
2011-08-22 20:13 ` Joe Van Dyk
2011-08-22 20:38 ` Eric Wong
2011-08-23 18:22 ` Joe Van Dyk
2011-08-23 18:29 ` Joe Van Dyk
2011-08-23 19:54 ` Joe Van Dyk
2011-08-23 20:00 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACfv+pKdx-W=jU+mioHJHwzfxQE5CbxT43rqATwzdCkJbPZbSQ@mail.gmail.com' \
--to=joe@tanga.com \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).