iredmail / dockerized

Official dockerized iRedMail.
https://www.iredmail.org/
272 stars 70 forks source link

MariaDB lost settings ? #13

Closed ricristian closed 4 years ago

ricristian commented 4 years ago

Hello,

I've started working with latest nightly docker tag, I've maded steps described in documentation everything was working perfectly .. but after Ive made a few docker stop iredmail && docker start iredmail .. I saw that some erros occurs in docker logs

docker logs --follow iredmail

[iRedMail] [Entrypoint] /docker/entrypoints/mariadb.sh 
[iRedMail] Starting temporary MariaDB instance.
2020-06-02 23:45:51 0 [Note] mysqld (mysqld 10.4.13-MariaDB-log) starting as process 164 ...
[iRedMail] Reset password for SQL user 'root'.
[iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmail'@'%'
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmailadmin'@'%'
[iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'.
[iRedMail] Make sure postmaster@domain-name.com is a global admin.
[iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'amavisd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'fail2ban'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredadmin_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredadmin'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredapd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/roundcube.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'roundcube'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/sa_bayes.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'sa_bayes'@'%'
[iRedMail] [Entrypoint] /docker/entrypoints/dovecot.sh 
[iRedMail] Generating self-signed ssl cert under /opt/iredmail/ssl.
Generating a RSA private key
......++++
.................................................................................................................................................++++
writing new private key to '/opt/iredmail/ssl/key.pem'
-----
[iRedMail] Generating dh param file: /opt/iredmail/ssl/dhparam2048.pem. It make take a long time.
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
....................................................................+.......................................................+................+.........................................................................................+.................................................................................+..........................+........................................................................+.........................................+............................................................+................+.........................................................................+.........................................................................................+......................................................................................+.................+............................+..................................................................................................................................................................+..............................+..............................................................+..................+.....+.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+....................+....................................................................+.....................................................................+.........................+...........................................................+......................................................+........................................................................................................+.....................................................................................................................................................................................................................................................................................+.......................................+............+...........................................................+........................................................................................................................................................................................................+.......................................................................................................+......+..........+..........................+...........................................................+.........................+..+....................................................................................................................................................................................................+...................................+......................................................................................................................................+..........+.................+.....................................................+..............+....................................................................................................................................................................................+.....................................................................................................................................+........................................................................................................................+................+...+..............+....................................+........+.........................+.....................................+.......................................+.....................+................................................................................................+..........................................................+.......................................................................................+................................+...................................................................+..................................................................................................................+............................................................+....................................................................................................+....................................................................................+..............................+............................................................................................................................+................................................................+.................+.......................................................................................................................+.......................................................................................................................................................................................................................................................................................+....................................................................................................................................................................................+.............+.........................................+...........................+.......................+.................................................................+...............................................+...............................................................................................................................................+...................+..............+....+................+......................................................................................................................................................................................+................+..............+.+.....................................................+..+.........................................................................+......................................................+...................................................................................................................................................................+...+...........................................+.......................................................+................++*++*++*++*
[iRedMail] [Entrypoint] /docker/entrypoints/postfix.sh 
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time
..+.....+..........+.......+.................+....+.....+........+............++*++*++*++*++*
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmj.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmjadmin.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredapd.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/antispam.sh 
[iRedMail] Run 'sa-update' (required by Amavisd).
Update finished, no fresh updates were available
[iRedMail] [Entrypoint] /docker/entrypoints/nginx.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/phpfpm.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/roundcube.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/fail2ban.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredadmin.sh 
[iRedMail] CMD: /usr/bin/supervisord -c /etc/supervisord.

Also i tried to look in /var/lib/mysql from container to see if there are files and it seems ok

total 188704
     4 drwxr-xr-x   11 mysql    root          4096 Jun  3 10:51 .
     8 drwxr-xr-x    1 root     root          4096 Jun  2 23:46 ..
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 amavisd
    68 -rw-rw----    1 mysql    mysql        65536 Jun  3 10:55 aria_log.00000001
     4 -rw-rw----    1 mysql    mysql           52 Jun  3 10:51 aria_log_control
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 fail2ban
     8 -rw-r-----    1 mysql    mysql         4114 Jun  3 10:51 ib_buffer_pool
 49152 -rw-rw----    1 mysql    mysql     50331648 Jun  3 10:55 ib_logfile0
 49152 -rw-rw----    1 mysql    mysql     50331648 Jun  2 23:25 ib_logfile1
 77824 -rw-rw----    1 mysql    mysql     79691776 Jun  3 10:55 ibdata1
 12288 -rw-rw----    1 mysql    mysql     12582912 Jun  3 10:51 ibtmp1
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 iredadmin
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 iredapd
     0 -rw-rw----    1 mysql    mysql            0 Jun  2 23:25 multi-master.info
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 mysql
    68 -rw-rw----    1 mysql    mysql        61981 Jun  3 10:57 mysqld.err
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 performance_schema
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 roundcubemail
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 sa_bayes
    92 -rw-rw----    1 mysql    mysql        87682 Jun  3 10:51 slow-query.log
     4 drwx------    2 mysql    mysql         4096 Jun  2 23:25 vmail
iredmail commented 4 years ago

ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist

Anything changed during stop and restart? IP address?

ricristian commented 4 years ago

Nope, nothing.

iredmail commented 4 years ago

hmm, i didn't experience this error before, no clue right now. :(

Did you restore the databases?

ricristian commented 4 years ago

Nope nothing ... Instead I saw something weird regarding cron jobs but this is another topic and I will come back with more details after I will make more debugging.

As for maria db since I don't have any backup ... probabil I will try to reinitiate the whole process since now I have that ansible role

iredmail commented 4 years ago

Try to reproduce the issue steadily, it will help figure out the root cause and hopefully fix it.

ricristian commented 4 years ago

Ok, So i've created an folder called iredmail under / -> final result /iredmail under this /iredmail folder I will have docker-iredmail.conf

root@2q1e:/iredmail# tree -d 
.
`-- data
    |-- backup
    |-- clamav
    |   `-- tmp
    |-- custom
    |   |-- amavisd
    |   |   `-- dkim
    |   |-- dovecot
    |   |   `-- conf-enabled
    |   |-- iredapd
    |   |-- mlmmjadmin
    |   |-- mysql
    |   |-- postfix
    |   |   `-- disclaimer
    |   |-- roundcube
    |   `-- spamassassin
    |-- imapsieve_copy
    |-- mailboxes
    |-- mlmmj
    |-- mlmmj-archive
    |-- mysql
    |   |-- amavisd
    |   |-- fail2ban
    |   |-- iredadmin
    |   |-- iredapd
    |   |-- mysql
    |   |-- performance_schema
    |   |-- roundcubemail
    |   |-- sa_bayes
    |   `-- vmail
    |-- postfix_queue
    |   `-- etc
    |-- sa_rules
    |   `-- 3.004003
    |       `-- updates_spamassassin_org
    `-- ssl

36 directories

Which seems ok ... ( all subfolders where created by image tag: nightly ) I've started the container -> OK ( all logs seems to be ok roundcube is working and so on ) If I will hit docker stop iredmail && docker start iredmail && docker logs --follow iredmail than game is over and errors that I;ve shown earlier comes up and roundcube webpage will show DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator.

iredmail commented 4 years ago

Seems docker start iredmail loses all environment variables, there's no relations between your iredmail container and data under /iredmail/ directory.

ricristian commented 4 years ago

I'm not that sure because if i will check environments variables from container with docker exec -it iredmail sh and then env I will see variables from iredmail-docker.config

HOSTNAME=mail.domain-name.com
SHLVL=1
HOME=/root
FIRST_MAIL_DOMAIN=domain-name.com
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ROUNDCUBE_DES_KEY=72neDbKMUfkoMvncqoe0OKy6jeSV5Rlc
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=
PWD=/
MLMMJADMIN_API_TOKEN=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=

I've removed volume attachment for myql in order to see if data will persist in container directly without volume which docker start / stop should still keep data but unfortunately same errors

iRedMail] [Entrypoint] /docker/entrypoints/mariadb.sh 
[iRedMail] Starting temporary MariaDB instance.
2020-06-03 21:06:17 0 [Note] mysqld (mysqld 10.4.13-MariaDB-log) starting as process 236 ...
[iRedMail] Reset password for SQL user 'root'.
[iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmail'@'%'
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmailadmin'@'%'
[iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'.
[iRedMail] Make sure postmaster@domain-name.com is a global admin.
[iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'amavisd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'fail2ban'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredadmin_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredadmin'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredapd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/roundcube.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'roundcube'@'%'
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)
ERROR: Failed to connect to database
[iRedMail] [Run] /docker/mariadb/pre_start/sa_bayes.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'sa_bayes'@'%'
[iRedMail] [Entrypoint] /docker/entrypoints/dovecot.sh 
ln: /etc/dovecot/conf-enabled/service-imap-hibernate.conf: File exists
ln: /etc/dovecot/conf-enabled/stats.conf: File exists
[iRedMail] [Entrypoint] /docker/entrypoints/postfix.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmj.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmjadmin.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredapd.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/antispam.sh 
[iRedMail] Run 'sa-update' (required by Amavisd).
Update finished, no fresh updates were available
[iRedMail] [Entrypoint] /docker/entrypoints/nginx.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/phpfpm.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/roundcube.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/fail2ban.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredadmin.sh 
[iRedMail] CMD: /usr/bin/supervisord -c /etc/supervisord.conf
iredmail commented 4 years ago

I've removed volume attachment for myql in order to see if data will persist in container directly without volume which docker start / stop should still keep data but unfortunately same errors

What does this mean? You removed the volume used to store MySQL databases and start the container?

ricristian commented 4 years ago

I've made again same steps except mounting mysql volume. In case of start stop docker container won't lose data. ( In our case mysql should'nt lose settings but unfortunately it seems that db loses data)

Update: I found something really interesting ... I've tried to start mysql manually from container with sh /docker/entrypoints/mariadb.sh and i received:

[iRedMail] ERROR: Variable MYSQL_ROOT_PASSWORD can not be empty, please set it in 'iredmail-docker.conf'.

After I tried to see what is in /docker/entrypoints/settings.conf

/ # cat /docker/entrypoints/settings.conf
#
# This file is managed by iRedMail Team <support@iredmail.org> with Ansible,
# please do __NOT__ modify it manually.
#

# All default settings.
#
# To override any of them, please write same parameter name in
# `iredmail-docker.conf` with the custom value, then load
# `iredmail-docker.conf` as docker env file with the `--env-file` argument.

##############################
# REQUIRED
##############################
# Server hostname and first mail domain
HOSTNAME=mail.domain-name.com
FIRST_MAIL_DOMAIN=domain-name.com
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=

# The secret string used to encrypt/decrypt Roundcube session data.
# You can generate random string with command `openssl rand -base64 24` as the
# des key.
# Every time this key changed, all Roundcube session data becomes invalid and
# users will be forced to re-login.
ROUNDCUBE_DES_KEY=72neDbKMUfkoMvncqoe0OKy6jeSV5Rlc

##############################
# OPTIONAL
##############################
# Server admin's email address.
# If not set, `postmaster@${FIRST_MAIL_DOMAIN}` will be used.
POSTMASTER_EMAIL=

# Directory used to store all users' mailboxes.
MAILBOXES_DIR=/var/vmail/vmail1

#
# SQL server.
#
SQL_SERVER_ADDRESS=127.0.0.1
SQL_SERVER_PORT=3306

#
# Passwords.
# Set random passwords for ALL MySQL root user each time the container starts.
#
# Available values: YES, NO.
MYSQL_USE_RANDOM_PASSWORDS=YES

# Passwords for SQL users:
# root, vmail, vmailadmin, amavisd, roundcube, iredapd, fail2ban.
#
# If value is not empty, it will be used and not use random password while
# `MYSQL_USE_RANDOM_PASSWORDS=YES`.
MYSQL_ROOT_PASSWORD=
VMAIL_DB_PASSWORD=
VMAIL_DB_ADMIN_PASSWORD=
AMAVISD_DB_PASSWORD=
ROUNDCUBE_DB_PASSWORD=
IREDAPD_DB_PASSWORD=
IREDADMIN_DB_PASSWORD=
FAIL2BAN_DB_PASSWORD=
SA_BAYES_DB_PASSWORD=

# API tokens.
MLMMJADMIN_API_TOKEN=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=

#
# Enable/disable components
#
USE_IREDAPD=YES
USE_ANTISPAM=YES
USE_FAIL2BAN=YES
USE_ROUNDCUBE=YES
USE_IREDADMIN=YES

# SOGo requires another container: https://hub.docker.com/r/iredmail/sogo
USE_SOGO=YES

#
# Enable/disable features
#
# Send /root/iRedMail.tips to postmaster@ each time launching the container.
MAIL_THE_TIP_FILE=YES

FAIL2BAN_STORE_BANNED_IP_IN_DB=YES
POSTFIX_ENABLE_SRS=YES
IREDAPD_SRS_SECRET=

# Mail message size (in MB).
MESSAGE_SIZE_LIMIT_IN_MB=50

# Upload size limited by Nginx and php-fpm.
# Note: if you use webmail, it should be larger than `MESSAGE_SIZE_LIMIT_IN_MB`.
WEB_UPLOAD_SIZE_LIMIT_IN_MB=30

# Memcached cache size.
MEMCACHED_CACHE_SIZE_IN_MB=64

##############################
MYSQL_ROOT_PASSWORD=NuHbpz6oITFzCBZIvidaEmjxTyWSLj
VMAIL_DB_PASSWORD=JyrwfyHOXLFUTcAHRwtmitXn0YSUHd
VMAIL_DB_ADMIN_PASSWORD=FzScl2BdG95rFhoGAWxXQzPmoGJT1K
AMAVISD_DB_PASSWORD=gzPIDt8TC5rJe9l0me5fZ3tT3Njryo
ROUNDCUBE_DB_PASSWORD=MpMdgsjOZF8gBzjX0Blre8Hh73wGHb
IREDAPD_DB_PASSWORD=mQPx4ZV50CpdFOSpvalvYOFhkkxd4K
IREDADMIN_DB_PASSWORD=G4zRC9anOTMRIEqQNFUBmoLyYLTKCJ
FAIL2BAN_DB_PASSWORD=6vKVaSgI7dLkZL5keAqaJX0dgf7RHZ
SA_BAYES_DB_PASSWORD=B5u9oL05eOxAxr7sO6YDvD5hBuhFXT
MYSQL_ROOT_PASSWORD=1g69OgLkguyovPVprpvQM5AYpQ41Ym
VMAIL_DB_PASSWORD=SpbongRFnR2gvYwLizqjmapxgnAfL4
VMAIL_DB_ADMIN_PASSWORD=2UFfmFPDkodmTwxNlyElExFH7KPviQ
AMAVISD_DB_PASSWORD=X13Kv1WbIQjPAM7UtPqrJvkqbCHOcT
ROUNDCUBE_DB_PASSWORD=Y2QEUismdupo9FUNV12DZxFRP7pAKI
IREDAPD_DB_PASSWORD=NGemD02zDLfnbLhkVsP3WhVvcoFeSL
IREDADMIN_DB_PASSWORD=3CJ2icCysBrcdifJHTNKbe3mjM7swJ
FAIL2BAN_DB_PASSWORD=uDPNonKZDKZeI1xR7INc1QCLL1UXcl
SA_BAYES_DB_PASSWORD=ZGECusbqZlJCsJJY99RNzTjRPbmUof
MYSQL_ROOT_PASSWORD=zjL3jhYqJyowlgZR5HKR2DdW1Yo62Q
VMAIL_DB_PASSWORD=iCHy4vOsjfad4f6q0VUn3ah5lEtRWP
VMAIL_DB_ADMIN_PASSWORD=QPb5BltlYz3s4g9sCUbr7XXLbtqN5B
AMAVISD_DB_PASSWORD=lNRPSnoPwMg20zz5uHqw2uySnaKKhy
ROUNDCUBE_DB_PASSWORD=G3nLQo2nsyT4njEmvizy52VQyIoNxx
IREDAPD_DB_PASSWORD=KGoFQvJtjmW56E72posa4MXPGzvqHL
IREDADMIN_DB_PASSWORD=CqGpg7nAWlTzlX3QpNqic3gSGYljtS
FAIL2BAN_DB_PASSWORD=4U8LYeSHVWqE3Gb3hBDG7ocujMYRaH
SA_BAYES_DB_PASSWORD=zT2ymAnlcrByOWWlhvKN5G1L62euad

Apparently passwords are not replaced by docker stop / start instead values are appended which may cause the whole situation .. Since those scripts comes built in with docker image hosted on dockerhub ... is there any chance to be some scripts with issues. ?

Many thanks

iredmail commented 4 years ago
iredmail commented 4 years ago

Please record the steps you ran to reproduce the issue, so that others can reproduce and help test and fix it.

ricristian commented 4 years ago

In order not to waste time by writing each step I've recorded my screen with steps ... https://www.youtube.com/watch?v=gWowzbRoWGg

iredmail commented 4 years ago

Thanks for the video, but it doesn't help much. I need a step-by-step instruction to reproduce the issue, which includes:

So that i can reproduce the issue locally and hopefully fix it.

ricristian commented 4 years ago

I'm not sure that I understand. In video is shown that it is a clear environment without any iredmail folder / configuration. That ansible will so everything and then after start stop docker variables from dockerized config are duplicated. There is no docker process issues or something like that.

iredmail commented 4 years ago

Oops, my mistake. Can you reproduce this issue if you pull/run the image manually (instead of deploying with Ansible)? Just want to make sure it's not an issue of your Ansible code.

iredmail commented 4 years ago

Any update?

b68h4 commented 4 years ago

i get the same mariadb error too I couldn't find a solution, it prevents sending e-mails The command I use is:

docker run \ --name iredmail \ --env-file iredmail-docker.conf \ --hostname roundcube.over-click.codes \ -p 1010:80 \ -p 1011:443 \ -p 110:110 \ -p 995:995 \ -p 143:143 \ -p 993:993 \ -p 25:25 \ -p 465:465 \ -p 587:587 \ -v /iredmail/data/backup:/var/vmail/backup \ -v /iredmail/data/mailboxes:/var/vmail/vmail1 \ -v /iredmail/data/mlmmj:/var/vmail/mlmmj \ -v /iredmail/data/mlmmj-archive:/var/vmail/mlmmj-archive \ -v /iredmail/data/imapsieve_copy:/var/vmail/imapsieve_copy \ -v /iredmail/data/custom:/opt/iredmail/custom \ -v /iredmail/data/ssl:/opt/iredmail/ssl \ -v /iredmail/data/mysql:/var/lib/mysql \ -v /iredmail/data/clamav:/var/lib/clamav \ -v /iredmail/data/sa_rules:/var/lib/spamassassin \ iredmail/mariadb:nightly

b68h4 commented 4 years ago

Fix the error please

iredmail commented 4 years ago

@bsglinux16 whats the error message?

b68h4 commented 4 years ago

[iRedMail] Create directory used to store custom config files: /opt/iredmail/custom/mysql. [iRedMail] Initializing database ... [iRedMail] Starting temporary MariaDB instance. 2020-06-23 14:13:56 0 [Note] mysqld (mysqld 10.4.13-MariaDB-log) starting as process 233 ... [iRedMail] Create MariaDB root user. [iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] Create database 'vmail' and tables. [iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'. [iRedMail] Create first mail domain: over-click.codes. [iRedMail] Add user postmaster@over-click.codes. [iRedMail] Add (internal) mail forwarding for postmaster@over-click.codes. [iRedMail] Make sure postmaster@over-click.codes is a global admin. [iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh [iRedMail] + Create database amavisd. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] + Create default spam policy. [iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh [iRedMail] + Create database fail2ban. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] [Run] /docker/mariadb/pre_start/iredadmin_db.sh [iRedMail] + Create database iredadmin. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh [iRedMail] + Create database iredapd. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist

b68h4 commented 4 years ago

it continues with errors like this I can't send mail when I enter the panel after the installation is over

iredmail commented 4 years ago

@bsglinux16 Which Linux host OS and release are you running?

b68h4 commented 4 years ago

Ubuntu Server 16.04 Docker version 18.09.7, build 2d0083d

iredmail commented 4 years ago

@bsglinux16 is it possible for you to try it with a Ubuntu 18.04 machine?

b68h4 commented 4 years ago

I can open a temporary Ubuntu Server 18.04 I will throw the result to you

b68h4 commented 4 years ago

[iRedMail] Create directory used to store custom config files: /opt/iredmail/custom/mysql. [iRedMail] Initializing database ... [iRedMail] Starting temporary MariaDB instance. 2020-06-23 14:26:52 0 [Note] mysqld (mysqld 10.4.13-MariaDB-log) starting as process 232 ... [iRedMail] Create MariaDB root user. [iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] Create database 'vmail' and tables. [iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'. [iRedMail] Create first mail domain: over-click.codes. [iRedMail] Add user postmaster@over-click.codes. [iRedMail] Add (internal) mail forwarding for postmaster@over-click.codes. [iRedMail] Make sure postmaster@over-click.codes is a global admin. [iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh [iRedMail] + Create database amavisd. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] + Create default spam policy. [iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh [iRedMail] + Create database fail2ban. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] [Run] /docker/mariadb/pre_start/iredadmin_db.sh [iRedMail] + Create database iredadmin. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh [iRedMail] + Create database iredapd. ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] + Enable greylisting. [iRedMail] [Run] /docker/mariadb/pre_start/roundcube.sh [iRedMail] + Import /opt/www/roundcubemail/SQL/mysql.initial.sql ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist [iRedMail] [Run] /docker/mariadb/pre_start/sa_bayes.sh [iRedMail] + Create database sa_bayes. [iRedMail] + Import sa_bayes.mysql ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist .......

b68h4 commented 4 years ago

It's the same on every server again Cannot Send Emails Stuck on "Sending Message" [Roundcube]

b68h4 commented 4 years ago

I'm not that sure because if i will check environments variables from container with docker exec -it iredmail sh and then env I will see variables from iredmail-docker.config

HOSTNAME=mail.domain-name.com
SHLVL=1
HOME=/root
FIRST_MAIL_DOMAIN=domain-name.com
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ROUNDCUBE_DES_KEY=72neDbKMUfkoMvncqoe0OKy6jeSV5Rlc
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=
PWD=/
MLMMJADMIN_API_TOKEN=FaxewEJDJ1DRugn6qIwQtZ9haON2BU9vhgqCTn6+XQE=

I've removed volume attachment for myql in order to see if data will persist in container directly without volume which docker start / stop should still keep data but unfortunately same errors

iRedMail] [Entrypoint] /docker/entrypoints/mariadb.sh 
[iRedMail] Starting temporary MariaDB instance.
2020-06-03 21:06:17 0 [Note] mysqld (mysqld 10.4.13-MariaDB-log) starting as process 236 ...
[iRedMail] Reset password for SQL user 'root'.
[iRedMail] [Run] /docker/mariadb/pre_start/0-vmail_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmail'@'%'
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'vmailadmin'@'%'
[iRedMail] Grant privileges to SQL user 'vmail' and 'vmailadmin'.
[iRedMail] Make sure postmaster@domain-name.com is a global admin.
[iRedMail] [Run] /docker/mariadb/pre_start/amavisd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'amavisd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/fail2ban_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'fail2ban'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredadmin_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredadmin'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/iredapd_db.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'iredapd'@'%'
[iRedMail] [Run] /docker/mariadb/pre_start/roundcube.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'roundcube'@'%'
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)
ERROR: Failed to connect to database
[iRedMail] [Run] /docker/mariadb/pre_start/sa_bayes.sh
ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'sa_bayes'@'%'
[iRedMail] [Entrypoint] /docker/entrypoints/dovecot.sh 
ln: /etc/dovecot/conf-enabled/service-imap-hibernate.conf: File exists
ln: /etc/dovecot/conf-enabled/stats.conf: File exists
[iRedMail] [Entrypoint] /docker/entrypoints/postfix.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmj.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/mlmmjadmin.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredapd.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/antispam.sh 
[iRedMail] Run 'sa-update' (required by Amavisd).
Update finished, no fresh updates were available
[iRedMail] [Entrypoint] /docker/entrypoints/nginx.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/phpfpm.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/roundcube.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/fail2ban.sh 
[iRedMail] [Entrypoint] /docker/entrypoints/iredadmin.sh 
[iRedMail] CMD: /usr/bin/supervisord -c /etc/supervisord.conf

If I don't use the --rm parameter, I get the same error with this friend in my 2nd opening

b68h4 commented 4 years ago

Please Help

iredmail commented 4 years ago

Hi @bsglinux16 @ricristian

All issues have been fixed. Could you please try again?

b68h4 commented 4 years ago

Thanks Mysql Errors Fixed Throws Roundcube Mail But Emails Do Not Come To Inbox Or Spam I think the problem may be due to Roundcube

iredmail commented 4 years ago

Any error in log files listed below?

I pushed a new fix moment ago, could you please try the latest Docker image?

iredmail commented 4 years ago

Closed due to no further update. Feel free to create a new issue.