FreePBX 17 on Debian 12: IPv6 port binding for mariadb

Hi,

I followed the instructions in How to Install FreePBX 17 on Debian 12 with Asterisk 20 (dated Nov 27, 2023) using the netinst image of Debian 12.4 and everything went really smoothly - thank you for the detailed walk-through.

It case it helps anyone, I had to make (2) minor changes:

  1. Uninstall the FreePBX Firewall module, which fails to find a PHP include on Debian. It appears to be CentOS specific. I’m using ufw instead.

  2. Update the bind-address in /etc/mysql/mariadb.conf.d/50-server.cnf to include the IPv6 loopback. After the change, line is:

bind-address            = 127.0.0.1,::1 

And then restart MySQL:

sudo systemctl restart mariadb

Prior to this change, /var/log/asterisk/ucp_err.log had recurring instances of this error:

2024-01-16 07:57 -08:00: There was an error with MySQL Connection
2024-01-16 07:57 -08:00: Error: connect ECONNREFUSED ::1:3306
2024-01-16 07:57 -08:00:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1549:16)
2024-01-16 07:57 -08:00:  From event:
2024-01-16 07:57 -08:00:     at /var/www/html/admin/modules/ucp/node/node_modules/mariadb/lib/connection.js:141:13
2024-01-16 07:57 -08:00:     at new Promise (<anonymous>)
2024-01-16 07:57 -08:00:     at Connection.connect (/var/www/html/admin/modules/ucp/node/node_modules/mariadb/lib/connection.js:130:12)
2024-01-16 07:57 -08:00:     at Object.createConnection (/var/www/html/admin/modules/ucp/node/node_modules/mariadb/promise.js:38:17)
2024-01-16 07:57 -08:00:     at connect2database (/var/www/html/admin/modules/ucp/node/lib/freepbx.js:74:25)
2024-01-16 07:57 -08:00:     at /var/www/html/admin/modules/ucp/node/lib/freepbx.js:35:4
2024-01-16 07:57 -08:00:     at ChildProcess.exithandler (node:child_process:414:7)
2024-01-16 07:57 -08:00:     at ChildProcess.emit (node:events:517:28)
2024-01-16 07:57 -08:00:     at maybeClose (node:internal/child_process:1098:16)
2024-01-16 07:57 -08:00:     at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
2024-01-16 07:57 -08:00:   errno: -111,
2024-01-16 07:57 -08:00:   code: 'ECONNREFUSED',
2024-01-16 07:57 -08:00:   syscall: 'connect',
2024-01-16 07:57 -08:00:   address: '::1',
2024-01-16 07:57 -08:00:   port: 3306,
2024-01-16 07:57 -08:00:   fatal: true,
2024-01-16 07:57 -08:00:   sqlState: 'HY000'
2024-01-16 07:57 -08:00: }