1 (edited by arneboeses 2018-05-29 19:59:50)

Topic: MariaDB error FreeBSD installation

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: FreeBSD 11.1 (JAIL)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? No
====

Hi,

it's me again. I wanted to install iRedMail at this time with MariaDB, but the installations was not successful (log attached). Would be nice, if someone can assist here. The jail is fresh and only the packages tmux, ca_root_nss and bash-static were installed.

*************************************************************************

[root@mail02 ~/iRedMail-0.9.8]# LOCAL_ADDRESS='172.21.13.2' bash iRedMail.sh
[...]

[ INFO ] Configure Nginx web server.
[ INFO ] Configure PHP.
[ INFO ] Configure MariaDB database server.
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
[ INFO ] Setup daily cron job to backup SQL databases with /var/vmail/backup/backup_mysql.sh
[ INFO ] Configure Postfix (MTA).
[ INFO ] Configure Dovecot (POP3/IMAP/Managesieve/LMTP/LDA).
[ INFO ] Configure mlmmj (mailing list manager).
[ INFO ] Configure ClamAV (anti-virus toolkit).
[ INFO ] Configure Amavisd-new (interface between MTA and content checkers).
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
[ INFO ] Configure SpamAssassin (content-based spam filter).
[ INFO ] Configure iRedAPD (postfix policy daemon).
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
[ INFO ] Configure iRedAdmin (official web-based admin panel).
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
[ INFO ] Configure Roundcube webmail.
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server
[ INFO ] Configure SOGo Groupware (Webmail, Calendar, Address Book, ActiveSync).
ERROR 1130 (HY000): Host '172.21.13.2' is not allowed to connect to this MariaDB server

*************************************************************************

Best,
Arne

Post's attachments

install_20180529.log 23.18 kb, 1 downloads since 2018-05-29 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: MariaDB error FreeBSD installation

just wondering why that line is out-commented

Post's attachments

Selection_009.png
Selection_009.png 59.35 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

3

Re: MariaDB error FreeBSD installation

arneboeses wrote:

just wondering why that line is out-commented

That variable was not used.

Could you please show me the "bind-address =" setting in /usr/local/etc/mysql/my.cnf?
Seems there's a bug in iRedMail (file conf/mysql).

4

Re: MariaDB error FreeBSD installation

ZhangHuangbin wrote:

That variable was not used.

Could you please show me the "bind-address =" setting in /usr/local/etc/mysql/my.cnf?
Seems there's a bug in iRedMail (file conf/mysql).

Thanks for looking into it. That could be the problem, as there is no bind-address:

#---------------------------------------------------------------------------------------------------------------------------------

# Example MariaDB config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MariaDB.
#
# MariaDB programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, do:
# 'my_print_defaults --help' and see what is printed under
# Default options are read from the following files in the given order:
# More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MariaDB clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

/usr/local/etc/mysql/my.cnf: unmodified: line 1
# Example MariaDB config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MariaDB.
#
# MariaDB programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, do:
# 'my_print_defaults --help' and see what is printed under
# Default options are read from the following files in the given order:
# More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MariaDB clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MariaDB server
[mysqld]
innodb_file_per_table
port            = 3306
socket          = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

#---------------------------------------------------------------------------------------------------------------------------------

5

Re: MariaDB error FreeBSD installation

Please try this patch for iRedMail-0.9.8:

diff -r 234f76612b2e iRedMail/functions/mysql.sh
--- a/iRedMail/functions/mysql.sh    Tue May 29 17:46:48 2018 +0800
+++ b/iRedMail/functions/mysql.sh    Thu May 31 11:01:44 2018 +0800
@@ -66,7 +66,7 @@
     fi
 
     if [ X"${DISTRO}" == X'FREEBSD' ]; then
-        if [ X"${BACKEND_ORIG}" == X'MYSQL' -o X"${BACKEND}" == X'OPENLDAP' ]; then
+        if [ X"${BACKEND}" == X'MYSQL' -o X"${BACKEND}" == X'OPENLDAP' ]; then
             if [ X"${LOCAL_ADDRESS}" != X'127.0.0.1' ]; then
                 ECHO_DEBUG "Enable 'skip_grant_tables' option, so that we can reset password."
                 perl -pi -e 's#^(\[mysqld\])#${1}\nskip_grant_tables#' ${MYSQL_MY_CNF} >> ${INSTALL_LOG} 2>&1

Apply this patch, then run iRedMail installer on a new FreeBSD jail.

6 (edited by arneboeses 2018-06-01 18:34:28)

Re: MariaDB error FreeBSD installation

installation failed again:

#--------------------------------------------------------------------------------------------
[ INFO ] Configure MariaDB database server.
+ < DEBUG > Initialize MySQL server.
+ < DEBUG > Stop MySQL service before initializing database or updating my.cnf.
+ < DEBUG > Enable mysql service when system start up.
mysql_enable:  -> YES
mysql_optfile:  -> /usr/local/etc/mysql/my.cnf
+ < DEBUG > Copy sample MySQL config file: /usr/local/share/mysql/my-large.cnf -> /usr/local/etc/mysql/my.cnf.
+ < DEBUG > Disable 'skip-networking' in my.cnf.
+ < DEBUG > Set max_connections to 1024.
+ < DEBUG > Enable 'innodb_file_per_table' in my.cnf.
+ < DEBUG > Enable 'skip_grant_tables' option, so that we can reset password.
+ < DEBUG > Enable 'bind-address = 172.21.13.2' in my.cnf.
+ < DEBUG > Restart service: mysql-server.
mysql not running? (check /var/db/mysql/mail02.xxx.yyy.pid).
180601 12:17:35 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180601 12:17:35 [Note] /usr/local/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 32669 ...
180601 12:17:35 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
180601 12:17:35 [Note] /usr/local/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 32671 ...
+ < DEBUG > Sleep 10 seconds for MySQL daemon initialization ...
Database
information_schema
mysql
performance_schema
test
+ < DEBUG > Setting password for MySQL root user: root.
Password    char(41)    NO           
mysqladmin:
You cannot use 'password' command as mysqld runs
with grant tables disabled (was started with --skip-grant-tables).
Use: "mysqladmin flush-privileges password '*'" instead
+ < DEBUG > Generate defauts file for MySQL client option --defaults-file: /root/.my.cnf.
+ < DEBUG > Delete anonymous database user.
+ < DEBUG > Generate sample SQL templates.
+ < DEBUG > Create database: vmail.
+ < DEBUG > Initialize database: vmail.
+ < DEBUG > Add first domain and postmaster@ user.
[ INFO ] Setup daily cron job to backup SQL databases with /var/vmail/backup/backup_mysql.sh
#--------------------------------------------------------------------------------------------

Errors in sogo.log:
#--------------------------------------------------------------------------------------------
[...]
Jun 01 06:27:16 sogod [37198]: <0x0x80d728a10[WOWatchDog]> Terminating with SIGINT or SIGTERM
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c65b0[WOWatchDogChild]> child 37204 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d728a10[WOWatchDog]> Terminating with SIGINT or SIGTERM
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c6430[WOWatchDogChild]> child 37208 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c64f0[WOWatchDogChild]> child 37206 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c6730[WOWatchDogChild]> child 37205 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c66d0[WOWatchDogChild]> child 37203 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c67f0[WOWatchDogChild]> child 37202 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c6850[WOWatchDogChild]> child 37201 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c6910[WOWatchDogChild]> child 37200 exited
Jun 01 06:27:16 sogod [37198]: <0x0x80d8c6670[WOWatchDogChild]> child 37199 exited
Jun 01 06:27:17 sogod [37198]: <0x0x80d728a10[WOWatchDog]> Terminating with SIGINT or SIGTERM
Jun 01 06:27:17 sogod [37198]: <0x0x80d8c6490[WOWatchDogChild]> child 37207 exited
Jun 01 06:27:17 sogod [37198]: <0x0x80d728a10[WOWatchDog]> all children exited. We now terminate.
Jun 01 06:27:17 sogod [37462]: version 3.2.10 (build root@mail02.xxx.yyy 201806011214) -- starting
Jun 01 06:27:17 sogod [37462]: vmem size check enabled: shutting down app when vmem > 500 MB. Currently at 0 MB
Jun 01 06:27:17 sogod [37462]: <0x0x80d7cac10[SOGoProductLoader]> SOGo products loaded from '/usr/local/GNUstep/Local/Library/SOGo':
Jun 01 06:27:17 sogod [37462]: <0x0x80d7cac10[SOGoProductLoader]>   CommonUI.SOGo, AdministrationUI.SOGo, SchedulerUI.SOGo, Appointments.SOGo, PreferencesUI.SOGo, Contacts.SOGo, MailerUI.SOGo, MainUI.SOGo, ActiveSync.SOGo, ContactsUI.SOGo, MailPartViewers.SOGo, Mailer.SOGo
Jun 01 06:27:17 sogod [37462]: All products loaded - current memory usage at 0 MB
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> listening on 172.21.13.2:20000
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> watchdog process pid: 37462
Jun 01 06:27:17 sogod [37462]: <0x0x8030fcb40[WOWatchDogChild]> watchdog request timeout set to 61 minutes
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> preparing 10 children
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37463
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37464
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37465
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37466
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37467
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37468
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37469
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37470
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37471
Jun 01 06:27:17 sogod [37462]: <0x0x80d728a10[WOWatchDog]> child spawned with pid 37472
2018-06-01 06:27:17.740 sogod[37464:100769] ERROR: could not open MySQL4 connection to database 'sogo': Unknown database 'sogo'
Jun 01 06:27:17 sogod [37464]: [ERROR] <0x0x80d8d5d10[GCSChannelManager]> could not open channel <MySQL4Channel[0x0x80d8c8590] connection=0x(null)> for mysql://172.21.13.2/sogo/sogo_user_profile
Jun 01 06:27:17 sogod [37464]: [WARN] <0x0x80d8d5d10[GCSChannelManager]>   will prevent opening of this channel 5 seconds after 2018-06-01 06:27:17 -0400
2018-06-01 06:27:17.743 sogod[37466:100759] ERROR: could not open MySQL4 connection to database 'sogo': Unknown database 'sogo'
2018-06-01 06:27:17.743 sogod[37463:100801] ERROR: could not open MySQL4 connection to database 'sogo': Unknown database 'sogo'
Jun 01 06:27:17 sogod [37466]: [ERROR] <0x0x80d8d5d10[GCSChannelManager]> could not open channel <MySQL4Channel[0x0x80d8c8590] connection=0x(null)> for mysql://172.21.13.2/sogo/sogo_user_profile
Jun 01 06:27:17 sogod [37466]: [WARN] <0x0x80d8d5d10[GCSChannelManager]>   will prevent opening of this channel 5 seconds after 2018-06-01 06:27:17 -0400Jun 01 06:27:17 sogod [37463]: [ERROR] <0x0x80d8d5d10[GCSChannelManager]> could not open channel <MySQL4Channel[0x0x80d8c8590] connection=0x(null)> for mysql://172.21.13.2/sogo/sogo_user_profile
[...]
#--------------------------------------------------------------------------------------------

Login in MySQL server works with the seleted password, but there are no databases besides the default one:

#--------------------------------------------------------------------------------------------
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.01 sec)
#--------------------------------------------------------------------------------------------

7

Re: MariaDB error FreeBSD installation

arneboeses wrote:

+ < DEBUG > Setting password for MySQL root user: root.
Password    char(41)    NO           
mysqladmin:
You cannot use 'password' command as mysqld runs
with grant tables disabled (was started with --skip-grant-tables).
Use: "mysqladmin flush-privileges password '*'" instead

This is the root cause. I will test later.

8

Re: MariaDB error FreeBSD installation

ZhangHuangbin wrote:

This is the root cause. I will test later.

did you already had a chance to test it?

9

Re: MariaDB error FreeBSD installation

arneboeses wrote:

did you already had a chance to test it?

Sorry, not yet, i flight to Slovenia on June 4, and a lot personal business to do after landed.
I'm testing it right now.

10

Re: MariaDB error FreeBSD installation

Hi @arneboeses,

Is it possible for you to give me a sandbox of FreeBSD Jail for testing? it will be much easier for me to start testing this issue.

11

Re: MariaDB error FreeBSD installation

I send you an email with the username and the IP. password is iredmail

best,
Arne

12

Re: MariaDB error FreeBSD installation

ZhangHuangbin wrote:

Hi @arneboeses,

Is it possible for you to give me a sandbox of FreeBSD Jail for testing? it will be much easier for me to start testing this issue.

sorry for annoying, but did you had a chance to test already?

Best,
Arne

13

Re: MariaDB error FreeBSD installation

Not yet. Hope i will have the chance tomorrow. Sorry about the delay.