1

Topic: database backup - ERROR 1049 (42000): Unknown database 'iredadmin'

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.2 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: PRETTY_NAME="Ubuntu 22.04.1 LTS"
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MARIADB)
- 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.
====

Nightly cron e-mail with following body:

ERROR 1049 (42000): Unknown database 'iredadmin'
ERROR 1049 (42000): Unknown database 'iredadmin'
ERROR 1049 (42000): Unknown database 'iredadmin'
ERROR 1049 (42000): Unknown database 'iredadmin'
==> Backup completed successfully.
==> Detailed log (/var/vmail/backup/mysql/2023/01/14/2023-01-14-03-30-01.log):
=========================
* Starting backup: 2023-01-14-03-30-01.
* Backup directory: /var/vmail/backup/mysql/2023/01/14.
* Backing up databases: mysql vmail roundcubemail amavisd iredadmin sogo iredapd sa_bayes.
* File size:
----
8.0K    amavisd-2023-01-14-03-30-01.sql.bz2
12K    iredapd-2023-01-14-03-30-01.sql.bz2
388K    mysql-2023-01-14-03-30-01.sql.bz2
8.0K    vmail-2023-01-14-03-30-01.sql.bz2
----
* Backup completed (Success? YES).



Errormessage is:

ERROR 1049 (42000): Unknown database 'iredadmin'


It is the same issue, that was reported in this old and closed thread:
topic10855-internal-server-error-at-iredadmin.html

There it was not resolved but was closed as user fixed it by chaning the setup with MySQL instead of MariaDB. But I think he made some othere decisions than before.

Whoever might stumble accross this error:

This error occured in my fresh setup when I ran the iRedMail installer
install.iredmail.on.debian.ubuntu.html

with

bash iRedMail.sh

and I decided to NOT install iRedAdmin.

Options to handle this error:

  1. you can just ignore it

  2. you can install iRedAdmin

  3. you can create an empty database 'iredadmin'

  4. you can modify the backup process

For the last option:
modify

vi /var/vmail/backup/backup_mysql.sh

remove the missing database here:

export DATABASES='mysql vmail roundcubemail amavisd iredadmin sogo iredapd sa_bayes'

Please be aware, that you are responsible to keep track of the changes, necessary for the two last options. Changes can be lost or create conflicts during any update procedures in the future.

IMHO:
I may have missed a reference to the behavior, but I suggest keeping it that way and including it in the documentation.

I would not modify the installer to dynamically generate the backup script, as this only creates more possible error sources and few of the users are likely to check the backup sufficiently.

----

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

2

Re: database backup - ERROR 1049 (42000): Unknown database 'iredadmin'

Thanks for the feedback. Fixed moment ago:
https://github.com/iredmail/iRedMail/co … 889b06cdaf