[Cloudkit] OpenID and Passenger throwing Premature end of script headers

8 views
Skip to first unread message

crofty

unread,
Jun 15, 2009, 6:42:05 PM6/15/09
to CloudKit
Hi,
Passenger is throwing an error when I try and use the built in OpenID
authentication in cloudkit. The error is
"Premature end of script headers: login, referer: http://simple-cloudkit.local/login"

And the app is simply:
#config.ru
require 'cloudkit'
contain :notes

Going to "/" works, and going to "/login" works but then the error is
thrown when clicking 'sign in'. This process works fine if I start
the app with "rackup config.ru", the error is only thrown when using
passenger.
Specifying OpenID explicitly and taking out OAuth also throws the
error:

#config.ru
require 'cloudkit'
use Rack::Session::Pool
use CloudKit::OpenIDFilter
use CloudKit::Service, :collections => [:notes]

If I use 'expose' instead of 'contain' everything works correctly:
#config.ru
require 'cloudkit'
expose :notes

The versions of the gems are:
Cloudkit version: 0.11.2
Passenger version: 2.2.2

Any ideas on this?

crofty

unread,
Jun 15, 2009, 10:59:18 PM6/15/09
to CloudKit
Hi all,
I solved this in the end. The issue is with the openid gem trying to
write to STDERR by default. The 'Premature end of script headers'
error is thrown when writing to STDERR with Passenger. The fix for
this is to set the OpenID logger in the config.ru file, e.g.
require 'cloudkit'
use Rack::Session::Pool
use CloudKit::OpenIDFilter
OpenID::Util.logger = Logger.new('log/log.log') # ADD THIS LINE
use CloudKit::Service, :collections => [:notes]

or simply

require 'cloudkit'
contain :notes
OpenID::Util.logger = Logger.new('log/log.log') # ADD THIS LINE


James
Reply all
Reply to author
Forward
0 new messages