Error during compilation Chart

Hi,

After do a migrate RT I get the following error when try to show values on some portlets
I have installed the following components over perl -MCPAN -e shell

install GD
install GD::Text
install GD::Graph::bar
install GD::Graph

Anybody know what’s the exact problem or know how to resolve it?

[error]: could not find component for path '/Elements/OwnerSummary'

Stack:
  [/opt/rt/share/html/Dashboards/Elements/ShowPortlet/component:55]
  [/opt/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard:79]
  [/opt/rt/share/html/Dashboards/Render.html:153]
  [/opt/rt/share/html/Dashboards/dhandler:50]
  [/opt/rt/sbin/../lib/RT/Interface/Web.pm:697]
  [/opt/rt/sbin/../lib/RT/Interface/Web.pm:376]
  [/opt/rt/share/html/autohandler:53] (/opt/rt/sbin/../lib/RT/Interface/Web/Handler.pm:209)

[error]: Error during compilation of /opt/rt/share/html/Search/Chart:
Can't locate GD/Text.pm in @INC (@INC contains: /opt/rt/sbin/../local/lib /opt/rt/sbin/../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/rt/share/html/Search/Chart fline 59.

thanks in advance

If you look at one of the files in /opt/rt4/sbin like rt-server the first line of that file tells you which perl RT is using. Can you confirm that the Perl your cpan command is using is the same one that RT is using?

This is my enviorement:

[root@SRVsbin]# env | grep perl
PERL5LIB=/root/perl5/lib/perl5:/root/perl5/lib/perl5:
PERL_MB_OPT=--install_base /root/perl5
PATH=/root/perl5/bin:/root/perl5/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
RT_FIX_DEPS_CMD=/root/perl5/bin/cpan
PERL_LOCAL_LIB_ROOT=:/root/perl5:/root/perl5
PERL_MM_OPT=INSTALL_BASE=/root/perl5

And this is the output of perl:

[root@SRV~]# perl -e 'print join("\n", @INC);'
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl5/lib/perl5
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5

Is this the problem? How can I change it?

I think what knation wants you to do is compare the first lines of: /opt/rt4/sbin/rt-server and /usr/bin/cpanm. These should start with #! and include a path to the Perl interpreter being used to run them. Are they pointing to the same Perl interpreter? For example on our CentOS boxes they both point to /usr/bin/perl (which is the system Perl).

According the error:

Can't locate GD/Text.pm in @INC (@INC contains: /opt/rt4/sbin/../local/lib /opt/rt4/sbin/../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/rt4/share/html/Search/Chart line 59.

This file can be found on this path:

[root@SRV ~]# locate GD/Text.pm
/root/perl5/lib/perl5/GD/Text.pm

The interpreter is different:

[root@SRV~]# cat /usr/bin/cpanm | grep '^#'
#!/usr/bin/perl

[root@SRV~]# cat /opt/rt4/sbin/rt-server | grep '^#'
#!/bin/perl -w

But maybe it’s need to add the path ‘/root/perl5/lib’ ?

This is your problem: the cpanm command has installed the new Perl libraries somewhere in the Perl library paths it knows about, but the rt-server is using a different Perl, which may well have different library paths (and may well be a different version of Perl just to complicate things).

Did you install RT from source or via an operating system distribution package?

I installed the perl with:

yum install -y perl-*

and then I use the cpan console to install some plugins:

perl -MCPAN -e shell
o conf prerequisites_policy follow
o conf build_requires_install_policy yes
o conf commit
install Bundle::CPAN
install RT::Extension::Nagios
install GD
install GD::Text
install GD::Graph::bar
install GD::Graph
reload cpan
reload index
install GD::Simple

It’s possible to change the path? or in this situation how can remap the correct perl?

Did you install RT with yum or did you download the tarball and install it?

from a tar.gz. This is my commands:

wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz
cd rt*
./configure --with-web-user=apache --with-web-group=apache --enable-graphviz --enable-gd --enable-gpg --with-db-type=mysql

Try reinstalling, with the commands above but before you run the ./configure set the PERL environment variable to point to /usr/bin/perl. In other words:

cd rt*
export PERL=/usr/bin/perl
./configure --with-web-user=apache --with-web-group=apache --enable-graphviz --enable-gd --enable-gpg --with-db-type=mysql

but If I install some plugins with cpan. Not’s possible to change the perl directory or force to assign the correct path?

I found that when I installed on first time RT I put this variables:

export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/root/perl5";
export PERL_MB_OPT="–install_base /root/perl5";
export PERL_MM_OPT="INSTALL_BASE=/root/perl5";
export PERL5LIB="/root/perl5/lib/perl5:$PERL5LIB";
export PATH="/root/perl5/bin:$PATH";
export RT_FIX_DEPS_CMD="/root/perl5/bin/cpan"

That’s any way to change the perl path on rt?

[fiug] fiug https://forum.bestpractical.com/u/fiug
September 2

I found that when I installed on first time RT I put this variables:

export PERL_LOCAL_LIB_ROOT=“$PERL_LOCAL_LIB_ROOT:/root/perl5”; export PERL_MB_OPT=“–install_base /root/perl5”; export
PERL_MM_OPT=“INSTALL_BASE=/root/perl5”; export PERL5LIB=“/root/perl5/lib/perl5:$PERL5LIB”; export
PATH=“/root/perl5/bin:$PATH”; export RT_FIX_DEPS_CMD=“/root/perl5/bin/cpan” |

That’s any way to change the perl path on rt?

/root is a bad choice IMHO for the Perl hierarchy, but you can certainly use variables like that if they are included
by the start up script for RT.

Regards
Racke

In wich file can change it?
Or how can I install modules on CPAN with the perl base directory instead of /root (by default)