Problem installing RTFM 2.2.0RC5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m trying to install RTFM 2.2.0RC5 on a ‘virtual private server’, where
everything must go inside my home directory and I’m a non-privileged user.
I’ve already had RT 3.6.3 installed and running fine, so I just followed
the install instructions in the RTFM distribution, modifying them to set
my appropriate environment variables for perl installations and for the
location of all my RT stuff.

I was able to complete the ‘perl Makefile.PL’ OK, since I passed it all
the proper settings for my environment variables. Also, ‘make install’
went fine: things got installed in the correct places. And all my perl
pre-reqs are properly installed (as shown by ‘make checkdeps’).

In fact, when I restart my apache and look at RT, I see all the RTFM
links. But when I try to create a class, I’m told that the table
‘rt3.FM_Classes’ doesn’t exist. This is, of course, because I hadn’t yet
run ‘make initdb’.

However, when I run ‘make initdb’, I get this message:

Couldn’t load RT config file /users/ist-rt/RT/rt/ist-rt/etc/RT_SiteConfig.pm
as user ist-rt / group ist-rt. The file is owned by user ist-rt and
group ist-rt. This usually means that the user/group your webserver is
running as cannot read the file. Be careful not to make the permissions
on this file too liberal, because it contains database passwords. You
may need to put the webserver user in the appropriate group (ist-rt) or
change permissions be able to run succesfully

But this is not correct! I am running as user ‘ist-rt’ and group
‘ist-rt’. My RT_SiteConfig.pm file is owned by user ist-rt and group
ist-rt, with permissions 0640. And, although I don’t see what my web
server has to do with this, the fact is that the web server also runs as
user ‘ist-rt’, group ‘ist-rt’.

So why is make initdb giving this complaint?

BTW: This is my first install of RTFM, so it’s not an upgrade.

Thanks.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRpaZ3q0bf1iNr4mCEQJfWACfZrK+oVYahnYd839s7FTij7HJNKQAn1+9
1Ig4jxAAWdU/gk6O1sW6W5cT
=bq9o
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Thu, 12 Jul 2007 at 14:15 (-0700), Mike Friedman wrote:

It turns out that the Makefile generated by Makefile.PL didn’t include my
…/local/lib in the ‘initdb’ target definition. So, I edited the Makefile
manually (which I know you’re not supposed to do, but I can’t figure out
how to correct Makefile.PL), to insert

-I"/users/ist-rt/RT/rt/ist-rt/local/lib"

before

-I"/users/ist-rt/RT/rt/ist-rt/lib"

in the Makefile ‘initdb’ target.

After I did this, ‘make initdb’ worked correctly.

Why didn’t the Makefile get generated correctly? Looking at Makefile.PL
isn’t very revealing by itself.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRpftMq0bf1iNr4mCEQKVvgCg0tG6wDTsfhRFZRbA5ZBPMQiJQI0AoIR1
0XeQZ8eJAfypQ7MveAPDwGNH
=8Bik
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It turns out that the Makefile generated by Makefile.PL didn’t
include my …/local/lib in the ‘initdb’ target definition. So, I
edited the Makefile manually (which I know you’re not supposed to
do, but I can’t figure out how to correct Makefile.PL), to insert

Out of curiosity, why do you need your local lib dir included for
RTIR’s initialization script?
Best,
Jesse

PGP.sig (186 Bytes)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Mon, 16 Jul 2007 at 13:49 (-0400), Jesse Vincent wrote:

It turns out that the Makefile generated by Makefile.PL didn’t include
my …/local/lib in the ‘initdb’ target definition. So, I edited the
Makefile manually (which I know you’re not supposed to do, but I can’t
figure out how to correct Makefile.PL), to insert

Out of curiosity, why do you need your local lib dir included for RTIR’s
initialization script?

Jesse,

I can’t say I understand it completely, but I figure it’s because I have a
local mod to RT.pm and it seems that when my local/lib isn’t present, the
‘make initdb’ has trouble finding some things. I say ‘some things’,
because I’m not exactly sure what the symptoms actually mean:

  1. One error message said RT_SiteConfig.pm couldn’t be loaded (and it did
    mention the correct path to to that file and the correct userid/groupid):

    Couldn’t load RT config file /users/ist-rt/RT/rt/ist-rt/etc/RT_SiteConfig.pm
    as user ist-rt / group ist-rt. The file is owned by user ist-rt and group
    ist-rt. This usually means that the user/group your webserver is running as
    cannot read the file. Be careful not to make the permissions on this file
    too liberal, because it contains database passwords. You may need to put
    the webserver user in the appropriate group (ist-rt) or change permissions
    be able to run successfully

    [Typos in the last sentence as in the original].

  2. The next message said it couldn’t find RT/Extension/BrandedQueues.pm,
    which is included at the bottom of my RT_SiteConfig.pm:

    Can’t locate RT/Extension/BrandedQueues.pm in @INC (@INC contains:
    inc lib /opt/rt3/local/lib /users/ist-rt/RT/rt/ist-rt/lib
    /users/ist-rt/lib/perl5 /users/ist-rt/lib/perl5/site_perl/5.8.8/i86pc-solaris-thread-multi
    /users/ist-rt/lib/perl5/site_perl/5.8.8 /users/ist-rt/lib/perl5/site_perl
    /users/ist-rt/lib/perl/5.8.8 /users/ist-rt/lib/perl /users/ist-rt/lib/perl/5.8.8
    /users/ist-rt/share/perl/5.8.8 /users/ist-rt/share/perl
    /users/ist-rt/share/perl/5.8.8 /opt/csw/lib/perl/5.8.8 /opt/csw/share/perl/5.8.8
    /opt/csw/lib/perl/site_perl /opt/csw/share/perl/site_perl
    /opt/csw/share/perl/site_perl /opt/csw/lib/perl/csw
    /opt/csw/share/perl/csw /opt/csw/share/perl/csw .) at
    /users/ist-rt/RT/rt/ist-rt/etc/RT_SiteConfig.pm line 623.
    BEGIN failed–compilation aborted at /users/ist-rt/RT/rt/ist-rt/etc/RT_SiteConfig.pm line 623.
    Compilation failed in require at /users/ist-rt/RT/rt/ist-rt/lib/RT.pm line 141.
    *** Error code 2

Nowhere in the above path does my local/lib appear.

I couldn’t figure out why it would try to look for the BrandedQueues stuff
if it couldn’t load my RT_SiteConfig.pm in the first place.

(Hmm, it occurs to me now that perhaps what the first message really meant
was just that it couldn’t load something it found inside
RT_SiteConfig.pm!).

So, I looked inside the Makefile and didn’t see any reference to my
local/lib, which made we wonder how it would find other things it might
need (I didn’t know exactly what those might be, but given that I have
some mods in local/lib, shouldn’t that always be in the search path?).

I was confused about what’s going on, but I inserted the reference to my
local/lib into the Makefile and the errors went away; ‘make initdb’ was
able to add the required RTFM tables to the database.

I would have liked to edit Makefile.PL, instead of the generated Makefile.
But the entire contents of Makefile.PL look like this:

use inc::Module::Install;
RTx('RT-FM');
name('RTFM');
version_from('lib/RT/FM.pm');
license('GPL version 2');
requires(
    perl              => 5.008,
    RT                => '3.4.2',
    Text::WikiFormat  => 0,
    Tree::Simple      => 0,
    HTML::TreeBuilder => 0,
    Time::ParseDate   => 0,
    HTML::FormatText  => 0,
    YAML              => 0,
);
auto_install();
&WriteAll;

which doesn’t really tell me how to get the results I (apparently) needed.

One more thing. I didn’t actually run ‘perl Makefile.PL’. Instead,
because of my ‘virtual private server’ environment, I had to run this:

perl Makefile.PL cat ../perl5prefs-ist-rt

where the file ‘…/perl5prefs-ist-rt’ contains settings of a bunch of
variables to tell Makefile.PL where actually to install stuff, especially
perl modules (i.e., in my home directory – /users/ist-rt – , not the
system perl libraries to which I don’t have write access):

PREFIX=/users/ist-rt/RT/rt/ist-rt/share \
INSTALLPRIVLIB=/users/ist-rt/share/perl/5.8.8
INSTALLSITELIB=/users/ist-rt/RT/rt/ist-rt/local/lib
INSTALLARCHLIB=/users/ist-rt/lib/perl/5.8.8
INSTALLSITEARCH=/users/ist-rt/lib/perl5/site_perl
INSTALLSITEBIN=/users/ist-rt/RT/rt/ist-rt/bin \
INSTALLSCRIPT=/users/ist-rt/RT/rt/ist-rt/sbin \
INSTALLSITEMAN1DIR=/users/ist-rt/lib/perl5/man \
INSTALLSITEMAN3DIR=/users/ist-rt/lib/perl5/man/man3 \
SITEARCHEXP=/users/ist-rt/lib/perl5/site_perl

Notice that (third line above) my RT local lib is specified, in case
'Makefile.PL needs to know where all my RT stuff is. (But apparently this
wasn’t enough to cause my local/lib to appear in the generated Makefile).

[BTW: the above ‘perl5pref-ist-rt’ file is the same as I had already used
to install the BrandedQueues Extension in this same environment, with no
problem].

Perhaps you have a better explanation of what’s going on here.

Thanks.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRpw7qq0bf1iNr4mCEQKQ6ACfYE+r1stV0BPM+R9K+ubAZJXieBcAniJW
O/5zJHoOydxXhVtom/UWqRtl
=vaLp
-----END PGP SIGNATURE-----

One more thing. I didn’t actually run ‘perl Makefile.PL’.
Instead, because of my ‘virtual private server’ environment, I had
to run this:

perl Makefile.PL cat ../perl5prefs-ist-rt

where the file ‘…/perl5prefs-ist-rt’ contains settings of a bunch
of variables to tell Makefile.PL where actually to install stuff,
especially perl modules (i.e., in my home directory – /users/ist-
rt – , not the system perl libraries to which I don’t have write
access):

Makefile.PL for RTFM normally prompts you to find RT.pm, which is how
it would know to look in your
local/lib

What happens if you do

PERL5LIB/users/ist-rt/RT/rt/ist-rt/local/lib perl Makefile.PL cat ../ perl5prefs-ist-rt

-kevin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Makefile.PL for RTFM normally prompts you to find RT.pm, which is how it
would know to look in your local/lib

Kevin,

Yes, it did. It turns out I gave it the path to the default RT.pm, not my
local/lib/RT.pm. But the contents are the same except for my mod which
changes ‘gmtime’ to ‘localtime’ for RT logging. In particular, the value
in RT.pm of ‘$LocalPath’ is the same, namely
‘/users/ist-rt/RT/rt/ist-rt/local’. Yet that’s not being put into the
RTFM Makefile:

In the Makefile, for the target ‘initdb’, this appears:

-Ilib -I/opt/rt3/local/lib -I"/users/ist-rt/RT/rt/ist-rt/lib"

rather than

-Ilib -I"/users/ist-rt/RT/rt/ist-rt/local/lib"  -I"/users/ist-rt/RT/rt/ist-rt/lib"

as I would have expected. That’s why I wound up making the above change
myself directly in the Makefile.

What happens if you do

PERL5LIB/users/ist-rt/RT/rt/ist-rt/local/lib perl Makefile.PL cat ../perl5prefs-ist-rt

I’m not clear on what that is supposed to mean; as shown above, it
wouldn’t work. (Also, my shell is tcsh, so I’m sure a different syntax is
required anyway).

BTW: My PERL5LIB environment variable is set to point to all my local perl
libraries:

/users/ist-rt/lib/perl5:/users/ist-rt/lib/perl5/site_perl:/users/ist-rt/lib/perl:/users/ist-rt/lib/perl/5.8.8:/users/ist-rt/share/perl:/users/ist-rt/share/perl/5.8.8

What I’d really like to know now is whether the variable settings as I
have them in my ‘perl5prefs’ file are correct for installing RT stuff with
Makefile.PL:

PREFIX=/users/ist-rt/RT/rt/ist-rt/share \
INSTALLPRIVLIB=/users/ist-rt/share/perl/5.8.8 \
INSTALLSITELIB=/users/ist-rt/RT/rt/ist-rt/local/lib \
INSTALLARCHLIB=/users/ist-rt/lib/perl/5.8.8 \
INSTALLSITEARCH=/users/ist-rt/lib/perl5/site_perl \
INSTALLSITEBIN=/users/ist-rt/RT/rt/ist-rt/bin \
INSTALLSCRIPT=/users/ist-rt/RT/rt/ist-rt/sbin \
INSTALLSITEMAN1DIR=/users/ist-rt/lib/perl5/man \
INSTALLSITEMAN3DIR=/users/ist-rt/lib/perl5/man/man3 \
SITEARCHEXP=/users/ist-rt/lib/perl5/site_perl

where

o /users/ist-rt/ is my home directory,
o /users/ist-rt/RT/rt/ist-rt is the directory under which
this RT instance is installed.

It took me a long time to figure out what those variable values should be,
based on what got expanded when I installed the BrandedQueues extension
using default values. The hard part was mapping default libraries into
the ones under my home directory.

Perhaps some of the above values are not correct. Could you tell me if
they look right, since these setting are what I would use whenever I use
Makefile.PL in the future?

Thanks.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRpz4eK0bf1iNr4mCEQLsvwCeKioZn0uQf5jRv3G7Xds3PMGyb9cAn1LN
CS/mwFfxjXdCI2sCpuYkhkUG
=B5yH
-----END PGP SIGNATURE-----