Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: binary-two on January 17, 2010, 02:58:31 am

Title: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: binary-two on January 17, 2010, 02:58:31 am
Hi all,

running the latest update of 1.3 (with slapd_2.4.18) I get following error messages with all ldap-related modules:

Can't call method "attributes" on an undefined value at /usr/share/perl5/EBox/Ldap.pm line 226

Same happens in the web admin interface:

A really nasty bug has occurred
Exception
Can't call method "attributes" on an undefined value
Trace
Can't call method "attributes" on an undefined value at /usr/share/perl5/EBox/Ldap.pm line 226.

Thanks in advance!

Kind regards,

Björn
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: binary-two on January 17, 2010, 03:12:47 am
I am not 100% sure and not an expert on ldap issues, but can it be that slapd_2.4.18 breaks the system? Do others experience the same problem?

Thanks,

Björn
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: J. A. Calvo on January 17, 2010, 03:24:09 am
Do you have a configuration backup done before the update? Maybe you can try to restore it.

Anyway, the migration process is not finished yet, so these kind of things can happen. Remember that 1.3 is still beta.

Thank you for help us testing it.
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: binary-two on January 17, 2010, 03:38:27 am
Thanks! It is on a testing system, so its no problem. Backups are ready to test again after the new version is ready and on the ppa.

So long,

Björn
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: zergius on January 17, 2010, 11:26:55 am
Sorry for asking, but when will we can get a new version of slapd module? Couse i have done big misstake and get beta version to the work machine... =((
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: J. A. Calvo on January 17, 2010, 11:55:22 am
Thanks! It is on a testing system, so its no problem. Backups are ready to test again after the new version is ready and on the ppa.

I meant that you can try to restore the backup in your current broken installation and give us feedback about if it fixes the problem.
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 17, 2010, 12:14:25 pm
Sorry for asking, but when will we can get a new version of slapd module? Couse i have done big misstake and get beta version to the work machine... =((

Hi zergius! I am going to perform and upgrade from some 1.3.X to 1.3.15 and I'll tell you how to fix your installation.

A new usersandgroups supporting upgrades from 1.3.X to 1.3.15 will be out soon.

Cheers!
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: zergius on January 17, 2010, 12:48:38 pm
isaak, what is you way to fix it?

J. A. Calvo, yes, when i restore backup of yesterday most of functions are restored... Only in logs module i have get this:
Exception
(in cleanup) Can't call method "disconnect" on an undefined value
Trace
(in cleanup) Can't call method "disconnect" on an undefined value at /usr/share/perl5/EBox/PgDBEngine.pm line 112.
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: michele on January 18, 2010, 09:33:28 am
Same problem here. No backup available. Big mistake.
Is there a way to fix?
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: binary-two on January 18, 2010, 10:14:05 am
I quickly tried, but it was not successful (for me). What I've forgotten yesterday was to try to downgrade manually , i.e.

apt-get install slapd=version

You can get the available versions with

apt-cache policy slapd

I don't know the exact versions out of my mind right now.  And you have to fix the other dependencies (ebox-usersandgroups, etc.) as well. Could be messy to resolve everything after all.

I am sure the ebox-team will help with a fix soon. Thanks in advance for the great work!

So long,

Björn
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: michele on January 18, 2010, 11:35:44 am
Waiting for a fix how can i downgrade manually?
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 18, 2010, 12:58:11 pm
Hi, in the end the fix is not that easy, and we are focusing on the 1.2 to 1.4 migration at the moment.

Can you run "dpkg -l | grep slapd" and paste here the result?

Also the output of:
Code: [Select]
sudo /usr/sbin/slapd -d 256 -h "ldap:/// ldapi:///" -g openldap -u openldap -F /etc/ldap/slapd.d/
and
Code: [Select]
sudo cat /etc/ldap/slapd.d/cn\=config/olcDatabase={0}config.ldif

Cheers!
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: zergius on January 18, 2010, 01:16:13 pm
Here is my output:

Code: [Select]
dpkg -l | grep slapd
ii  slapd                                 2.4.15-1ubuntu3ebox5hardy         OpenLDAP server (slapd)

Code: [Select]
sudo /usr/sbin/slapd -d 256 -h "ldap:/// ldapi:///" -g openldap -u openldap -F /etc/ldap/slapd.d/
@(#) $OpenLDAP: slapd 2.4.15 (Jul 16 2009 12:49:57) $
buildd@muntries:/build/buildd/openldap-2.4.15/debian/build/servers/slapd
daemon: bind(8) failed errno=98 (Address already in use)
hdb_db_open: database "dc=kodi,dc=local": database already in use.
backend_startup_one: bi_db_open failed! (-1)
slapd stopped.

Code: [Select]
sudo cat /etc/ldap/slapd.d/cn\=config/olcDatabase={0}config.ldif
dn: olcDatabase={0}config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to * by dn="cn=ebox,dc=kodi,dc=local" write
olcRootDN: cn=admin,cn=config
olcRootPW:: Y3I1cWFVeUl3cE1SSDRxOQ==
structuralObjectClass: olcDatabaseConfig
entryUUID: 98d677c8-57e8-102e-810f-59ce46999e0a
creatorsName: cn=config
createTimestamp: 20091028083531Z
entryCSN: 20091028085325.450114Z#000000#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20091028085325Z
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 18, 2010, 01:31:37 pm
@zergius: That looks quite good :P That is after restoring a backup in the new version, right? Are you still having problems with LDAP?
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: zergius on January 18, 2010, 03:00:33 pm
Sorry, guess i make one more mistake... No, I havn't any problems with LDAP, i have them with LOG module - I can't see any logs in web... When i try to see any logs i get this:
Code: [Select]
Exception
(in cleanup) Can't call method "disconnect" on an undefined value
Trace
(in cleanup) Can't call method "disconnect" on an undefined value at /usr/share/perl5/EBox/PgDBEngine.pm line 112.

About backup - I haven't use eBox eBackup, it's just tar archive of "/" exclude some directory... So I have an old versions of eBox modules...
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: michele on January 18, 2010, 03:17:29 pm
Here's my output. I still have problems with slapd, ebox-userandgroups, ebox-mail.
No backup available.
Still waiting for a solution to give access to this server (it will be enough to have mail server working again. Now i can't connect)

Code: [Select]
dpkg -l | grep slapd
iF  slapd                                 2.4.18-0ubuntu3hardy0                OpenLDAP server (slapd)

Code: [Select]
/usr/sbin/slapd -d 256 -h "ldap:/// ldapi:///" -g openldap -u openldap -F /etc/ldap/slapd.d/
@(#) $OpenLDAP: slapd 2.4.18 (Jan  8 2010 10:48:43) $
        buildd@plutonium:/build/buildd/openldap-2.4.18/debian/build/servers/slapd
config error processing olcDatabase={0}config,cn=config: ordered_value_sort failed on attr olcAccess

slapd stopped.
connections_destroy: nothing to destroy.

Code: [Select]

cat /etc/ldap/slapd.d/cn\=config/olcDatabase={0}config.ldif
dn: olcDatabase={0}config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcRootDN: cn=admin,cn=config
olcRootPW:: e2NyeXB0fUFlL1VuLjgzYldNMms=
olcAccess: to * by dn.exact=cn=localroot,cn=config manage by * break
structuralObjectClass: olcDatabaseConfig
entryUUID: 3f2721da-4935-102e-834d-8702370b30f5
creatorsName: cn=config
createTimestamp: 20091009153624Z
olcAccess: {0}to * by dn="cn=ebox,dc=vibrobloc,dc=locale" write
entryCSN: 20091009154611.224756Z#000000#000#000000
modifiersName: cn=admin,cn=config
modifyTimestamp: 20091009154611Z
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 18, 2010, 03:34:32 pm
Ok. Do the following:
sudo rm /var/lib/dpkg/info/slapd.postinst
then edit:
/etc/ldap/slapd.d/cn\=config/olcDatabase={0}config.ldif with vim or whatever, and you can see two lines that start with olcAccess:
Code: [Select]
olcAccess: to * by dn.exact=cn=localroot,cn=config manage by * break
olcAccess: {0}to * by dn="cn=ebox,dc=vibrobloc,dc=locale" write

They are separated, move them together and change them to look like this:
Code: [Select]
olcAccess: {0}to * by dn.exact=cn=localroot,cn=config manage by * break
olcAccess: {1}to * by dn="cn=ebox,dc=vibrobloc,dc=locale" write

Then run:
Code: [Select]
sudo dpkg --configure -a

Then run again the commands I gave in the other post to see if things have been fixed. Also check the web interface to see if things are working and paste here any error you get.

Cheers
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: michele on January 18, 2010, 03:46:00 pm
Ok Isaac. Thanks a lot for your help.
I did it and i got:

Code: [Select]
dpkg --configure -a
Configuro slapd (2.4.18-0ubuntu3hardy0) ...
Configuro ebox-usersandgroups (1.3.13-0ubuntu1~ppa1~hardy1) ...
Can't call method "bind" on an undefined value at /usr/share/perl5/EBox/Ldap.pm
line 217.
 * Restarting eBox module: users                                         [fail]
Can't call method "bind" on an undefined value at /usr/share/perl5/EBox/Ldap.pm
line 217.

Stopping OpenLDAP: slapd.
Starting OpenLDAP: slapd.

Configuro ebox-mail (1.3.14-0ubuntu1~ppa1~hardy1) ...
Can't call method "attributes" on an undefined value at /usr/share/perl5/EBox/Ld
ap.pm line 226.
 * Restarting eBox module: logs                                          [ OK ]
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
 * Restarting eBox module: mail                                          [fail]
Can't call method "attributes" on an undefined value at /usr/share/perl5/EBox/Ld
ap.pm line 226.


Processing triggers for ebox ...
 * Restarting eBox module: apache                                        [ OK ]
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 18, 2010, 03:58:12 pm
Ok, can you please run this command:
sudo cat /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{-1\}frontend.ldif
and paste the output here?

If the output is something like:
Code: [Select]
dn: olcDatabase={-1}frontend
objectClass: olcDatabaseConfig
objectClass: olcFrontendConfig
olcDatabase: {-1}frontend
olcAccess: {0}to * by dn.exact=cn=localroot,cn=config manage by * break
olcSizeLimit: 500
structuralObjectClass: olcDatabaseConfig
entryUUID: 5d8fda1c-9814-102e-9dea-d1fb3b0916b4
creatorsName: cn=config
createTimestamp: 20100118003004Z
entryCSN: 20100118003004.016646Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20100118003004Z
containing one single olcAccess line, you need to add two more lines, so it looks like:
Code: [Select]
...
olcAccess: {0}to * by dn.exact=cn=localroot,cn=config manage by * break
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to dn.base="cn=subschema" by * read
...
then run:
Code: [Select]
sudo /etc/init.d/slapd restart
sudo /etc/init.d/ebox users restart
sudo /etc/init.d/ebox mail restart

Post here the output of the commands. Cheers!

olcAccess: to dn.base="" by * read
olcAccess: to dn.base="cn=subschema" by * read
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: michele on January 18, 2010, 06:16:26 pm
It worked! Isaac, thanks a lot!
Now i can have access again to web interface and all services are running well.
Last question: what about my upgrades now? Doing sudo apt-get upgrade i haven't packets to install...

Here my last output:

Code: [Select]
sudo /etc/init.d/slapd restart
Stopping OpenLDAP: slapd.
Starting OpenLDAP: slapd.

Code: [Select]
sudo /etc/init.d/ebox users restart
 * Restarting eBox module: users                                         [ OK ]

Code: [Select]
sudo /etc/init.d/ebox mail restart
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Use of uninitialized value in string eq at /usr/share/perl5/EBox/Types/Union.pm
line 450.
Argument "unlimitedMsgSize" isn't numeric in multiplication (*) at /usr/share/pe
rl5/EBox/Mail.pm line 378.
 * Restarting eBox module: mail                                          [ OK ]
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 18, 2010, 06:32:02 pm
Great :)

Well, you are now up-to-date, there is nothing else left to upgrade I guess :)
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: Coarch on January 27, 2010, 08:46:37 am
Thanks for the directions above.  I think I'm almost fixed.  I get the following error when running:

Code: [Select]
/etc/init.d/ebox users restart
 * Restarting eBox module: users
   ...fail!
Unknown error at EBox::UsersAndGroups::_loadCertificates objectClass: value #0 invalid per syntax
What am I missing out on.  I edit the two files mentioned above and now slapd restarts fine but I still get the error above.

Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: isaac on January 27, 2010, 10:05:35 am
Uhm, apparently you are lacking the LDAP schema required for a master eBox.

If the rest of your setup is ok you can load it using:
Code: [Select]
sudo ldapadd -H 'ldapi://' -Y EXTERNAL -c

The command will wait for input, type this:
Code: [Select]
include: file:///usr/share/ebox-usersandgroups/master.ldif
include: file:///usr/share/ebox-usersandgroups/slaves.ldif

This should fix that problem, but if that's missing, you might miss other stuff too. Let me know :)
Title: Re: Can't call method "attributes" on an undefined value at Ldap.pm line 226
Post by: Coarch on January 27, 2010, 06:48:38 pm
Thanks for the fix, much appreciated.