[GH-ISSUE #192] Error handling #155

Open
opened 2026-02-27 08:14:38 +03:00 by kerem · 2 comments
Owner

Originally created by @FlorianHeigl on GitHub (Feb 18, 2026).
Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/192

Hi,

i'm trying to step over #160, LDAP insta-destruction
Please note I have some memory issues and this stuff is something I probably already solved years ago, but have no recollection of. if it turns out to be a FAQ, just let me know and don't stab me, please.

Main thing I notice and that will matter for your 2.0 version:

Currently, there's bad handling of global state.
So, you'll get a report the restort process completed (true), which decides the main exit codes (bad), when it failed ALL individual steps (bad)
I'm dropping the whole log here for reference. But I'll explain again below.


[zimbra@zmail ~]$ zmbackup -r full-20260214231158
Restore LDAP process with session full-20260214231158 started at Wed Feb 18 14:18:20 UTC 2026
Academic tradition requires you to cite works you base your article on.
If you use programs that use GNU Parallel to process data for an article in a
scientific publication, please cite:

  Tange, O. (2024, December 22). GNU Parallel 20241222 ('Bashar').
  Zenodo. https://doi.org/10.5281/zenodo.14550073

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

More about funding GNU Parallel and the citation notice:
https://www.gnu.org/software/parallel/parallel_design.html#citation-notice

To silence this citation notice: run 'parallel --citation' once.


Error during the restore process for account virus-quarantine@florianheigl.me. Error message below:
virus-quarantine@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error

Error during the restore process for account admin@florianheigl.me. Error message below:
admin@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error

[...]
Error during the restore process for account fh@florianheigl.de. Error message below:
fh@florianheigl.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error

Error during the restore process for account cloud@deranfangvomen.de. Error message below:
cloud@deranfangvomen.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error

Error during the restore process for account floh@deranfangvomen.de. Error message below:
floh@deranfangvomen.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error

Error during the restore process for account me@florianheigl.me. Error message below:
me@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2
awk: cmd. line:1: ^ syntax error
Restore mail process with session full-20260214231158 started at Wed Feb 18 14:18:20 UTC 2026Academic tradition requires you to cite works you base your article on.
If you use programs that use GNU Parallel to process data for an article in a
scientific publication, please cite:

  Tange, O. (2024, December 22). GNU Parallel 20241222 ('Bashar').
  Zenodo. https://doi.org/10.5281/zenodo.14550073

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

More about funding GNU Parallel and the citation notice:
https://www.gnu.org/software/parallel/parallel_design.html#citation-notice

To silence this citation notice: run 'parallel --citation' once.

Error during the restore process for account ham@florianheigl.me. Error message below:
ham@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account spam@florianheigl.me. Error message below:
spam@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account virus-quarantine@florianheigl.me. Error message below:
virus-quarantine@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account admin@florianheigl.me. Error message below:
admin@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account galsync@deranfangvomen.de. Error message below:
galsync@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account galsync.famvdyndow@florianheigl.me. Error message below:
galsync.famvdyndow@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account galsync@wartungsfenster.de. Error message below:
galsync@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account confluserv@wartungsfenster.de. Error message below:
confluserv@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account office@florianheigl.me. Error message below:
office@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account f.heigl@wartungsfenster.de. Error message below:
f.heigl@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account fheigl@wartungsfenster.de. Error message below:
fheigl@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account paypal_floh@deranfangvomen.de. Error message below:
paypal_floh@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account galsync@florianheigl.de. Error message below:
galsync@florianheigl.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account fh@florianheigl.de. Error message below:
fh@florianheigl.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account synomsg@florianheigl.me. Error message below:
synomsg@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account cloud@deranfangvomen.de. Error message below:
cloud@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account floh@deranfangvomen.de. Error message below:
floh@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry)
Error during the restore process for account me@florianheigl.me. Error message below:
me@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry)

Restore mail process with session full-20260214231158 completed at Wed Feb 18 14:18:36 UTC 2026
[zimbra@zmail ~]$ echo $?
0

So, point being:

for now,

  • don't look at the invalid credentials
  • don't look at the awk
    but
  • look at the "Restore mail process completed"

What I've done for similar scripts is to have counters that track individual things

  • objects to process, i.e. number of accounts that are in the backup
  • number of objects requested
  • requested to restore
  • number of tasks
  • number of tasks completed
  • number of ldap calls (add/update)

you can output that as json and you can have some thresholds
you can then also make some wise choices like

  • all galsync accounts failed to restore, all user mailboxes restored

besides that it'll give you options to

  • have a bucket for failed objects, to list or even to retry
  • have self-diagnostics and not proceed if you keep a 100% error rate (i.e. only try the first 3 items of a class, then give up on that)

if you consider that useful, I can try to find leftovers of example code. most was written at client projects and is thus not accessible.

Originally created by @FlorianHeigl on GitHub (Feb 18, 2026). Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/192 Hi, i'm trying to step over #160, LDAP insta-destruction Please note I have some memory issues and this stuff is something I probably already solved years ago, but have no recollection of. if it turns out to be a FAQ, just let me know and don't stab me, please. Main thing I notice and that will matter for your 2.0 version: Currently, there's bad handling of global state. So, you'll get a report the restort process completed (true), which decides the main exit codes (bad), when it failed _ALL_ individual steps (bad) I'm dropping the whole log here for reference. But I'll explain again below. ``` [zimbra@zmail ~]$ zmbackup -r full-20260214231158 Restore LDAP process with session full-20260214231158 started at Wed Feb 18 14:18:20 UTC 2026 Academic tradition requires you to cite works you base your article on. If you use programs that use GNU Parallel to process data for an article in a scientific publication, please cite: Tange, O. (2024, December 22). GNU Parallel 20241222 ('Bashar'). Zenodo. https://doi.org/10.5281/zenodo.14550073 This helps funding further development; AND IT WON'T COST YOU A CENT. If you pay 10000 EUR you should feel free to use GNU Parallel without citing. More about funding GNU Parallel and the citation notice: https://www.gnu.org/software/parallel/parallel_design.html#citation-notice To silence this citation notice: run 'parallel --citation' once. Error during the restore process for account virus-quarantine@florianheigl.me. Error message below: virus-quarantine@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error Error during the restore process for account admin@florianheigl.me. Error message below: admin@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error [...] Error during the restore process for account fh@florianheigl.de. Error message below: fh@florianheigl.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error Error during the restore process for account cloud@deranfangvomen.de. Error message below: cloud@deranfangvomen.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error Error during the restore process for account floh@deranfangvomen.de. Error message below: floh@deranfangvomen.de: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error Error during the restore process for account me@florianheigl.me. Error message below: me@florianheigl.me: ldap_bind: Invalid credentials (49)awk: cmd. line:1: print $2 awk: cmd. line:1: ^ syntax error Restore mail process with session full-20260214231158 started at Wed Feb 18 14:18:20 UTC 2026Academic tradition requires you to cite works you base your article on. If you use programs that use GNU Parallel to process data for an article in a scientific publication, please cite: Tange, O. (2024, December 22). GNU Parallel 20241222 ('Bashar'). Zenodo. https://doi.org/10.5281/zenodo.14550073 This helps funding further development; AND IT WON'T COST YOU A CENT. If you pay 10000 EUR you should feel free to use GNU Parallel without citing. More about funding GNU Parallel and the citation notice: https://www.gnu.org/software/parallel/parallel_design.html#citation-notice To silence this citation notice: run 'parallel --citation' once. Error during the restore process for account ham@florianheigl.me. Error message below: ham@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account spam@florianheigl.me. Error message below: spam@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account virus-quarantine@florianheigl.me. Error message below: virus-quarantine@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account admin@florianheigl.me. Error message below: admin@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account galsync@deranfangvomen.de. Error message below: galsync@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account galsync.famvdyndow@florianheigl.me. Error message below: galsync.famvdyndow@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account galsync@wartungsfenster.de. Error message below: galsync@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account confluserv@wartungsfenster.de. Error message below: confluserv@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account office@florianheigl.me. Error message below: office@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account f.heigl@wartungsfenster.de. Error message below: f.heigl@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account fheigl@wartungsfenster.de. Error message below: fheigl@wartungsfenster.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account paypal_floh@deranfangvomen.de. Error message below: paypal_floh@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account galsync@florianheigl.de. Error message below: galsync@florianheigl.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account fh@florianheigl.de. Error message below: fh@florianheigl.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account synomsg@florianheigl.me. Error message below: synomsg@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account cloud@deranfangvomen.de. Error message below: cloud@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account floh@deranfangvomen.de. Error message below: floh@deranfangvomen.de: ERROR: service.FAILURE (system failure: unable to refresh entry) Error during the restore process for account me@florianheigl.me. Error message below: me@florianheigl.me: ERROR: service.FAILURE (system failure: unable to refresh entry) Restore mail process with session full-20260214231158 completed at Wed Feb 18 14:18:36 UTC 2026 [zimbra@zmail ~]$ echo $? 0 ``` So, point being: for now, - don't look at the invalid credentials - don't look at the awk but - look at the "Restore mail process completed" What I've done for similar scripts is to have counters that track individual things - objects to process, i.e. number of accounts that are in the backup - number of objects requested - requested to restore - number of tasks - number of tasks completed - number of ldap calls (add/update) you can output that as json and you can have some thresholds you can then also make some wise choices like - all galsync accounts failed to restore, all user mailboxes restored besides that it'll give you options to - have a bucket for failed objects, to list or even to retry - have self-diagnostics and not proceed if you keep a 100% error rate (i.e. only try the first 3 items of a class, then give up on that) if you consider that useful, I can try to find leftovers of example code. most was written at client projects and is thus not accessible.
Author
Owner

@FlorianHeigl commented on GitHub (Feb 18, 2026):

i still need to solve the goddamn error now so I can get my mails back. the zimba-jetty-distribution incompatibilities have destroyed my setup for good, I don't want to restore it since Synology Backup inflates the LMDB file to a proper 100GB size and uninstalling Zimbra had already deleted the whole server. God I love this stuff.

<!-- gh-comment-id:3921166151 --> @FlorianHeigl commented on GitHub (Feb 18, 2026): i still need to solve the goddamn error now so I can get my mails back. the zimba-jetty-distribution incompatibilities have destroyed my setup for good, I don't want to restore it since Synology Backup inflates the LMDB file to a proper 100GB size and uninstalling Zimbra had already deleted the whole server. God I love this stuff.
Author
Owner

@lucascbeyeler commented on GitHub (Feb 20, 2026):

Thanks for the feedback - I will keep that in mind as I proceed with Version 2.0. It has been so long since I did 1.6 in Bash that I am not sure how stable it is since there is a lack of unit and functional tests. And tbh putting effort on having those will be for nothing if I am working on V2.

If you find any fixes feel free to push and I will merge on the branch.

<!-- gh-comment-id:3933148879 --> @lucascbeyeler commented on GitHub (Feb 20, 2026): Thanks for the feedback - I will keep that in mind as I proceed with Version 2.0. It has been so long since I did 1.6 in Bash that I am not sure how stable it is since there is a lack of unit and functional tests. And tbh putting effort on having those will be for nothing if I am working on V2. If you find any fixes feel free to push and I will merge on the branch.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zmbackup#155
No description provided.