mirror of
https://github.com/lucascbeyeler/zmbackup.git
synced 2026-04-25 07:05:55 +03:00
[GH-ISSUE #160] After restoring without the -ro arguement ldap failed #128
Labels
No labels
Bug Report
Enhancement
Enhancement
Feature Idea
Feature Idea
Not Implemented
Question
Question
Task
Wontfix
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/zmbackup#128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wh4u on GitHub (Apr 14, 2021).
Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/160
ISSUE TYPE
ENVIRONMENT VERSION
i tried to restore a mailbox using
zmbackup -r -ro inc-20210413013001 user@mydomain.tld user@mydomain.tld
command finished successfully but the mailbox is empty.
I accidently submitted the command in one of my tries, forgot to give the -ro argument
zmbackup -r inc-20210413013001 user@mydomain.tld user@mydomain.tld
And then the ldap failed.
[] FATAL: failed to initialize LDAP client
com.zimbra.cs.ldap.LdapException: LDAP error: : invalid credentials
@nugzarg commented on GitHub (Jun 2, 2021):
The same problem with version 1.2.6. After trying to restore account from backup, zimbra is completely damaged. Some services (like zmmaiboxd, zmlogd) are crashed. Starting of these services is not possible. It seems that this tool damages zimbras LDAP database.
This tool is very dangerous! Do not use it on production server! If you wish to test it, have a backup of LDAP database (make it with /opt/zimbra/libexec/zmslapcat).
@mathcuei commented on GitHub (Aug 6, 2021):
Same ENVIRONMENT and same problem. Corrupt ldap and services.
@FlorianHeigl commented on GitHub (Feb 18, 2026):
also hit that now, I think it's just the ldap zimbra password being somehow trashed not the ldap actively destroyed. but did no one open a bug for that?
or is it this... ok... hope i can get my brain to work for a moment to finally solve this
I'll try to compare the LDAP and passwords before and after - if i ever find a reliable way to query them in zimbra. it - zimbra - being so insufferably fragile.
not to mention how zimbra package uninstall just nukes /opt/zimbra/backup - in 2026.
Or that they leave this password:
mailboxd_truststore_password="changeit"for the keystore. the ansible zimbra installers do it better.@FlorianHeigl commented on GitHub (Feb 18, 2026):
I think it comes from this:
just by the looks, this is falling through to a recursive delete from some undesirable spot.
i'm not sure yet due to my brain not working, and i haven't yet managed to break back into the fried slapd (root also doesn't play nicely anymore), but...
suggest to flip this around, put the logic inside awk, then it'll be easier to add validation and only run if the ... idk. forgot.
first immediate change should be to do break the delete into two bits, grep from the ldif
don't process a string including workdir, store it away and see if the leftover right half is something or nothing (consider WORKDIR/ and WORKDIR// are gonna do the same thing)
parse if it's a user dn and do smart things
if so, generate a delete command
or, if lazy, have a set -u right there, then it will at least bail out.
@FlorianHeigl commented on GitHub (Feb 18, 2026):
ok this is taking forever to understand and solve. I had being so slow, anyway: verified now, it definitely nukes the LDAP!
you can still do an anonymous bind, but it will not be enlightening
A backup created with slapcat (as indicated up in the thread) will be restored as such:
Test the directory is working again like this:
(should show a number above 50, I only created a few domains without content)
@FlorianHeigl commented on GitHub (Feb 18, 2026):
ok i got my system back up - i had to use the zmmailboximport utility you mentioned in another bug. it was just not fruitful to try on.
all settings gone but I went over the COS and applied the most important stuff.
i would suggest that you include an initial step that creates a full ldap backup if a restore is run that would branch into ldap_restore. note this would need to be a unique-id/timestamped backup or they would quickly overwrite.
imo for the 2.0 you could add a test plan item that a restore can never be a success if there's less objects than before or if a login is no longer possible that was originally possible (think like detecting degradation)