Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning in CLI while loading modules #8164

Closed
JeGoi opened this issue May 27, 2024 · 2 comments
Closed

Warning in CLI while loading modules #8164

JeGoi opened this issue May 27, 2024 · 2 comments
Assignees

Comments

@JeGoi
Copy link
Contributor

JeGoi commented May 27, 2024

Describe the bug

root@IP :/usr/local/pf# bin/pfcmd fingerbank
[...]
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Document.pm line 75.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 376.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 875.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 894.
[...]

These lines should not be there.

To Reproduce
Steps to reproduce the behavior:

  1. install pf on debian12
  2. run command line with bin/pfcmd something with argument or submodule
  3. See error

So this is coming from:
https://github.com/inverse-inc/packetfence/blob/feature/debian12/lib/pf/cmd/subcmd.pm#L48
which can be split in two steps:

use Data::Dumper;
        eval {
            if ( is_loaded($module)) {
print("\n"); # we do not care yet, no issue at this point
            } else {
print("\n");
print("nope b\n");
print Dumper ($module);
print("\n");
print("\n");
                load $module;
print("\n");
print("nope a\n");
print Dumper ($module);
print("\n");
print("\n");

            }
            $cmd = $module;
        };

As result:

root@IP :/usr/local/pf# bin/pfcmd fingerbank

nope b
$VAR1 = 'pf::cmd::pf::fingerbank';


each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Document.pm line 75.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 376.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 875.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 894.

nope a
'pf::cmd::pf::fingerbank'

Usage:
     pfcmd fingerbank <command>

So, something is happening with load of the Module::Load:
https://metacpan.org/pod/Module::Load
https://metacpan.org/dist/Module-Load/source/lib/Module/Load.pm

We are using the latest version:

root@IP:/usr/local/pf# cpan -D Module::Load
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 27 May 2024 17:52:41 GMT
Module::Load
-------------------------------------------------------------------------
        (no description)
        B/BI/BINGOS/Module-Load-0.36.tar.gz
        /usr/share/perl/5.36/Module/Load.pm
        Installed: 0.36
        CPAN:      0.36  up to date
        Chris Williams (BINGOS)
        [email protected]

root@IP:/usr/local/pf# 

Expected behavior
Not see the warning

@satkunas satkunas added this to the PacketFence-14.0 milestone May 27, 2024
@JeGoi JeGoi added the debian12 Debian 12 related label May 28, 2024
@JeGoi JeGoi changed the title Debian12 issue with Module::Load on pfcmd Debian12 warning in CLI loading module issue May 30, 2024
@JeGoi JeGoi changed the title Debian12 warning in CLI loading module issue Warning in CLI while loading module issue May 30, 2024
@JeGoi JeGoi changed the title Warning in CLI while loading module issue Warning in CLI while loading modules May 30, 2024
@jrouzierinverse
Copy link
Member

We need to upgrade the Template Toolkit module

@jrouzierinverse
Copy link
Member

This was fixed by 118c451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants