Host xxx.xxx.xxx.xxx is not allowed to connect to this MariaDB server

Discussion in 'Installation/Configuration' started by Ganesan, Oct 10, 2018.

  1. Ganesan

    Ganesan New Member

    Hi, this morning we have got a power trip and we on the mail server (Done from The Perfect Server - Debian 8 Jessie (Apache2, BIND, Dovecot, ISPConfig 3) Now I couldn't send and receive any emails from outside.

    I have got the following errors:

    dovecot: auth-worker(1204): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 1 seconds before retry

    Host is not allowed to connect to this MariaDB server
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Does MariaDB starts without errors (see /var/log/syslog for error messages after you restarted mariaDB). And are you able to log into MariaDB as root user?
     
  3. Ganesan

    Ganesan New Member

    Hi Till,
    I can login to mysql as root user. Please see the following.
    root@hwamail:~# mysql -u root -p
    Enter password:
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 22
    Server version: 10.0.22-MariaDB-0+deb8u1 (Debian)

    Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> use dbispconfig
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [dbispconfig]>
     
  4. Ganesan

    Ganesan New Member

    root@hwamail:~# /etc/init.d/mysql restart
    [ ok ] Restarting mysql (via systemctl): mysql.service.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to run a repair on all databases:

    mysqlcheck -u root -p --all-databases --optimize --auto-repair --silent
     
  6. Ganesan

    Ganesan New Member

    Please help me to resolve the problem. Today from this morning no emails for our teachers and staff. The email is very important. Tonight I need to solve the problem.

    Thank you.
     
  7. Ganesan

    Ganesan New Member

    The output is:
    mysql.gtid_slave_pos
    note : Table does not support optimize, doing recreate + analyze instead
    mysql.innodb_index_stats
    note : Table does not support optimize, doing recreate + analyze instead
    mysql.innodb_table_stats
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__bookmark
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__column_info
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__designer_coords
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__favorite
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__history
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__navigationhiding
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__pdf_pages
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__recent
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__relation
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__savedsearches
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__table_coords
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__table_info
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__table_uiprefs
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__tracking
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__userconfig
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__usergroups
    note : Table does not support optimize, doing recreate + analyze instead
    phpmyadmin.pma__users
    note : Table does not support optimize, doing recreate + analyze instead
     
  8. Ganesan

    Ganesan New Member

    I think MariaDB repair should be okay.
     
  9. Ganesan

    Ganesan New Member

    I tried the following:
    root@hwamail:~# mysqlcheck -uroot -p --repair --all-databases
    Enter password:
    dbispconfig.aps_instances OK
    dbispconfig.aps_instances_settings OK
    dbispconfig.aps_packages OK
    dbispconfig.aps_settings OK
    dbispconfig.attempts_login OK
    dbispconfig.client OK
    dbispconfig.client_circle OK
    dbispconfig.client_message_template OK
    dbispconfig.client_template OK
    dbispconfig.client_template_assigned OK
    dbispconfig.country OK
    dbispconfig.cron OK
    dbispconfig.directive_snippets OK
    dbispconfig.dns_rr OK
    dbispconfig.dns_slave OK
    dbispconfig.dns_soa OK
    dbispconfig.dns_template OK
    dbispconfig.domain OK
    dbispconfig.firewall OK
    dbispconfig.ftp_user OK
    dbispconfig.help_faq OK
    dbispconfig.help_faq_sections OK
    dbispconfig.iptables OK
    dbispconfig.mail_access OK
    dbispconfig.mail_backup OK
    dbispconfig.mail_content_filter OK
    dbispconfig.mail_domain OK
    dbispconfig.mail_forwarding OK
    dbispconfig.mail_get OK
    dbispconfig.mail_mailinglist OK
    dbispconfig.mail_relay_recipient OK
    dbispconfig.mail_traffic OK
    dbispconfig.mail_transport OK
    dbispconfig.mail_user OK
    dbispconfig.mail_user_filter OK
    dbispconfig.monitor_data OK
    dbispconfig.openvz_ip OK
    dbispconfig.openvz_ostemplate OK
    dbispconfig.openvz_template OK
    dbispconfig.openvz_traffic OK
    dbispconfig.openvz_vm OK
    dbispconfig.remote_session OK
    dbispconfig.remote_user OK
    dbispconfig.server OK
    dbispconfig.server_ip OK
    dbispconfig.server_php OK
    dbispconfig.shell_user OK
    dbispconfig.software_package OK
    dbispconfig.software_repo OK
    dbispconfig.software_update OK
    dbispconfig.software_update_inst OK
    dbispconfig.spamfilter_policy OK
    dbispconfig.spamfilter_users OK
    dbispconfig.spamfilter_wblist OK
    dbispconfig.support_message OK
    dbispconfig.sys_config OK
    dbispconfig.sys_cron OK
    dbispconfig.sys_datalog OK
    dbispconfig.sys_dbsync OK
    dbispconfig.sys_filesync OK
    dbispconfig.sys_group OK
    dbispconfig.sys_ini OK
    dbispconfig.sys_log OK
    dbispconfig.sys_remoteaction OK
    dbispconfig.sys_session OK
    dbispconfig.sys_theme OK
    dbispconfig.sys_user OK
    dbispconfig.web_backup OK
    dbispconfig.web_database OK
    dbispconfig.web_database_user OK
    dbispconfig.web_domain OK
    dbispconfig.web_folder OK
    dbispconfig.web_folder_user OK
    dbispconfig.web_traffic OK
    dbispconfig.webdav_user OK
    mysql.column_stats OK
    mysql.columns_priv OK
    mysql.db OK
    mysql.event OK
    mysql.func OK
    mysql.gtid_slave_pos
    note : The storage engine for the table doesn't support repair
    mysql.help_category OK
    mysql.help_keyword OK
    mysql.help_relation OK
    mysql.help_topic OK
    mysql.host OK
    mysql.index_stats OK
    mysql.innodb_index_stats
    note : The storage engine for the table doesn't support repair
    mysql.innodb_table_stats
    note : The storage engine for the table doesn't support repair
    mysql.plugin OK
    mysql.proc OK
    mysql.procs_priv OK
    mysql.proxies_priv OK
    mysql.roles_mapping OK
    mysql.servers OK
    mysql.table_stats OK
    mysql.tables_priv OK
    mysql.time_zone OK
    mysql.time_zone_leap_second OK
    mysql.time_zone_name OK
    mysql.time_zone_transition OK
    mysql.time_zone_transition_type OK
    mysql.user OK
    phpmyadmin.pma__bookmark
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__column_info
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__designer_coords
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__favorite
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__history
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__navigationhiding
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__pdf_pages
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__recent
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__relation
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__savedsearches
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__table_coords
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__table_info
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__table_uiprefs
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__tracking
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__userconfig
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__usergroups
    note : The storage engine for the table doesn't support repair
    phpmyadmin.pma__users
    note : The storage engine for the table doesn't support repair
     
  10. Ganesan

    Ganesan New Member

    For your Info, I can connect to dbispconfig via phpmyadmin.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to editing the file /etc/dovecot/dovecot-sql.conf and in the connect=.... line, exchange the word 'localhost' with 127.0.0.1', then restart dovecot and check if it started working. If this does not help, then revert the change.
     
  12. Ganesan

    Ganesan New Member

    Okay, I try now.
     
  13. Ganesan

    Ganesan New Member

    Still the same.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Are you able to login to ISPConfig?
     
  15. Ganesan

    Ganesan New Member

    Yes, I can login to ISPConfig.
     
  16. Ganesan

    Ganesan New Member

    I can login to SquirrelMail by using my email and password but can not send and receive emails from and to outside.
    I can send and receive internally within the same domain.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, but this means that the affected program is postfix and not dovecot. Try to send an email and then check /var/log/mail.log to see which lines got added to the log for the sending attempt. And restart postfix and amavis first, just to ensure that both are running properly.
     
  18. Ganesan

    Ganesan New Member

    okay, I try now.
     
  19. Ganesan

    Ganesan New Member

    before restart postfix and amavis, the /var/log/mail.log is: (where xxx.xxx.xxx.xxx is mail server's public IP)
    Oct 10 23:33:07 hwamail postfix/submission/smtpd[23009]: connect from unknown[xxx.xxx.xxx.xxx]
    Oct 10 23:33:07 hwamail postfix/cleanup[23020]: warning: regexp map /etc/postfix/body_checks, line 1: ignoring unrecognized request
    Oct 10 23:33:07 hwamail postfix/submission/smtpd[23009]: 8AA1840E300E: client=unknown[xxx.xxx.xxx.xxx], sasl_method=PLAIN, [email protected]
    Oct 10 23:33:07 hwamail postfix/cleanup[23020]: 8AA1840E300E: message-id=<[email protected]>
    Oct 10 23:33:07 hwamail postfix/qmgr[1457]: 8AA1840E300E: from=<[email protected]>, size=27099, nrcpt=1 (queue active)
    Oct 10 23:33:08 hwamail postfix/smtpd[23024]: connect from localhost[127.0.0.1]
    Oct 10 23:33:08 hwamail postfix/smtpd[23024]: 2E3A540E3012: client=localhost[127.0.0.1]
    Oct 10 23:33:08 hwamail postfix/cleanup[23020]: 2E3A540E3012: message-id=<[email protected]>
    Oct 10 23:33:08 hwamail postfix/smtpd[23024]: disconnect from localhost[127.0.0.1]
    Oct 10 23:33:08 hwamail postfix/qmgr[1457]: 2E3A540E3012: from=<[email protected]>, size=27547, nrcpt=1 (queue active)
    Oct 10 23:33:08 hwamail amavis[1464]: (01464-02) Passed CLEAN {RelayedOpenRelay}, [xxx.xxx.xxx.xxx]:63063 [xxx.xxx.xxx.xxx] <[email protected]> -> <[email protected]>, Queue-ID: 8AA1840E30$
    Oct 10 23:33:08 hwamail postfix/smtp[23021]: 8AA1840E300E: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.76, delays=0.12/0/0/0.63, dsn=2.0.0, status=sent (250 2.0.0 f$
    Oct 10 23:33:08 hwamail postfix/qmgr[1457]: 8AA1840E300E: removed
    Oct 10 23:33:10 hwamail postfix/smtp[23025]: 2E3A540E3012: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[172.217.194.27]:25, delay=1.9, delays=0.13/0/0.93/0.82, dsn=5.7.1, sta$
    Oct 10 23:33:10 hwamail postfix/cleanup[23020]: 269BC40E3015: message-id=<[email protected]>
    Oct 10 23:33:10 hwamail postfix/bounce[23026]: 2E3A540E3012: sender non-delivery notification: 269BC40E3015
    Oct 10 23:33:10 hwamail postfix/qmgr[1457]: 269BC40E3015: from=<>, size=30156, nrcpt=1 (queue active)
    Oct 10 23:33:10 hwamail postfix/qmgr[1457]: 2E3A540E3012: removed
    Oct 10 23:33:10 hwamail dovecot: lda([email protected]): sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
    Oct 10 23:33:10 hwamail postfix/pipe[23027]: 269BC40E3015: to=<[email protected]>, relay=dovecot, delay=0.33, delays=0.09/0/0/0.23, dsn=2.0.0, status=sent (delivered via dovecot service)
    Oct 10 23:33:10 hwamail postfix/qmgr[1457]: 269BC40E3015: removed
    Oct 10 23:33:23 hwamail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=23030, secured, session=<ysskk+F3HQAAAAAAAAAAAAAAAAAAAAAB>
    Oct 10 23:33:23 hwamail dovecot: imap([email protected]): Disconnected: Logged out in=79 out=776
    Oct 10 23:33:29 hwamail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=192.168.100.2, mpid=23033, TLS, session=<Jf16k+F3PwA6uagq>
    Oct 10 23:33:29 hwamail dovecot: imap([email protected]): Disconnected: Logged out in=32 out=444
    Oct 10 23:34:07 hwamail postfix/submission/smtpd[23009]: disconnect from unknown[xxx.xxx.xxx.xxx]
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Looks fine so far, no local mail system errors. Did you get a non delivery notification back from gmail for this test mail? If yes, whats in that non delivery message.

    And another test. login to roundcube, then send a message to the same email address that you used for reoundcube login, wait about 30 seconds and refresh the inbox in roundcube. Does the email that you just send show up there? If not, take a look at the mail.log to see what has been added there for this new sending attempt.
     

Share This Page