<<Can't locate object method "port" via package SSSD.pm>>

if the rpm nethserver-dc or nethserver-directory is not installed my code gives back an error with the port object

my code

use esmith::util;
use NethServer::SSSD;
my $sssd = new NethServer::SSSD();
my $quotedBindPass = $sssd->bindPassword(); $quotedBindPass =~ s/\'/\\'/g;
my $server = $sssd->ldapURI() .':'. $sssd->port();
my $usertree = $sssd->userDN();
my $grouptree = $sssd->groupDN();
my $binddn = $sssd->bindDN();

the output is :

ERROR in /etc/e-smith/templates//etc/dokuwiki/local.protected.php/10auth: Program fragment delivered error <<Can’t locate object method “port” via package “URI::_generic” at /usr/share/perl5/vendor_perl/NethServer/SSSD.pm line 134.>> at template line 1
ERROR: Template processing failed for //etc/dokuwiki/local.protected.php: 1 fragment generated errors

once nethserver-directory or nethserver-dc is installed, there is no more errors.

I guess that ‘LdapURI’ is not set or something close

Possibly I’m the bug :stuck_out_tongue:

1 Like

Thank you @stephdl, could you paste the output of

rpm -q nethserver-sssd
config show sssd

[root@NS7DEV5 ~]# rpm -q nethserver-sssd
[root@NS7DEV5 ~]# config show sssd

1 Like

Could you try out the package from nethserver-testing repo? Let’s see if it solves your issue…

nethserver-sssd ?

Yes sir!

solved :slight_smile:
[root@NS7DEV ~]# rpm -qa nethserver-sssd

1 Like

Please, note that such variable in a template overrides the global $sssd hash ref coming from the the DB key of the same name.