error running fwcloud-api, fresh debian 12 install | FWCloud Forum

error running fwcloud-api, fresh debian 12 install

pld0vr

New member
Unable to start fwcloud-api. Running Debian 12 bookworm. Any suggestions?

root@fwcloud:~# sudo systemctl status fwcloud-api
x fwcloud-api.service - fwcloud-api
Loaded: loaded (/lib/systemd/system/fwcloud-api.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2023-10-11 23:01:21 UTC; 9s ago
Duration: 2.849s
Process: 12437 ExecStart=/usr/bin/npm start (code=exited, status=1/FAILURE)
Main PID: 12437 (code=exited, status=1/FAILURE)
CPU: 3.130s

Oct 11 23:01:19 fwcloud fwcloud-api[12437]: > FWCloud-API@1.9.2 start
Oct 11 23:01:19 fwcloud fwcloud-api[12437]: > npm run stop; node dist/src/bin/fwcloud
Oct 11 23:01:19 fwcloud fwcloud-api[12478]: > FWCloud-API@1.9.2 stop
Oct 11 23:01:19 fwcloud fwcloud-api[12478]: > if [ -f ".pid" ]; then PID=$(cat .pid); EXISTS=`ps axw | awk '{print $1}' | grep "^${PID}$"`; if [ "$EXISTS" ]; then kill $PID; fi; >
Oct 11 23:01:21 fwcloud fwcloud-api[12524]: Application can not start: connect ECONNREFUSED ::1:3306
Oct 11 23:01:21 fwcloud fwcloud-api[12524]: Error: connect ECONNREFUSED ::1:3306
Oct 11 23:01:21 fwcloud fwcloud-api[12524]: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1481:16)
Oct 11 23:01:21 fwcloud systemd[1]: fwcloud-api.service: Main process exited, code=exited, status=1/FAILURE
Oct 11 23:01:21 fwcloud systemd[1]: fwcloud-api.service: Failed with result 'exit-code'.
Oct 11 23:01:21 fwcloud systemd[1]: fwcloud-api.service: Consumed 3.130s CPU time.
 

Carles Munyoz

Administrator
Staff member
Is the MySQL database engine running?
As you can see in the error the problem is that the FWClou-API can not connect to the 3306 TCP port, the MySQL TCP port.
 

roy_barnard

New member
By default mariadb on a Debian 12 fresh install does not listen for loopback as localhost on IPv6, but the '/etc/hosts' file lists localhost as both 127.0.0.1 (IPv4) and ::1 (IPv6).

The node client for mariadb resolves 'localhost' as '::1' and attempts to connect to mariadb using IPv6 which mariadb is not listening on. This causes the installation of 'fwcloud-api' to fail in setting up the database. (Error: connect ECONNREFUSED ::1:3306)

To resolve this issue, either:

Option A: Disable IPv6
Create '/etc/sysctl.d/ipv6-disable.conf' containing:
#--- Disable IPv6 as per wiki.debian.org/DebianIPv6
#
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Then execute both "systemctl restart systemd-sysctl.service" and "systemctl restart mariadb.service".

Option B: Configure mariadb to listen on IPv6 loopback for localhost
Create 'etc/mysql/mariadb.conf.d/51-localserver.cnf' containing:
[mysqld]
bind-address = 127.0.0.1,::1
Then execute "systemctl restart mariadb.service".

I have tested both of these options and they worked for me.

Many Thanks,
Roy Barnard
 

Carles Munyoz

Administrator
Staff member
We have created an issue about this problem and we will solve it as soon as possible.
Thank you very much for the report.
 
Top