Hi there,

On Tue, 10 Dec 2024, Alan wrote:

Since upgrading from Fedora 40 to 41 I?ve started seeing the following Perl 
error message when the BackupPC_nightly and BackupPC_rrdUpdate routines are run:

Attempt to call undefined import method with arguments (":BPC_DT_ALL") via package 
"BackupPC::Lib" (Perhaps you forgot to load the package?) at 
/usr/share/BackupPC/bin/BackupPC_nightly line 89.

Attempt to call undefined import method with arguments (":BPC_DT_ALL") via package 
"BackupPC::Lib" (Perhaps you forgot to load the package?) at 
/usr/share/BackupPC/bin/BackupPC_rrdUpdate line 42.


In both cases the statement causing the error in the nightly and rrdUpdate 
scripts is:

use BackupPC::Lib qw( :BPC_DT_ALL );

I think this may be related to the move to Perl version 5.40.0 under Fedora 41. 
   Fedora 40 used Perl version 5.38.2 and no error occurs.

You're probably right.  Perl uses a couple of mechanisms to find
libraries like those in

/usr/<something>/BackupPC/lib/

and it looks like your upgrade has scrambled some configuration.

The <something> will probably be either 'local' or 'share' and my
*guess* is that it's the other one that you want.

The (":BPC_DT_ALL") argument doesn?t seem to appear in any other
scripts  Can this error be ignored as it doesn?t seem to affect
anything other than generate that error message?

That value is a hash key defined in

/usr/local/BackupPC/lib/BackupPC/DirOps.pm

Personally I wouldn't ignore it, as I would expect other problems, I
would look into the Perl library path configuration to see what has
been changed.  If you run

$ grep -r 'use lib' /usr/local/BackupPC/*

you should see the same path multiple times, one for each Perl script.
I'm *guessing* that the path in the 'use lib' directive will not be
the correct path to your BackupPC library directory.  These paths are
set up when BackupPC is installed on your system.  You can make sure
that it is, add it to Perl's configured paths, or maybe add a symlink.

Here's the output from my system:

8<----------------------------------------------------------------------
$ grep -r 'use lib' /usr/local/BackupPC/*
/usr/local/BackupPC/bin/BackupPC_archive:use lib "/usr/local/BackupPC/lib";
/usr/local/BackupPC/bin/BackupPC_nightly:use lib "/usr/local/BackupPC/lib";
... snipped lots more lines ...
/usr/local/BackupPC/bin/BackupPC_zcat:use lib "/usr/local/BackupPC/lib";
/usr/local/BackupPC/bin/BackupPC_dump:use lib "/usr/local/BackupPC/lib";
8<----------------------------------------------------------------------

Again *assuming* my guesses are correct there are at least three ways
to fix it below.

FIX 1.  You *could* just edit all those files to correct the path.


FIX 2.  If you run

perl -V

you will see a long list of configuration stuff.  The last few lines
(about ten lines) will look *something* *like* this:

8<----------------------------------------------------------------------
$ perl -V | tail -n 11
  Compiled at Nov 25 2023 21:03:14
  @INC:
    /etc/perl
    /usr/local/lib/aarch64-linux-gnu/perl/5.32.1
    /usr/local/share/perl/5.32.1
    /usr/lib/aarch64-linux-gnu/perl5/5.32
    /usr/share/perl5
    /usr/lib/aarch64-linux-gnu/perl-base
    /usr/lib/aarch64-linux-gnu/perl/5.32
    /usr/share/perl/5.32
    /usr/local/lib/site_perl
$ 8<----------------------------------------------------------------------

you could if you wish add

/usr/share/BackupPC/lib/ (or whatever the correct path is)

to the list so Perl always knows it.  Most of the time Perl doesn't
need to know that path so it isn't *necessary* to do it that way.


FIX 3.  Instead of editing BackupPC files or changing Perl's paths, if
it's as simple as a change from

/usr/share/BackupPC/
/usr/local/BackupPC/

then you could kludge it with a symlink.  For example if your lib
files are in

/usr/share/BackupPC/lib/

but your Perl is being told to look in

/usr/local/BackupPC/lib/

ant there's no BackupPC directory in /usr/local/ you could simply
insert a symlink like this:

# cd /usr/local
# ln -s /usr/share/BackupPC
#

That's a horrible kludge, but it's quick and I've done worse in my time.


Finally it could be something a bit like what I've described but not
exactly.  You might be able to figure it out from what I've written
but if you can't, let us see the output of the 'grep' commands above
and anything else you think might help... :)

--

73,
Ged.


_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to