[Rt-devel] Multi-instance patch

Oliver Hookins oliver.hookins at anchor.com.au
Tue Dec 20 01:23:59 EST 2005


Bob Goldstein wrote:
>>>Your problem may be that RT_INSTANCE_PATH needs to point to a full
>>>instance.  So, for me, when I set RT_INSTANCE_PATH=/var/rt3_purchasing the
>>>config that gets used is /var/rt3_purchasing/etc/RT_SiteConfig.pm.  Notice
>>>that RT fills in the "/etc/" part of the path automatically.
>>> $ ls /var/rt3_purchasing/
>>> etc  lib  local  var
>>> $ ls /var/rt3_purchasing/etc
>>> RT_Config.pm  RT_SiteConfig.pm
>>
>>OK so I have instead (outside of the virtualhost tags):
>>FastCgiServer 
>>/home/testguy/usr/share/request-tracker3.4/libexec/mason_handler.fcgi 
>>-initial-env RT_INSTANCE_PATH=/home/testguy
>>
>>I am using /home/USERNAME for all of my separate instances. Using this, 
>>I get a 500 internal server error from the webpage, and the following in 
>>the apache error log:
>>
>>Can't locate /etc/request-tracker3.4/RT_SiteConfig.pm in @INC (@INC 
>>contains: /usr/local/share/request-tracker3.4/lib 
>>/usr/share/request-tracker3.4/lib /etc/perl /usr/local/lib/perl/5.8.4 
>>/usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 
>>/usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at 
>>/usr/share/request-tracker3.4/lib/RT.pm line 176.
>>BEGIN failed--compilation aborted at 
>>/usr/share/request-tracker3.4/libexec/webmux.pl line 85.
>>Compilation failed in require at 
>>/home/testguy/usr/share/request-tracker3.4/libexec/mason_handler.fcgi 
> 
> 
> 
> That seems a little odd to me.  Just checking, but take a look
> at RT.pm.  Near the top, you should see something like this:

This is what I have:

$VERSION = '3.4.1';
$CORE_CONFIG_FILE = "/etc/request-tracker3.4/RT_Config.pm";
$SITE_CONFIG_FILE = "/etc/request-tracker3.4/RT_SiteConfig.pm";

$BasePath = '/usr/share/request-tracker3.4';

and later on after the =cut:

...
     my $RT_INSTANCE_PATH = $args{RT_INSTANCE_PATH} || 
$ENV{RT_INSTANCE_PATH};
     if ($RT_INSTANCE_PATH) {
         foreach my $vref (@variables) {
             $$vref =~ s/^\Q$BasePath\E/$RT_INSTANCE_PATH/;
         }
     }
     foreach my $vref (@variables) {
         $$vref = $args{$vref} if defined ( $args{$vref} );
     }

use strict 'refs';
}

> should turn $SITE_CONFIG_FILE into /home/testguy/etc/request-tracker3.4/RT_SiteConfig.pm
> 
> (I'm guessing at your directory structure, so this may not be exactly right for you.)
> 
> Yet your error message doesn't say anything about this file, it leaves
> off the /home/testguy part.

Yeah... this is the core problem.

> If I were debugging this, I'd add some logging or print statements
> to verify the changes in all the variables in the above loop,
> and to verify that $RT_INSTANCE_PATH is set correctly,
> since it seems to me, you are already in trouble by the time
> you leave the RT::import() routine.

I'm not very good with Perl, so if you can suggest some debugging 
methods I'll try to use them.

-- 
Regards,
Oliver Hookins
Anchor Systems


More information about the Rt-devel mailing list