Timeworked.pl requires every extension lib to be added?

So I’m testing out your time worked report, and I’m finding that each
and every extension I’ve added needs to be put in your “use lib”
line. Couldn’t you simplify this and use the same lib path
adjustment as the main RT instance? Or better yet, not include the
extensions? Do you really need them?

[rtweb@kininvie ~]$ ./timeworked.pl --startdate 2009-09-20 --enddate
2009-09-27 --queues Support --debug
DEBUG: Time zone offset is -25200.
DEBUG: Using starting date string 2009-09-20 07:00:00
DEBUG: Using ending date string 2009-09-27 07:00:00
Can’t locate RT/FM.pm in @INC (@INC contains: /d/u/rtweb/…/local/lib /
d/u/rtweb/…/lib /u/rtweb/rt38/lib /usr/local/lib/perl5/5.8.8/BSDPAN /
usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/
site_perl/5.8.8 /usr/local/lib/perl5/site_perl /usr/local/lib/
perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at /u/rtweb/rt38/lib/
RT.pm line 628.

  • edits use lib line…

$ ./timeworked.pl --startdate 2009-09-20 --enddate 2009-09-27 --queues
Support --debug
DEBUG: Time zone offset is -25200.
DEBUG: Using starting date string 2009-09-20 07:00:00
DEBUG: Using ending date string 2009-09-27 07:00:00
Can’t locate RT/Extension/ForkTicket.pm in @INC (@INC contains: /d/u/
rtweb/…/local/lib /d/u/rtweb/…/lib /u/rtweb/rt38/lib /u/rtweb/rt38/
local/plugins/RT-FM/lib /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/
lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /
usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/
local/lib/perl5/5.8.8 .) at /u/rtweb/rt38/lib/RT.pm line 628.

  • edits use lib line…

(next error)

  • smacks head against table

:wink:

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

Jo,

I did not experience that, the version I shared on the list is exactly
as it runs in my environment, it must be something specific to your RT
setup if you are needing to add multiple entries to the use lib line.
Others on the list have also used it successfully without having that
issue. Are you sure you are putting the root directory of the RT libs,
and not the full path to each and every lib?

As far as which modules are required - that’s largely a function of RT
modules using other RT modules - it’s not me using them directly. I use
only a handful, as you can see from the code.

It’s pretty standard perl use lib methodology I am using, I am not doing
anything fancy or unusual. It just needs to be pointed to the root of
wherever you installed your RT libs.

-FranOn 9/25/2009 8:02 PM, Jo Rhett wrote:

So I’m testing out your time worked report, and I’m finding that each
and every extension I’ve added needs to be put in your “use lib” line.
Couldn’t you simplify this and use the same lib path adjustment as the
main RT instance? Or better yet, not include the extensions? Do you
really need them?

[rtweb@kininvie ~]$ ./timeworked.pl --startdate 2009-09-20 --enddate
2009-09-27 --queues Support --debug
DEBUG: Time zone offset is -25200.
DEBUG: Using starting date string 2009-09-20 07:00:00
DEBUG: Using ending date string 2009-09-27 07:00:00
Can’t locate RT/FM.pm in @INC (@INC contains: /d/u/rtweb/…/local/lib
/d/u/rtweb/…/lib /u/rtweb/rt38/lib /usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at
/u/rtweb/rt38/lib/RT.pm line 628.

  • edits use lib line…

$ ./timeworked.pl --startdate 2009-09-20 --enddate 2009-09-27 --queues
Support --debug
DEBUG: Time zone offset is -25200.
DEBUG: Using starting date string 2009-09-20 07:00:00
DEBUG: Using ending date string 2009-09-27 07:00:00
Can’t locate RT/Extension/ForkTicket.pm in @INC (@INC contains:
/d/u/rtweb/…/local/lib /d/u/rtweb/…/lib /u/rtweb/rt38/lib
/u/rtweb/rt38/local/plugins/RT-FM/lib /usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .) at
/u/rtweb/rt38/lib/RT.pm line 628.

  • edits use lib line…

(next error)

  • smacks head against table

:wink:


Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and
other randomness

Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham

205.934.0653

I did not experience that, the version I shared on the list is
exactly as it runs in my environment, it must be something specific
to your RT setup if you are needing to add multiple entries to the
use lib line. Others on the list have also used it successfully
without having that issue. Are you sure you are putting the root
directory of the RT libs, and not the full path to each and every lib?

My original line pointed only to the root install of RT: /u/rtweb/rt38/
lib in this case.

As far as which modules are required - that’s largely a function of
RT modules using other RT modules - it’s not me using them
directly. I use only a handful, as you can see from the code.

No, these aren’t modules used by RT – they are plugins I have loaded
into my RT instance. RT finds all the libraries for them just
fine. Why don’t you use the same logic? Or frankly, why do you need
to load these extensions at all? I suspect that you need to ignore
the modules specified in Set( @Plugins, … ); (this is what it is
trying to load, and I can’t think of why timeworked.pl needs these
modules.

It’s pretty standard perl use lib methodology I am using, I am not
doing anything fancy or unusual. It just needs to be pointed to the
root of wherever you installed your RT libs.

Yes, it is. I’m quite familiar with “use lib” having been using it
for, oh, is it 15 years now? :wink:

It seems you might not have understood so let me be very clear:

  1. You are including RT.pm
  2. Some part of the initialization seems to be including all the
    library modules.
  3. You should either disable/force this not to happen, or do the same
    initialization that occurs such that these modules will be loaded
    without explicitly listing each one in “use lib”.

Below is a patch which works fine for me, and I believe you should
probably implement in the published version. All it does is clear the
“Plugins” array after loading the configuration but before calling
Init(), which avoids having timeworked.pl load extensions it doesn’t
need. On our system it made timeworked.pl visibly faster to the eye.

— timeworked.pl_orig 2009-09-26 01:22:43.000000000 -0700
+++ timeworked.pl 2009-09-26 01:23:01.000000000 -0700
@@ -238,6 +238,9 @@

Load the config file

RT::LoadConfig();

+# Override/Ignore any configured plugins
+RT::Config->Set( ‘Plugins’ => ‘’ );

Connect to the database and get RT::SystemUser loaded

RT::Init();

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

Jo,

Ah, that chunk of lib handling code is snagged from some of the RT code

  • that could be the cause of the issue, I don’t have too many added
    plugins in my RT instance so perhaps that’s why I am not seeing what you
    are. I think you may be the first person to have tested it who has a
    lot of added plugins, since this is the first report. I am sorry it was
    frustrating for you, but thanks for helping test. :slight_smile:

I am working on doing this over as an integrated RT extension so you may
be interested in waiting for that. By virtue of being an extension, it
doesn’t have to worry about any of this. I’m only a couple of days away
from being finished with it. I do plan to maintain the CLI version as
well, however. I will take a look at your patch and see if I can clean
up the script.

As I said when I first released it, this is my first attempt at doing
anything with the RT API, so be gentle. :slight_smile:

-Fran

Jo Rhett wrote:> On Sep 25, 2009, at 7:45 PM, Fran Fabrizio wrote:

I did not experience that, the version I shared on the list is
exactly as it runs in my environment, it must be something specific
to your RT setup if you are needing to add multiple entries to the
use lib line. Others on the list have also used it successfully
without having that issue. Are you sure you are putting the root
directory of the RT libs, and not the full path to each and every lib?

My original line pointed only to the root install of RT:
/u/rtweb/rt38/lib in this case.

As far as which modules are required - that’s largely a function of
RT modules using other RT modules - it’s not me using them directly.
I use only a handful, as you can see from the code.

No, these aren’t modules used by RT – they are plugins I have loaded
into my RT instance. RT finds all the libraries for them just
fine. Why don’t you use the same logic? Or frankly, why do you need
to load these extensions at all? I suspect that you need to ignore
the modules specified in Set( @Plugins, … ); (this is what it is
trying to load, and I can’t think of why timeworked.pl needs these
modules.

It’s pretty standard perl use lib methodology I am using, I am not
doing anything fancy or unusual. It just needs to be pointed to the
root of wherever you installed your RT libs.

Yes, it is. I’m quite familiar with “use lib” having been using it
for, oh, is it 15 years now? :wink:

It seems you might not have understood so let me be very clear:

  1. You are including RT.pm
  2. Some part of the initialization seems to be including all the
    library modules.
  3. You should either disable/force this not to happen, or do the same
    initialization that occurs such that these modules will be loaded
    without explicitly listing each one in “use lib”.

Below is a patch which works fine for me, and I believe you should
probably implement in the published version. All it does is clear the
“Plugins” array after loading the configuration but before calling
Init(), which avoids having timeworked.pl load extensions it doesn’t
need. On our system it made timeworked.pl visibly faster to the eye.

— timeworked.pl_orig 2009-09-26 01:22:43.000000000 -0700
+++ timeworked.pl 2009-09-26 01:23:01.000000000 -0700
@@ -238,6 +238,9 @@

Load the config file

RT::LoadConfig();

+# Override/Ignore any configured plugins
+RT::Config->Set( ‘Plugins’ => ‘’ );
+

Connect to the database and get RT::SystemUser loaded

RT::Init();

Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham

205.934.0653

Ah, that chunk of lib handling code is snagged from some of the RT
code - that could be the cause of the issue, I don’t have too many
added plugins in my RT instance so perhaps that’s why I am not
seeing what you are. I think you may be the first person to have
tested it who has a lot of added plugins, since this is the first
report. I am sorry it was frustrating for you, but thanks for
helping test. :slight_smile:

No worries. I hope you put that in the CLI version, since there’s no
value in loading the plugins. In fact, instead of calling Init() you
may want to look at Init() and just do a few of those steps. It will
make the CLI version a lot slimmer and meaner :wink:

I am working on doing this over as an integrated RT extension so you
may be interested in waiting for that. By virtue of being an
extension, it doesn’t have to worry about any of this. I’m only a
couple of days away from being finished with it. I do plan to
maintain the CLI version as well, however. I will take a look at
your patch and see if I can clean up the script.

Unfortunately my last day at this company is Wednesday so I’m doing
what I can for them before I leave :wink:

As I said when I first released it, this is my first attempt at
doing anything with the RT API, so be gentle. :slight_smile:

No worries, sorry if I was ungentle. I seem to come off more harsh
than I intend. It’s not personal, it’s very focused on the code/
problem/solution.

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

My original line pointed only to the root install of RT: /u/rtweb/rt38/
lib in this case.

I also have a lot of plugins and this is the “use lib” line that was
needed to cover them all:

use lib qw(/usr/local/share/request-tracker3.8/lib

/usr/share/request-tracker3.8/lib);

That is for Ubuntu Server, where RT is installed by “apt-get” in
/usr/share/request-tracker3.8/ and the “local” customizations,
including plugins, are under /usr/local/share/request-tracker3.8

A

My original line pointed only to the root install of RT: /u/rtweb/rt38/
lib in this case.

I also have a lot of plugins and this is the “use lib” line that was
needed to cover them all:

use lib qw(/usr/local/share/request-tracker3.8/lib

/usr/share/request-tracker3.8/lib);

That is for Ubuntu Server, where RT is installed by “apt-get” in
/usr/share/request-tracker3.8/ and the “local” customizations,
including plugins, are under /usr/local/share/request-tracker3.8

If you want RT::Init() RT::LoadCOnfig() to load your plugins, you do
need to add the local lib to your use lib or RT won’t pick up the
plugin lib paths.

-kevin