PDA

View Full Version : Perl File::Temp error in mysql-zrm



thesnail
January 11th, 2007, 01:41 AM
Red Hat Enterprise AS 3.0, release 8; perl-5.8.0-94.EL3; MySQL-zrm-1.1.3-1

When running:

mysql-zrm-scheduler --now --backup-set=daily

I'm getting an error at line 3770 involving File::temp:

Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
INFO: ZRM for MySQL Community Edition - version 1.1.3
INFO: Mail address: root@localhost is ok
INFO: Input Parameters Used {
INFO: verbose=1
INFO: retention-policy=2D
INFO: all-databases=0
INFO: destination=/backup/mysql
INFO: backup-mode=raw
INFO: password=******
INFO: compress-plugin=/usr/bin/bzip2
INFO: user=backup
INFO: copy-plugin=/usr/share/mysql-zrm/plugins/socket-copy.pl
INFO: quiet=0
INFO: backup-level=0
INFO: mailto=root@localhost
INFO: databases=information_schema bugs mysql sgclabmanager wikidb wikidb_sysadmin
INFO: html-reports=backup-status-info
INFO: host=******** [removed for security reasons]
INFO: html-report-directory=/var/www/mysql-zrm/reports/
INFO: comment=Daily backup
INFO: compress=/usr/bin/bzip2
INFO: }
Can't locate object method "new" via package "File::Temp" at /usr/bin/mysql-zrm line 3770.
ERROR: /usr/bin/mysql-zrm did not finish successfully
/usr/bin/mysql-zrm-reporter finished successfully

Putting a diagnostic print statement just before line 3770 reveals that $backupset_dir='/etc/mysql-zrm/daily'.

Can anyone point out what I'm doing wrong?

Thanks
Brian

kkg
January 11th, 2007, 01:55 AM
Hi,

It's because the new object interface was introduced in File::Temp version 0.17 which is
included in perl-5.8.5.

Please note ZRM is currently with 5.8.7 and above only.

--kkg

thesnail
January 11th, 2007, 02:23 AM
Yes - upgrading to 5.8.8 solved the problem.

Many thanks for your fast response.

Brian.

timmynyce
January 12th, 2007, 12:15 PM
I am having same issue..I currently have rpm version perl-5.8.0-90.4.

I tried installing the latest Perl (5.8.8 from source)...Do I need to point ZRM to the new Perl install? Or remove the original rpm files? It seems to keep giving me the same error...

paddy
January 12th, 2007, 12:24 PM
You will need to point to perl 5.8.8 libraries.

Paddy

timmynyce
January 12th, 2007, 12:30 PM
I have been looking for that option....Is it in the mysql-zrm.conf ?

paddy
January 12th, 2007, 12:42 PM
You can set

$PERL5LIB to /usr/lib/perl5 (assuming 5.8.8 libraries are installed under /usr/lib/perl5)

Use perl -V to check @INC values (see whether it includes 5.8.8 libraries)

Paddy

timmynyce
January 12th, 2007, 12:57 PM
Thank you for the information....just a couple quick questions..

1. Do I create this variable? Or edit an existing one?

2. Do I set this option in the /usr/bin/mysql-zrm or in the mysql-zrm.conf ?

timmynyce
January 15th, 2007, 07:33 AM
"Thank you for the information....just a couple quick questions..

1. Do I create this variable? Or edit an existing one?

2. Do I set this option in the /usr/bin/mysql-zrm or in the mysql-zrm.conf ?"



Any update on this question? I have not yet found where that variable is. Thanks.

ktill
January 15th, 2007, 09:13 AM
Hi,
mysql-zrm from perl from /usr/bin/perl. So the easiest approach is to make sure /usr/bin/perl on your system is of 5.8.7 or better.

To find out what version /usr/bin/perl is and what directories it look for libraries, do
"/usr/bin/perl -V"

$PERL5LIB is an environment variable. You should set it in your shell.

Hope this helps!

--Kevin

thesnail
January 15th, 2007, 09:18 AM
I am having same issue..I currently have rpm version perl-5.8.0-90.4.

I tried installing the latest Perl (5.8.8 from source)...Do I need to point ZRM to the new Perl install? Or remove the original rpm files? It seems to keep giving me the same error...


I would stronly advise against updating the installed rpm's - there are so many dependencies and a number of significant changes that make this a very challenging task.

timmynyce
January 16th, 2007, 09:40 AM
I apppreciate the help thus far, unfortunately I am still getting the same error.

Here is my output from running perl -V at the prompt:
Compiled at Jan 15 2007 21:16:43
@INC:
/usr/local/lib/perl5/5.8.8/i686-linux
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl

I installed perl 5.8.8 from source to its defaults (which is /usr/local/perl5)

I set PERL5LIB=/usr/local/lib/perl5

echo $PERL5LIB shows
/usr/local/lib/perl5


Yet I am still getting the same error...Do I need to set anything else?

Thanks in advance for any advice....

ktill
January 16th, 2007, 09:59 AM
hi,

PERL5LIB
A colon-separated list of directories in which to look for Perl library files before looking in the standard library and the current directory.

So you need to set PERL5LIB=/usr/local/lib/perl5/5.8.8/i686-linux:/usr/local/lib/perl5/5.8.8:...

Any way to workaround the problem is to create a link from /usr/local/perl5/bin/perl to /usr/bin/perl. This way, mysql-zrm will run the right perl binary.

Hope this helps!

timmynyce
January 16th, 2007, 12:47 PM
So thanks to everyone's help I have gotten a successful backup...but the XML Parser still fails to load.

Here is the error message:

Can't locate XML/Parser.pm in @INC (@INC contains: /usr/lib/mysql-zrm -I ../lib/ /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl . /usr/lib/mysql-zrm ../lib/) at /usr/lib/mysql-zrm/XML/RSS.pm line 5.

So I searched for Parser.pm on the server and here are the results:

find / | grep Parser.pm

/usr/local/lib/perl5/5.8.7/Pod/Parser.pm
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/XML/Parser.pm
/usr/local/lib/perl5/5.8.8/Pod/Parser.pm
/usr/local/src/perl-5.8.7/lib/Pod/Parser.pm
/usr/local/src/perl-5.8.8/perl-5.8.8/lib/Pod/Parser.pm
/usr/lib/perl5/5.8.0/Pod/Parser.pm
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/HeadParser.pm
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/Parser.pm
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/PullParser.pm
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/TokeParser.pm
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm
/usr/lib/perl5/vendor_perl/5.8.0/XML/Checker/Parser.pm
/usr/lib/perl5/vendor_perl/5.8.0/XML/DOM/ValParser.pm
/usr/lib/perl5/vendor_perl/5.8.0/XML/ESISParser.pm
/usr/lib/perl5/vendor_perl/5.8.0/XML/XQL/Parser.pm
/root/.cpan/build/XML-Parser-2.34/Parser.pm
/root/.cpan/build/XML-Parser-2.34/blib/lib/XML/Parser.pm

I tried adding the /usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/XML/Parser.pm
path to the PERL5LIB variable (since that appears to be the latest)......but it does not work....

Do I need to point zrm to a different XML parser path? I installed perl-XML-Parser-2.31-15.src.rpm as my XML package.


Thanks,
Tim

ktill
January 16th, 2007, 01:21 PM
I tried adding the /usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/XML/Parser.pm
path to the PERL5LIB variable (since that appears to be the latest)......but it does not work....

Thanks,
Tim

how about add "/usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/" to PERL5LIB?

timmynyce
January 16th, 2007, 02:12 PM
Does not work, I am even trying to make symbolic links on the paths I know ZRM is for sure checking....but every time i succeed with one XML item it is looking for, it fails with the next.

Since setting the PERL5LIB variable as you said did not fix the XML error, I tried creating a direct link to the XML folder in /usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/

ln -s /usr/local/lib/perl5/site_perl/5.8.7/i686-linux-ld/XML/ /usr/local/lib/perl5/5.8.8/XML

Fails with

Can't locate loadable object for module XML::Parser::Expat in @INC (@INC contains: /usr/lib/mysql-zrm -I ../lib/ /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl . /usr/lib/mysql-zrm ../lib/) at /usr/local/lib/perl5/5.8.8/XML/Parser.pm line 14
Compilation failed in require at /usr/local/lib/perl5/5.8.8/XML/Parser.pm line 14.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.8.8/XML/Parser.pm line 18.
Compilation failed in require at /usr/lib/mysql-zrm/XML/RSS.pm line 5.
BEGIN failed--compilation aborted at /usr/lib/mysql-zrm/XML/RSS.pm line 5.
Compilation failed in require at /usr/bin/mysql-zrm-reporter line 56.
BEGIN failed--compilation aborted at /usr/bin/mysql-zrm-reporter line 56.
ERROR: /usr/bin/mysql-zrm-reporter did not finish successfully

I can keep trying to fix each error , but this seems like a bad direction to be heading down anyways......
__________________________________________________ __________________________________________________ _____

OK-----So I have fixed everything and am posting a summary below to hopefully help anyone else who has the same troubles:

Issue 1:
I could only resolve this by adding adding my specific Perl 5.8.8 library paths to the @INC path search (as recommended by the forum admins)

Issue 2:
XML Parser.pm, Expat.pm,etc. not found
This was resolved by installling XML-Parser-2.34.tar.gz...this by default installed to my latest 5.8.8 directories and then everything was fine.

Thanks for all the help, and hopefully this thread can save someone from the headache I have had the last couple days. : )