Attachment_Fu and Premature end of script

7 views
Skip to first unread message

raygao

unread,
Feb 28, 2010, 2:39:45 PM2/28/10
to Phusion Passenger Discussions
Hi,

I am trying to write an application for my church. I have an option
for uploading images to a controller. It is using attachment_fu. It
works fine without any problem in Mongrel_rails.

But, when I tried to deploy it to Phusion Passenger, I consistently
gets "Premature end of script headers". And, I even set the httpd.conf
to debug. I still don't see any outputs from where ti is causing it.
It is pretty clear this problem only shows up in Phusion Passenger.
And, the problem is aways with uploading the file and Attachment_fu.

Is there a solution for this problem?

Many thanks,

-Ray

raygao

unread,
Feb 28, 2010, 2:39:54 PM2/28/10
to Phusion Passenger Discussions

Raymond Gao

unread,
Mar 5, 2010, 10:12:25 PM3/5/10
to Phusion Passenger Discussions
This is very strange. When I set the environment to 'development', everything works fine. But, when I set it to 'test' or 'production', I get 'Premature end of script headers' error.

Very strange.

-Ray


--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.


Raymond Gao

unread,
Mar 5, 2010, 10:26:31 PM3/5/10
to Phusion Passenger Discussions
Is it true, that you must get a license to run the Phusion Passenger in 'production' or 'test' mode?

-Ray

Hongli Lai

unread,
Mar 6, 2010, 5:07:38 AM3/6/10
to phusion-...@googlegroups.com
On Sat, Mar 6, 2010 at 4:26 AM, Raymond Gao <rayg...@gmail.com> wrote:
> Is it true, that you must get a license to run the Phusion Passenger in
> 'production' or 'test' mode?

No, Phusion Passenger is open source.

Which Rails version are you using? And have you tried looking in the
web server error log?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

raygao-gmail

unread,
Mar 6, 2010, 11:31:40 AM3/6/10
to phusion-...@googlegroups.com
Hi Hong,

I am using Rails 2.3.5 on Ruby 1.8.7 on Mac Snow Leopard (10.6)
When I change the RailsEnv => development. It works well. But, when I set it to 'test' or 'production', I get the following error.
This is apparent with Attachment_fu. The problem is due to file upload.

My setting is as follows:

    RailsEnv test    #works when it is development, not test or production
    RailsDefaultUser testuser
    ServerName postcard.localhost.com
    DocumentRoot /Users/testuser/NetBeansProjects/postcard/public
    ErrorLog /Users/testuser/NetBeansProjects/postcard/log/apache_fusion_error.log
    LogLevel debug
    PassengerLogLevel 3
    PassengerTempDir /Users/testuser/NetBeansProjects/postcard/log/temp
    CustomLog /Users/testuser/NetBeansProjects/postcard/log/apache_fusion_custom.log common
      <Directory /Users/testuser/NetBeansProjects/postcard/public>
         AllowOverride all              
         Options -MultiViews       
      </Directory>
</VirtualHost>

Log from the custom error file:
[Sat Mar 06 10:25:34 2010] [error] [client 127.0.0.1] Premature end of script headers: postcards, referer: http://postcard.localhost.com:3000/bundles/1/edit
[ pid=2327 file=ext/apache2/Hooks.cpp:684 time=2010-03-06 10:25:34.52 ]:
  The backend application (process 2331) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.

From the Browser:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, appfa...@appfactory.us and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


I am also attaching the log file here as well.
apache_fusion_custom.log
apache_fusion_error.log

Hongli Lai

unread,
Mar 6, 2010, 1:45:25 PM3/6/10
to phusion-...@googlegroups.com
On Sat, Mar 6, 2010 at 5:31 PM, raygao-gmail <rayg...@gmail.com> wrote:
> Hi Hong,
> I am using Rails 2.3.5 on Ruby 1.8.7 on Mac Snow Leopard (10.6)
> When I change the RailsEnv => development. It works well. But, when I set it
> to 'test' or 'production', I get the following error.
> This is apparent with Attachment_fu. The problem is due to file upload.

There's a bug in Rails 2.3.5 which causes some error messages not to
be displayed. Try applying the patch here:
https://rails.lighthouseapp.com/projects/8994/tickets/3577-failsafe-middleware-should-flush-the-logger
With this you might see a proper error message in the logs.

Raymond Gao

unread,
Mar 9, 2010, 8:59:31 AM3/9/10
to phusion-...@googlegroups.com
Hi,

Here is the mini app that I wrote to test this problem with Attachment_fu. I have spent quite bit of time. It is still acting erratically. Can someone please help me and look at the problem?

Thanks,

-Ray

postcard copy.zip
Reply all
Reply to author
Forward
0 new messages