unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Lucas Parry <lucas@envato.com>
To: mongrel-unicorn@rubyforge.org
Subject: Bug in unicorn_rails when Encoding.default_internal is set
Date: Fri, 17 Feb 2012 13:29:01 +1100	[thread overview]
Message-ID: <CAMXxzZvtyy2XZ2JvT6onrxJLuroybm9sfZ+gpCE_GrU5iAjUMg@mail.gmail.com> (raw)

Hi,

We recently made the switch to 1.9 for our large rails 2.3.14 project
and ran into some strange behavior from the unicorns where encoding
problem would cause blank 500 pages to be "randomly" served to users
(we run ~10 x 5 unicorn workers behind our load balancer). We found
that unicorn workers were dying when someone requested a url with
utf-8 in it, and died in such a way that subsequent requests to that
worker would get the same blank 500 page even for plain ascii urls.

I've been able to recreate this behavior one a fresh rails project by
setting Encoding.default_internal to utf-8 and very little else. I've
created an example repo at:

    https://github.com/lparry/how_to_kill_a_unicorn

All you need to do is hit http://localhost:8080/users/☃ and the
unicorn worker will die with an error:

"Error during failsafe response: "\xE2" from ASCII-8BIT to UTF-8"
"app error: "You have a nil object when you didn't expect it!\nYou
might have expected an instance of Array.\nThe error occurred while
evaluating nil.each" (NoMethodError)"

All subsequent requests to that worker will fail with the same exception.

Is this a known issue? Is there a recommended work around?

Cheers,

Lucas Parry
Envato
_______________________________________________
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

             reply	other threads:[~2012-02-17  6:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  2:29 Lucas Parry [this message]
2012-02-17  2:37 ` Bug in unicorn_rails when Encoding.default_internal is set Lucas Parry
2012-02-17  3:59   ` 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=CAMXxzZvtyy2XZ2JvT6onrxJLuroybm9sfZ+gpCE_GrU5iAjUMg@mail.gmail.com \
    --to=lucas@envato.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).