unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Getting a strange cookie error
@ 2010-01-22  6:30 Travis Bell
  2010-01-22 20:06 ` Travis Bell
  0 siblings, 1 reply; 6+ messages in thread
From: Travis Bell @ 2010-01-22  6:30 UTC (permalink / raw)
  To: mongrel-unicorn

Hey guys,

I've been developing with Thin since day 1 (many months) and today, as I started moving everything to test on production (with Unicorn) started getting this weird error.

I am using Sinatra, and have been setting my cookies like so:

         response.set_cookie('foo', {
            :value => "bar",
            :path => '/',
            :expires => Time.today+14400
         })

In Thin, Webrick, Passenger, this seems to work fine. However in Unicorn I get a big fat ugly error:

# Rack::Lint::LintError at /login
# a header value must be a String, but the value of 'Set-Cookie' is a Array
# /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb: in assert, line 18

I'm not really sure what this means since :value is a string. I am using the following versions:

- REE (1.8.7-2010.01)
- Rack 1.1.0
- Unicorn 0.96.0
- Latest Sinatra from source

Does anyone have any input as to why this is happening? I have been able to re-produce this on a 32-bit CentOS box and my local MacBook Pro (Snow Leopard).


Cheers,

-- 
Travis Bell
http://www.twitter.com/travisbell
http://www.twitter.com/themoviedb



_______________________________________________
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting a strange cookie error
  2010-01-22  6:30 Getting a strange cookie error Travis Bell
@ 2010-01-22 20:06 ` Travis Bell
  2010-01-22 21:48   ` Eric Wong
  2010-01-22 23:29   ` Travis Bell
  0 siblings, 2 replies; 6+ messages in thread
From: Travis Bell @ 2010-01-22 20:06 UTC (permalink / raw)
  To: mongrel-unicorn

Just a follow up, it looks like it was rack 1.1.0 causing the issues. I uninstalled it, and am now using rack 1.0.1 and the error has gone away.

Why it worked with Thin + Rack 1.1.0 and not Unicorn, still not sure.


Cheers guys.

-- 
Travis Bell
http://www.twitter.com/travisbell
http://www.twitter.com/themoviedb



On 2010-01-21, at 11:30 PM, Travis Bell wrote:

> Hey guys,
> 
> I've been developing with Thin since day 1 (many months) and today, as I started moving everything to test on production (with Unicorn) started getting this weird error.
> 
> I am using Sinatra, and have been setting my cookies like so:
> 
>         response.set_cookie('foo', {
>            :value => "bar",
>            :path => '/',
>            :expires => Time.today+14400
>         })
> 
> In Thin, Webrick, Passenger, this seems to work fine. However in Unicorn I get a big fat ugly error:
> 
> # Rack::Lint::LintError at /login
> # a header value must be a String, but the value of 'Set-Cookie' is a Array
> # /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb: in assert, line 18
> 
> I'm not really sure what this means since :value is a string. I am using the following versions:
> 
> - REE (1.8.7-2010.01)
> - Rack 1.1.0
> - Unicorn 0.96.0
> - Latest Sinatra from source
> 
> Does anyone have any input as to why this is happening? I have been able to re-produce this on a 32-bit CentOS box and my local MacBook Pro (Snow Leopard).
> 
> 
> Cheers,
> 
> -- 
> Travis Bell
> http://www.twitter.com/travisbell
> http://www.twitter.com/themoviedb
> 
> 
> 

_______________________________________________
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting a strange cookie error
  2010-01-22 20:06 ` Travis Bell
@ 2010-01-22 21:48   ` Eric Wong
  2010-01-22 23:03     ` Eric Wong
  2010-01-22 23:29   ` Travis Bell
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Wong @ 2010-01-22 21:48 UTC (permalink / raw)
  To: unicorn list

Travis Bell <travis@meticulo.com> wrote:
> Just a follow up, it looks like it was rack 1.1.0 causing the issues.
> I uninstalled it, and am now using rack 1.0.1 and the error has gone
> away.
> 
> Why it worked with Thin + Rack 1.1.0 and not Unicorn, still not sure.

Sorry, I keep getting distracted/interrupted while looking into this,
it's probably related to the Rack::Utils::HeaderHash optimizations[1] in
Rack 1.1.0 somehow interacting badly with Sinatra + Rack::Lint

But Sinatra uses Rack::Response, so it shouldn't happen, but somehow
it does, I'll look at it more when I get a chance.


[1] - I made those optimizations to Rack, too :<

-- 
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting a strange cookie error
  2010-01-22 21:48   ` Eric Wong
@ 2010-01-22 23:03     ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2010-01-22 23:03 UTC (permalink / raw)
  To: unicorn list

Eric Wong <normalperson@yhbt.net> wrote:
> Travis Bell <travis@meticulo.com> wrote:
> > Just a follow up, it looks like it was rack 1.1.0 causing the issues.
> > I uninstalled it, and am now using rack 1.0.1 and the error has gone
> > away.
> > 
> > Why it worked with Thin + Rack 1.1.0 and not Unicorn, still not sure.
> 
> Sorry, I keep getting distracted/interrupted while looking into this,
> it's probably related to the Rack::Utils::HeaderHash optimizations[1] in
> Rack 1.1.0 somehow interacting badly with Sinatra + Rack::Lint
> 
> But Sinatra uses Rack::Response, so it shouldn't happen, but somehow
> it does, I'll look at it more when I get a chance.

HI Travis,

I can't seem to reproduce this with Sinatra
466cc74b8f393f98de227122c78ed55cb745cbc6, and Rack 1.1.0 with a basic
"hello world" application.  I'll need to know more about what your
application does with response headers...

Are you running any other middlewares or patches that could affect
things inside Rack::Response or Rack::Utils?

Unicorn takes a very strict interpretation of the Rack spec and always
loads Rack::Lint in development mode.  This makes Unicorn much more
picky about applications/middleware that don't completely conform to the
Rack spec.

Thin itself doesn't appear to load Rack::Lint by default, but does
running your application with "rackup -s thin -E development..." let you
reproduce the failures you see with Unicorn?

Thanks for any more info you can give us!

-- 
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting a strange cookie error
  2010-01-22 20:06 ` Travis Bell
  2010-01-22 21:48   ` Eric Wong
@ 2010-01-22 23:29   ` Travis Bell
  2010-01-28 22:19     ` Eric Wong
  1 sibling, 1 reply; 6+ messages in thread
From: Travis Bell @ 2010-01-22 23:29 UTC (permalink / raw)
  To: mongrel-unicorn

Hi Eric,

Thanks for looking into this. I'll strip down my app and do a similar "Hello World" version and see how I make out. I will give that method of loading Thin a try too.

Report back when I know more.


Thanks!

-- 
Travis Bell




On 2010-01-22, at 1:06 PM, Travis Bell wrote:

> Just a follow up, it looks like it was rack 1.1.0 causing the issues. I uninstalled it, and am now using rack 1.0.1 and the error has gone away.
> 
> Why it worked with Thin + Rack 1.1.0 and not Unicorn, still not sure.
> 
> 
> Cheers guys.
> 
> -- 
> Travis Bell
> http://www.twitter.com/travisbell
> http://www.twitter.com/themoviedb
> 
> 
> 
> On 2010-01-21, at 11:30 PM, Travis Bell wrote:
> 
>> Hey guys,
>> 
>> I've been developing with Thin since day 1 (many months) and today, as I started moving everything to test on production (with Unicorn) started getting this weird error.
>> 
>> I am using Sinatra, and have been setting my cookies like so:
>> 
>>        response.set_cookie('foo', {
>>           :value => "bar",
>>           :path => '/',
>>           :expires => Time.today+14400
>>        })
>> 
>> In Thin, Webrick, Passenger, this seems to work fine. However in Unicorn I get a big fat ugly error:
>> 
>> # Rack::Lint::LintError at /login
>> # a header value must be a String, but the value of 'Set-Cookie' is a Array
>> # /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb: in assert, line 18
>> 
>> I'm not really sure what this means since :value is a string. I am using the following versions:
>> 
>> - REE (1.8.7-2010.01)
>> - Rack 1.1.0
>> - Unicorn 0.96.0
>> - Latest Sinatra from source
>> 
>> Does anyone have any input as to why this is happening? I have been able to re-produce this on a 32-bit CentOS box and my local MacBook Pro (Snow Leopard).
>> 
>> 
>> Cheers,
>> 
>> -- 
>> Travis Bell
>> http://www.twitter.com/travisbell
>> http://www.twitter.com/themoviedb
>> 
>> 
>> 
> 

_______________________________________________
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting a strange cookie error
  2010-01-22 23:29   ` Travis Bell
@ 2010-01-28 22:19     ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2010-01-28 22:19 UTC (permalink / raw)
  To: unicorn list

Travis Bell <travis@meticulo.com> wrote:
> Hi Eric,
> 
> Thanks for looking into this. I'll strip down my app and do a similar
> "Hello World" version and see how I make out. I will give that method
> of loading Thin a try too.
> 
> Report back when I know more.

Hi Travis (or anybody else listening), any updates/info on this issue?
Thanks!
_______________________________________________
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-28 22:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-22  6:30 Getting a strange cookie error Travis Bell
2010-01-22 20:06 ` Travis Bell
2010-01-22 21:48   ` Eric Wong
2010-01-22 23:03     ` Eric Wong
2010-01-22 23:29   ` Travis Bell
2010-01-28 22:19     ` Eric Wong

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).