Hi,

I am using HTML::Mason and use the perl handler method of configuring it. I
occasionally get this error in error log (it causes a 500):

[Fri Nov 18 20:29:12 2005] [error] Caught a SIGPIPE at /etc/mason.pl line 52

Line 52 is where I get the Apache::Request object. Here is my handler:

...

sub handler {
  # Get the Apache request object
  my $r = Apache::Request->new(shift,
                               POST_MAX        => 1 * 1024 * 1024, # 1MB
                               DISABLE_UPLOADS => 0,
                               TEMP_DIR        => '/tmp/.uploadmason/',
                              );
    
  my $ah = new HTML::Mason::ApacheHandler(comp_root        =>
$r->document_root(),
                                          data_dir         =>
$r->document_root() . '/.mason',
                                          args_method      => 'mod_perl',
                                          dhandler_name    => 'dhandler.mh',
                                          autohandler_name =>
'autohandler.mh',
                                          error_mode       => 'fatal',
                                         );

  # only handle text
  return DECLINED
    if (defined($r->content_type) and $r->content_type !~ m|^text/|io);

  # get db connection
  $HTML::Mason::Commands::dbh = DBI->connect('DBI:mysql:database=###',
                                             '###',
                                             '###',
                                             {RaiseError => 1, AutoCommit =>
1},
                                            );

  # blank vars
  %HTML::Mason::Commands::vars = ();

  # set 'args_method' in %vars
  $HTML::Mason::Commands::vars{MASON}->{args_method} = $ah->args_method();

  # send mason powered header
  $r->headers_out->set('X-Powered-By' => 'HTML::Mason');

  my $status = $ah->handle_request($r);

  $HTML::Mason::Commands::dbh->disconnect();

  return $status;
}

I cannot find any refernces to this type of error. It is not the 'Caught
SIGPIPE' line you can find in the log if you use Apache::SIG to catch
stopped requests. However, I am not sure what it means!

Any help or pointers on debugging would be gratefully received!

Cheers,
Pete


----------------------------------------------------------------------------
Popcorn Web Design ltd
15A, Cambridge Road, Stansted, Essex CM24 8BX
t (direct): 0207 193 7022
t (office): 01279 812229
f: 0870 831 6999
www.popcornwebdesign.co.uk

This email is confidential. It may also be privileged or otherwise protected
by other legal rules. If you are not the intended recipient please notify
the sender immediately, and delete the message from all locations in your
computer. You should not copy the email or use it for any purpose, or
disclose its contents to any other person: To do so may be unlawful. Email
is subject to possible data corruption you should not rely on advice
contained in an email without obtaining written confirmation of it.

Reply via email to