UCP broken on three FreePBX after update - "Host '127.0.0.1' is not allowed to connect to this MariaDB server"

I currently have issues with UCP on all my three FreePBX installtions, probably caused by updates.

UCP on all instances does periodic restarts and the UCP log fills with these error messages:

2025-10-15 14:22 +02:00: There was an error with MySQL Connection
2025-10-15 14:22 +02:00: SqlError: (conn:-1, no: 1130, SQLState: HY000) Host '127.0.0.1' is not allowed to connect to this MariaDB server
2025-10-15 14:22 +02:00:     at module.exports.createError (/var/www/html/admin/modules/ucp/node/node_modules/mariadb/lib/misc/errors.js:66:10)
2025-10-15 14:22 +02:00:     at PacketNodeEncoded.readError (/var/www/html/admin/modules/ucp/node/node_modules/mariadb/lib/io/packet.js:588:19)
2025-10-15 14:22 +02:00:     at Socket.emit (node:events:517:28)

MySQL errors:

mariadbd[870]: 2025-10-15 14:32:58 1223 [Warning] Aborted connection 1223 to db: 'unconnected' user: 'unauthenticated' host: '127.0.0.1'

Anyone experiencing the same issue? Is there a fix available?

Thanks,
Marco

OK, I guess there is a bug now in UCP. It wants to connect to Mariadb as “[email protected]” instead of “freepbxuser@localhost”. In MariaDB “127.0.0.1” is a different user than “localhost”.

I tried this workaround:

Get your Password of the freepbxuser:

php -r 'include "/etc/freepbx.conf"; echo "USER=".$amp_conf["AMPDBUSER"]."\nPASS=".$amp_conf["AMPDBPASS"]."\nDB1=".$amp_conf["AMPDBNAME"]."\nDB2=".$amp_conf["CDRDBNAME"]."\n";'

You’re getting this:

USER=freepbxuser
PASS=**yourpassword**
DB1=asterisk
DB2=

Enter MySQL shell:

mysql -u root

Check the hosts for “freepbxuser”:

MariaDB [(none)]> SELECT User, Host, plugin, authentication_string FROM mysql.user WHERE User = 'freepbxuser';
+-------------+-----------+-----------------------+-------------------------------------------+
| User        | Host      | plugin                | authentication_string                     |
+-------------+-----------+-----------------------+-------------------------------------------+
| freepbxuser | localhost | mysql_native_password | *<auth_string>* |
+-------------+-----------+-----------------------+-------------------------------------------+
1 row in set (0.081 sec)

We see that host 127.0.0.1 does not exist for “freepbxuser”.

Create that user and grant permissions to the database:

MariaDB [(none)]> CREATE USER IF NOT EXISTS 'freepbxuser'@'127.0.0.1' IDENTIFIED BY '**yourpassword**';
Query OK, 0 rows affected (0.138 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON `asterisk`.*      TO 'freepbxuser'@'127.0.0.1';
Query OK, 0 rows affected (1.223 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON `asteriskcdrdb`.* TO 'freepbxuser'@'127.0.0.1';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.045 sec)

MariaDB [(none)]> SELECT User, Host, plugin, authentication_string FROM mysql.user WHERE User = 'freepbxuser';
+-------------+-----------+-----------------------+-------------------------------------------+
| User        | Host      | plugin                | authentication_string                     |
+-------------+-----------+-----------------------+-------------------------------------------+
| freepbxuser | localhost | mysql_native_password | *<auth_string>*  |
| freepbxuser | 127.0.0.1 | mysql_native_password | *<auth_string>*  |
+-------------+-----------+-----------------------+-------------------------------------------+
2 rows in set (0.002 sec)

Exit MariaDB.

The UCP daemon will now start properly and the NodeJS server ports 8001 and 8003 are listening again.

Nevertheless, the inital bug in the UCP should be fixed by Sangoma :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.