LDAP storage - Errors deleting Postfix DN's and a left over group

Hey Jamie,

I'm just finishing up moving everything into LDAP. Took awhile to get it all working, but we're humming along now except for 1 small issue.

When deleting a virtual server I get the following errors:

Removing from email domains list ..
.. Mail for domain failed! : LDAP delete of mailLocalAddress=t2.borgstrom.ca,ou=postfix-aliases,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca failed : No such object at ../web-lib-funcs.pl line 1323.
Deleting administration user ..
.. Administration user failed! : LDAP delete of mailLocalAddress=t2@t2.borgstrom.ca,ou=postfix-aliases,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca failed : No such object at ../web-lib-funcs.pl line 1323.

The interesting thing is that these DN's are actually removed, so it's like they're getting removed earlier in the process.

The real problem is that when I check my LDAP source directly the group that was created for this virtual server is still there

# t2, FatBox Inc., Customers, fatbox.ca
dn: cn=t2,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca
objectClass: posixGroup
gidNumber: 5002
cn: t2
memberUid: www-data

But the LDAP users & groups module doesn't report anything, thus if I try to recreate another virtual server with the same domain name (or one that picks up the same prefix) I get the following error.

Creating administration group t2 ..
.. administration group was created but does not exist!
Failed to create virtual server : Critical feature Administration user was not properly created - Virtual server creation halted.

Let me know what else I can provide to help track this down.

Status: 
Active

Comments

The reason the group is still there is that the user deletion is failing, and the group deletion is normally done after that in the same function.

The more interesting question is what is deleting the DNs before Virtualmin tries to. Do you perhaps have any pre-deletion script setup there?

Nope, no scripts involved.

Regarding that mailLocalAddress=t2.borgstrom.ca,ou=postfix-aliases,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca DN, does this still exist in your LDAP DB? If not, did it exist when the domain was created?

Also, do you have logging enabled on your LDAP server that could be used to see what objects were deleted during the virtual server deletion process?

It does not exist after the error, it did exist prior to deleting the domain.

Logging is enabled, it looks like Virtualmin tries to delete the entry twice:

Oct  6 03:01:47 yyz1-auth1 slapd[18680]: conn=683 op=17 DEL dn="mailLocalAddress=t2.borgstrom.ca,ou=postfix-aliases,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca"
Oct  6 03:01:47 yyz1-auth1 slapd[18680]: conn=683 op=17 RESULT tag=107 err=0 text=
Oct  6 03:01:48 yyz1-auth1 slapd[18680]: conn=683 op=18 DEL dn="mailLocalAddress=t2.borgstrom.ca,ou=postfix-aliases,ou=FatBox Inc.,ou=Customers,dc=fatbox,dc=ca"
Oct  6 03:01:48 yyz1-auth1 slapd[18680]: conn=683 op=18 RESULT tag=107 err=32 text=

That's really odd ..

Can you correlate these log events with messages that appear in the Virtualmin UI during the deletion process?

Also, was this a regular domain, or an alias? If regular, did it have any aliases?