views:

549

answers:

2

Hello, I am using the ssl_requirements plugin on shared hosting account. This hosting provider uses Passenger to manage Rails. Everything works fine until I try to go to a page that requires ssl (enforced by adding the ssl_required filter). When this happens Passenger crashes and sends back a 500 error. The error reads:

 Passenger encountered the following error:
 The application spawner server exited unexpectedly: Broken pipe

 Exception class:
 PhusionPassenger::Railz::ApplicationSpawner::Error

Here is a basic scenario:

  1. User is using http to browse non-sensitive data.
  2. User goes to the signup form (where https is required)
  3. Ssl_requirement sees that user is not using the proper protocol and redirects them to a url that uses https.
  4. Passenger receives this request and tries to spawn a new rails application.
  5. When it uses the spawn_application method it encounters an error and crashes

The issue is that I don't know where the problem is occurring. I don't think it could be a problem with https because I can manually type in the https prefix and things will work fine. I believe that issue lies in either the ssl_requirement plugin or the way passenger handles this new https request.

Have you guys ever encountered a scenario like this? If so could you point to some resources to get this resolved?

Thanks.

A: 

Do you have access to your own virtual host Apache configuration? If so, then I would recommend that you configure that to redirect from the http URL to the https URL using the Redirect directive, instead of using ssl_requirement. I've done so, with Passenger, and things work just fine. (So there's no problem with Passenger handling https or ssl. My guess is some incompatibility between the ssl_requirement plugin and Passenger.)

insane.dreamer
I think this is what I am going do, but how did you set up your development environment?
vrish88
I have my development environment on a separate server (on a local network) and a different apache configuration without https. But you could just have two virtual hosts on the same server, one with SSL and one without.
insane.dreamer
+1  A: 

You're probably getting the Passenger error because DreamHost killed your app for using too much memory.

Given that you're using spawn, that's probably the reason - spawn creates a whole new Rails process.

Try doing something that doesn't involve spawning a new app instance. I would bet however that it is NOT a matter of SSL.

Sai Emrys