Re: Broken Camping (on Dreamhost)
Thanks Magnus!
Updating Rack to 1.1 worked. No idea what broke it in the first place
though since it definitely wasn't running Rack 1.1 before. Also, that
patch looks a lot like a patch I saw for Sinatra to address a similar
problem so I assume it would also work.
-Garret
On Wed, Jan 20, 2010 at 10:12 PM, Magnus Holm <judofyr@...> wrote:
> That's weird…
> First of all, could you update Rack to 1.1 and try with that version?
> If it's still broken, I think this monkey-patch should do it:
> class Rack::Request
> def params
> self.GET.update(self.POST)
> rescue EOFError, Errno::ESPIPE => e
> self.GET
> end
> end
> // Magnus Holm
>
>
> On Thu, Jan 21, 2010 at 06:19, Garret Buell <terragb@...> wrote:
>>
>> Hello all,
>> I'm running Camping 1.9.300 on DreamHost. Everything has been working
>> great for quite some time, then recently, visiting the Camping app
>> gives a 500 Internal Server Error. It seems as if something at
>> DreamHost was upgraded and now everything is broken. Even the basic
>> example Camping apps do not work so I suspect there is some
>> incompatibility with Camping and the current setup. I'm hoping someone
>> can help me figure out what is wrong.
>>
>> Here is the relevant error log data:
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***]
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:150:in
>> `rewind': Illegal seek (Errno::ESPIPE)
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:150:in
>> `POST'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:160:in
>> `params'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> (eval):30:in `initialize'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> (eval):50:in `new'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> (eval):50:in `call'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> dispatch.cgi:16
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in
>> `call'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in
>> `call'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/cgi.rb:33:in
>> `serve'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/cgi.rb:7:in
>> `run'
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] \tfrom
>> dispatch.cgi:19
>> [Wed Jan 20 18:08:06 2010] [error] [client ***.***.***.***] Premature
>> end of script headers: dispatch.cgi
>>
>> My dispatch.cgi worked previously and nothing has been modified but here
>> it is:
>> #!/usr/bin/ruby
>>
>> ENV['GEM_PATH'] = '/home/garret/.gems:/usr/lib/ruby/gems/1.8'
>> ENV['GEM_HOME'] = '/home/garret/.gems'
>>
>> Dir.chdir '/home/garret/admin.*****.com'
>>
>> require 'admin'
>> app = Admin
>>
>> fixed = lambda do |env|
>> r = env["REQUEST_URI"][0..(env["REQUEST_URI"].index("?")||0)-1]
>> d = r.length - (env["PATH_INFO"]||'/').length
>> env["SCRIPT_NAME"] = r[0...d]
>> env["PATH_INFO"] = r[d..-1]
>> app.call(env)
>> end
>>
>> Rack::Handler::CGI.run(fixed)
>>
>>
>> The
>> require 'admin'
>> app = Admin
>>
>> can be replaced with any of the sample apps I've found with the same
>> effect.
>>
>> Help?
>>
>> Thanks,
>> Garret Buell
>> _______________________________________________
>> Camping-list mailing list
>> Camping-list@...
>> http://rubyforge.org/mailman/listinfo/camping-list
>
>
> _______________________________________________
> Camping-list mailing list
> Camping-list@...
> http://rubyforge.org/mailman/listinfo/camping-list
>