otrs user still associated to old PERL version.

Moderator: crythias

Locked
pvanos
Znuny newbie
Posts: 23
Joined: 26 Sep 2014, 13:59
Znuny Version: 3.3.10
Company: KSZ-BCSS

otrs user still associated to old PERL version.

Post by pvanos »

While upgrading from OTRS5 to OTRS6.0.3, and executing scripts/DBUpdate-to-6.pl as user otrs, I obtain an error message:
"Perl v5.16.0 required--this is only v5.10.1, stopped at /opt/otrs/Kernel/Config/Defaults.pm line 21."

However:
[root@myserver otrs]# perl -v
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux
Copyright 1987-2017, Larry Wall

[root@myserver otrs]# su - otrs
-bash-4.1$ perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
Copyright 1987-2009, Larry Wall

==> The perl 5.26.1 is installed in /root/localperl/
In /etc/profile.d there is an executable file perl.sh containing this one line:
pathmunge /root/localperl/bin

What needs to be done in order to have the user otrs also use this version, instead of the old v5.10.1 ?

Many thanks.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: otrs user still associated to old PERL version.

Post by jojo »

it seems a local version for the user OTRS. I strongly advice to use the perl version of the operating system. What do you use?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
pvanos
Znuny newbie
Posts: 23
Joined: 26 Sep 2014, 13:59
Znuny Version: 3.3.10
Company: KSZ-BCSS

Re: otrs user still associated to old PERL version.

Post by pvanos »

[root@myserver ~]# which perl
/root/localperl/bin/perl
[root@rigel ~]# su - otrs
-bash-4.1$ which perl
/usr/bin/perl

So I guess the issue becomes: how I can make user otrs also use the updated version of perl in /root/localperl/bin/perl ?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: otrs user still associated to old PERL version.

Post by jojo »

As I already said, I strongly advise to use an uptated version of the OS with a propper PERL distribution
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
pvanos
Znuny newbie
Posts: 23
Joined: 26 Sep 2014, 13:59
Znuny Version: 3.3.10
Company: KSZ-BCSS

Re: otrs user still associated to old PERL version.

Post by pvanos »

It's CentOS 6.9 (unfortunately I could never install CentOS 7 because of missing RAID-controller support).
And I installed all updates, including those from the epel-repository.
When I am manually installing from www.cpan.org/src/5.0 the latest even-numbered version, it installs itself by default into /root/localperl/

So I also tried yum remove /usr/bin/perl, but now I (still) can't have the /root/localperl version detected by user 'otrs'.
As there was no more system-perl detected I reinstalled it, but it installed the totally outdated perl-5.10.1 again.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: otrs user still associated to old PERL version.

Post by jojo »

you should ask this in a PERL forum...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: otrs user still associated to old PERL version.

Post by reneeb »

@jojo: It's Perl *not* PERL ;-)

@pvanos: Maybe this helps: https://www.linuxquestions.org/question ... 849-print/
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: otrs user still associated to old PERL version.

Post by jojo »

reneeb wrote:@jojo: It's Perl *not* PERL ;-)
I'm used to write programming language names in capital letters since I started with C ;-)
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
pvanos
Znuny newbie
Posts: 23
Joined: 26 Sep 2014, 13:59
Znuny Version: 3.3.10
Company: KSZ-BCSS

Re: otrs user still associated to old PERL version.

Post by pvanos »

@reneeb
Thank you for your tip ! This afternoon, I came to this link already, with good tips indeed.
I only had trouble in accessing the perlbrew-installed perl-5.26.1 as otrs user. Some permission issues.

On the other hand, I can confirm the suggestion somewhere in this thread, that CentOS7 has a distro perl version of v5.16.3.
I have a production OTRS-server, running under CentOS7. Unfortunately my test server is too old and is running CentOS6.9.

As I had some issues, I removed perl, and also /usr/local/perlbrew and /root/localperl.
After that, I rebooted the machine, and, as root, reinstalled perl using
yum install perl
So I had the old Perl 5.10.1 again.
Next I installed perlbrew, following https://gryzli.info/2016/10/10/installi ... helfedora/
Remarks:
1) I followed his (good) advice to install in /usr/local rather than the default /root/perl5 (or $HOME/perl5).
so make sure to include the line
export PERLBREW_ROOT="/usr/local/perlbrew"
prior to launching ./perlbrew_install.sh
2) create a file /etc/profile.d/perl.sh containing the following:
source /usr/local/perlbrew/etc/bashrc
3) if you are behind a proxy, then make sure to prefix the perlbrew install command like this:
http_proxy=IPaddr:Port perlbrew -n -j4 install 5.26.1
replace IPaddr:Port with the actual IP-address and the port of your proxy.
After you get the confirmation that your perl 5.26.1 version is successfully installed, check this:

perlbrew list
But now comes the proof of the pudding : su - otrs
at first, perl -v returns the old v5.10.1
But now: repeat
perlbrew list --> you will see the v5.26.1 version (available)
perlbrew switch perl-5.26.1
perl -v --> this time returns no longer the v5.10.1, but v5.26.1

(Figuring this out costed me an entire vacation day 8) , but at least I can now continue the last steps of my OTRS 5 to 6 upgrade )
pvanos
Znuny newbie
Posts: 23
Joined: 26 Sep 2014, 13:59
Znuny Version: 3.3.10
Company: KSZ-BCSS

Re: otrs user still associated to old PERL version.

Post by pvanos »

Bad news:
[root@myserver otrs]# /opt/otrs/bin/otrs.CheckModules.pl
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /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/otrs/Kernel/System/Environment.pm line 15.
BEGIN failed--compilation aborted at /opt/otrs/Kernel/System/Environment.pm line 15.
Compilation failed in require at /opt/otrs/bin/otrs.CheckModules.pl line 30.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.CheckModules.pl line 30.
[root@myserver otrs]#

It's really getting too perly here... guess I'm going to reinstall OTRS on a new VM with CentOS7...
Locked