[Catalyst-dev] Dropping characters when using fastcgi

Stefan Seifert nine at detonation.org
Wed Feb 16 10:08:10 GMT 2011


On Wednesday 16 February 2011 09:58:45 Tomas Doran wrote:
> On 10 Oct 2010, at 03:51, Michael Brutsch wrote:
> > I'm trying to run Catalyst on a shared server.  I've installed all
> > the modules, downloaded and run all the tests in chapter 8 of the
> > Catalyst::Manual::Tutorial, and everything seems to check out.  I've
> > followed the steps in the first two chapters of said tutorial, and
> > everything works fine when I run the development server.  My shared
> > provider, however, has forbidden me to run the development server,
> > and asked that I use fastcgi.

Is your provider using mod_fastcgi and compression? There is a bug in released 
versions of mod_fastcgi that causes a wrong content-length header to be sent 
if compression is activated. We use the latest snapshot for this reason.

> > I followed the steps in this wiki
> > page (http://wiki.dreamhost.com/Catalyst) to get the fastcgi
> > configured, and the welcome page loads properly.  However, when I
> > try to run the 'Hello, World" test, it drops the final few
> > characters; all I get is "He".  The next couple of example do the
> > same; they appear to work properly, the error log looks normal, but
> > it drops the last few characters of output.  I verified this by
> > adding extra characters to the end; when I do, I get the entire
> > "Hello, World".

The Wiki page you linked even has a section on GZIP /FASTCGI talking about the 
mod_fastcgi problem.

> HTTP traces of what's actually happening and your app source code
> would be helpful...
> 
> Are you using the Unicode plugin (either of them), or are you
> outputting non-ascii? The mismatch between characters and bytes could
> be causing the Content-Length to be miscalculated...

Only for characters that take more than one byte in UTF-8, so "hello world" 
should be completely safe.
 
> Other than that, I'm stuck for ideas without a whole lot more info.

Stefan



More information about the Catalyst-dev mailing list