3

I have a Bugzilla 4.2.4 install that is now unable to send email. It was able to send email without issue up until about a month ago (after about three months without issue). If someone posts a comment, a new bug or anything else that should generate an email, after they hit submit the following page takes forever to time out but eventually comes back with "Internal Server Error".

Whatever they happen to be trying to do succeeds (bug gets created, file attached, comment posted, etc), so it appears that the problem is solely with generating the email. Following the official guide's advice for troubleshooting I've created any errorlog but the output is nebulous at best:

---------------------------------------------------------------------------
[11817] 06/03/13 13:02:02 global/code-error.html.tmpl mail_send_error 127.0.0.1
[11817] $env(ANSI_COLORS_DISABLED) = 1;
[11817] $env(HOME) = "/root";
[11817] $env(LOGNAME) = "root";
[11817] $env(OLDPWD) = "/root";
[11817] $env(PATH) = "/usr/lib:/usr/sbin:/usr/ucblib";
[11817] $env(PWD) = "/var/www/bugzilla";
[11817] $env(SHELL) = "/bin/sh";
[11817] $env(SHLVL) = 1;
[11817] $env(USER) = "root";
[11817] $env(_) = "/var/www/bugzilla/whine.pl";

---------------------------------------------------------------------------
[23266] 06/03/13 13:17:02 global/code-error.html.tmpl mail_send_error 127.0.0.1
[23266] $env(ANSI_COLORS_DISABLED) = 1;
[23266] $env(HOME) = "/root";
[23266] $env(LOGNAME) = "root";
[23266] $env(OLDPWD) = "/root";
[23266] $env(PATH) = "/usr/lib:/usr/sbin:/usr/ucblib";
[23266] $env(PWD) = "/var/www/bugzilla";
[23266] $env(SHELL) = "/bin/sh";
[23266] $env(SHLVL) = 1;
[23266] $env(USER) = "root";
[23266] $env(_) = "/var/www/bugzilla/whine.pl";

I've verified that SELinux isn't the issue by switching it into Permissive for the full duration of this troubleshooting, and I've created simple perl scripts that send my personal email account when invoked over Apache httpd. httpd's error_log doesn't have anything too interesting for this error:

[Wed Jun 12 13:21:20 2013] [warn] [client 152.xx.99.118] Timeout waiting for output from CGI script /var/www/bugzilla/post_bug.cgi, referer: http://bugs.xxx.edu/enter_bug.cgi?product=Banner%20INB
[Wed Jun 12 13:21:20 2013] [error] [client 152.xx.99.118] Premature end of script headers: post_bug.cgi, referer: http://bugs.xxx.edu/enter_bug.cgi?product=Banner%20INB

Basically, I'm unsure where to take it from here, I don't know how to get Bugzilla to give me more descriptive error information. I know that administratively I didn't change anything, there's plenty of processor time and storage space available, so I'm not sure why it all of a sudden broke.

This is on a RHEL5 machine with Perl 5.8.8

7

When I get stuck like this I'll often use strace to fish for clues.

Here's a handy one-liner to do it

ps -ef |grep apache |grep -v grep |awk '{print $2}' | while read pid ; do sudo strace -p$pid -o /tmp/strace.$pid & done

It gets all the apache pids, and attaches a strace to each of them, writing their output each to a different file in /tmp/

Once you've done that, reproduce the error, then kill all the strace processes:

sudo killall strace

Look for the biggest file(s) generated by strace, they will likely be the strace of the apache process(es) in question:

ls -lSrh /tmp/strace.*

See if there are any clues in there (lines that contain ENO or ERR are especially of interest).

  • 2
    +1. You'll probably want the -ff option to strace as well. – Stéphane Chazelas Jun 12 '13 at 22:05
1

Here are some additional items to try.

#1 - increase logging of Apache

Can you increase the logging level within Apache? As follows: LogLevel info. Details are here.

#2 - /var/log/maillog

Are there any additional messages that show up in /var/log/maillog when Bugzilla attempts to send email?

#3 - sending email

Can you send email from the box? I'd try it from the command line. You should be able to use the mail command to construct an email.

  • Yeah I can send email using the Perl scripts mentioned in the OP or from the command line. Nothing gets printed in the maillog so it looks like it doesn't even make it that far in the process. I'm about to try the log level and will let you know the results. – Bratchley Jun 18 '13 at 15:12
  • Unfortunately, it just gave me the same timeout error as in the OP. Is there an equivalent for mod_perl? That's basically the part that's messing with me. With PHP I can troubleshoot a little more easily but I don't have a point of reference on perl. – Bratchley Jun 18 '13 at 15:20
  • 1
    perl.apache.org/docs/1.0/guide/debug.html. There is this line you can add to the misbehaving perl script: use diagnostics; which might help. – slm Jun 18 '13 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.