Wednesday, June 14, 2006

Request-Tracker bug

I've finished installing Request-Tracker, a bug-tracking system, on a machine running Linux. Getting apache configured was a bit of a pain. When I finally got RT running under apache, I started getting the following message when I would restart apache:

No root path(s) specified at /usr/share/request-tracker3.4/libexec/webmux.pl line 112

To be clear, this error occurs while apache restarts. Apache-perl is running webmux.pl; it is included in the conf file.

I'm not the only one getting this problem; you can find this message using a Google search. But I couldn't find a reasonable explanation or solution.

Line 112 of webmux.pl looks like this:

rmtree([ bsd_glob("$RT::MasonDataDir/obj/*") ], 0, 1);

The command rmtree is used to remove files; bsd_glob is a command to expand a directory name containing a wildcard (among other things). So line 112 is just trying to remove all files and directories in the given directory.

I added some debugging code to print $RT::MasonDataDir and "$RT::MasonDataDir/obj" and the output of bsd_glob. Turns out that $RT::MasonDataDir is /var/cache/request-tracker3.4/mason_data. But the output of bsd_glob("$RT::MasonDataDir/obj/*") was empty - I got empty output from this debug line:

print bsd_glob("/var/cache/request-tracker3.4/mason_data/obj/*");


From this I surmised that rmtree does not like being passed the empty string, so I added a little workaround code, replacing line 112 with this:

my @adir = bsd_glob("$RT::MasonDataDir/obj/*");
if (@adir) {
   print "adir[0] is\n";
   print $adir[0];
   print "\n";
   rmtree([ @adir ], 0, 1);
} else {
   print "adir was empty\n";
}

(I'm not a great Perl programmer so I commented out the "rmtree" line while debugging.)

It turned out that if RT had been accessed via the web interface while apache was running, various directories and files would be created within that obj directory, and the first branch of the if statement would be taken; all non-hidden subdirectories and files of $RT::MasonDataDir/obj were removed (I checked).

Then if I restarted apache without using the RT web interface first, there were no new files or directories in the obj directory (I could see that). That's when the second branch of the if statement was taken. So now there are no errors; that's one problem solved.

0 Comments:

Post a Comment

<< Home