1

Topic: Error while doing automated backup

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello, I just installed iRedMail and so far I love it! I just found an error when cron is running the backups jobs, each one suceeds but throws an error about an table not found.

Any way to fix this? I assume it's because I haven't installed iredAdmin, since I wrote myself an CLI tool to administrate my server.

here are the logs:

5c8c58a1 The first database does not allow slapcat; using the first available one (2)
* Starting backup at 2019-03-16-03-00-01
* Backup directory: /var/vmail/backup/ldap/2019/03.
* Dumping LDAP data into file: /var/vmail/backup/ldap/2019/03/2019-03-16-03-00-01.ldif...
* Compressing LDIF file with command: 'bzip2 -9' ...
* [DONE]
* Removing plain LDIF file: /var/vmail/backup/ldap/2019/03/2019-03-16-03-00-01.ldif... [DONE]
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
* File size:
=================
4.0K /var/vmail/backup/ldap/2019/03/2019-03-16-03-00-01.ldif.bz2
=================
* [ OK ] Backup completes successfully.

sql backup:

ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist
==> Backup completed successfully.
==> Detailed log (/var/vmail/backup/mysql/2019/03/16/2019-03-16-03-30-01.log):
=========================
* Starting backup: 2019-03-16-03-30-01.
* Backup directory: /var/vmail/backup/mysql/2019/03/16.
* Backing up databases: mysql vmail roundcubemail amavisd iredadmin sogo iredapd.
* File size:
----
12K amavisd-2019-03-16-03-30-01.sql.bz2
4.0K iredadmin-2019-03-16-03-30-01.sql.bz2
8.0K iredapd-2019-03-16-03-30-01.sql.bz2
184K mysql-2019-03-16-03-30-01.sql.bz2
8.0K sogo-2019-03-16-03-30-01.sql.bz2
----
* Backup completed (Success? YES).

Sogo backup:

* Backup all users' data under /var/vmail/backup/sogo/2019/03/16
<0x0x5575d57e0a20[SOGoCache]> Cache cleanup interval set every 300.000000 seconds
<0x0x5575d57e0a20[SOGoCache]> Using host(s) '127.0.0.1' as server(s)
2019-03-16 04:01:01.772 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.787 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.790 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.792 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.803 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.813 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.821 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-16 04:01:01.828 sogo-tool[29220:29220] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
* Compress backup files.
ERROR 1146 (42S02) at line 1: Table 'iredadmin.log' doesn't exist

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Error while doing automated backup

Feel free to remove the sql commands used to update "iredadmin" database. I will fix it in next iRedMail release.

3

Re: Error while doing automated backup

Could you help test this patch?
https://bitbucket.org/zhb/iredmail/comm … 03912536c4

4 (edited by jeouz 2019-03-19 01:56:10)

Re: Error while doing automated backup

Alright I will test the patch. Update/Edit see below.

Today I got an new error while running the backup. I did not apply the patch, I will do that laters. 


response after applying your patch:

root@v22018112979977771:~# sh /var/vmail/backup/backup_openldap.sh
/usr/bin/python
5c8fdaef The first database does not allow slapcat; using the first available one (2)
/var/vmail/backup/backup_openldap.sh: 140: [: X0: unexpected operator
/var/vmail/backup/backup_openldap.sh: 168: /var/vmail/backup/backup_openldap.sh: +export: not found
/var/vmail/backup/backup_openldap.sh: 169: /var/vmail/backup/backup_openldap.sh: [[: not found
/var/vmail/backup/backup_openldap.sh: 186: /var/vmail/backup/backup_openldap.sh: [[: not found
/var/vmail/backup/backup_openldap.sh: 199: [: XNO: unexpected operator
/var/vmail/backup/backup_openldap.sh: 205: [: XYES: unexpected operator
* Starting backup at 2019-03-18-18-52-47
* Backup directory: /var/vmail/backup/ldap/2019/03.
* Dumping LDAP data into file: /var/vmail/backup/ldap/2019/03/2019-03-18-18-52-47.ldif...
* File size:
=================
20K     /var/vmail/backup/ldap/2019/03/2019-03-18-18-52-47.ldif
=================
* <<< ERROR >>> Backup not successfully complete.



New log:

* Backup all users' data under /var/vmail/backup/sogo/2019/03/18
<0x0x55b656b770a0[SOGoCache]> Cache cleanup interval set every 300.000000 seconds
<0x0x55b656b770a0[SOGoCache]> Using host(s) '127.0.0.1' as server(s)
2019-03-18 04:01:01.645 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.655 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.657 sogo-tool[20932:20932] user 'bruno' unknown
2019-03-18 04:01:01.657 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.659 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.660 sogo-tool[20932:20932] user 'david' unknown
2019-03-18 04:01:01.661 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.662 sogo-tool[20932:20932] user 'david' unknown
2019-03-18 04:01:01.662 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.664 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.665 sogo-tool[20932:20932] user 'janina' unknown
2019-03-18 04:01:01.665 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.667 sogo-tool[20932:20932] Creating NGLdapConnection instance for bindDN 'cn=vmail,dc=v22018112979977771,dc=ultrasrv,dc=de'
2019-03-18 04:01:01.668 sogo-tool[20932:20932] user 'postmaster' unknown
* Backup is empty, remove temporary backup directory: /var/vmail/backup/sogo/2019/03/18.

5

Re: Error while doing automated backup

Update:

I think I found the mistake which is causing the new error.

I just applied your patch for SOGo and multi-domain adressbooks. https://pastebin.com/5pq0Nbjx
Since that day I get the new error, seems like the binding for the backups are broken now. Could you test it or maybe already got an fix for it? :-)

6

Re: Error while doing automated backup

jeouz wrote:

root@v22018112979977771:~# sh /var/vmail/backup/backup_openldap.sh

You should use "bash" instead of "sh".

jeouz wrote:

I just applied your patch for SOGo and multi-domain adressbooks. https://pastebin.com/5pq0Nbjx
Since that day I get the new error, seems like the binding for the backups are broken now. Could you test it or maybe already got an fix for it? :-)

This config snippet is used for testing the ldap placeholder "%d" in baseDN. You should upgrade SOGo to the latest nightly build to get it working.

7

Re: Error while doing automated backup

Hello again,

I got it working. There is just the error with the backup, when I change the sogo-config to use %d. In that case the backup can't find the users andg vies me the unknown users errors.
Any way we can fix this? I triggered backups manually, which works when an user is currently logged in or within 300seconds. After the Cache is cleaned I get the unknown users errors again.
I already searched at the official SOGo forums tho.

Thank you smile

8

Re: Error while doing automated backup

Another update.

I posted it on the official SOGo forums, here is their response. Seems like we need to write another way to use dynamic domain backups.

https://sogo.nu/bugs/view.php?id=4723