Problem with environment variables

Hello,

I have a problem with environment variables.
All are not taken into account

I am working on a deployment of GenieACS in a Kubernetes cluster. And Kubernetes doesn’t have IPv6 support.

And since version 1.2.6 commit “Default to dual stack interface binding” IPv6 is enabled by default and is mandatory.
If there is no IPv6 the application crashes with the message
exceptionName=“Error” exceptionMessage=“bind EAFNOSUPPORT:::3000”

So I tested by adding in genieacs.env UI_INTERFACE=“0.0.0.0”
to force IPv4 only. But it does not change anything.

For double check, I did another installation of GenieACS on an Ubuntu 20 VM without ipv4, following the documentation

As expected by default the application does not launch because of non IPv6.

I add UI_INTERFACE=“0.0.0.0” in genieacs.env
and ditto it crashes.

For test, I made a build by modifying lib/config.ts
UI_INTERFACE: { type: “string”, default: “0.0.0.0” },

The UI launches fine

I think this problem is not for all variables. for example GENIEACS_MONGODB_CONNECTION_URL seems to be taken into account.

Here is my configuration and logs

root@ubunutu-vm:~# cat /opt/genieacs/genieacs.env 
GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
NODE_OPTIONS=--enable-source-maps
GENIEACS_EXT_DIR=/opt/genieacs/ext
GENIEACS_UI_JWT_SECRET=secret
UI_INTERFACE="0.0.0.0"

root@ubunutu-vm:~# ls -alh /opt/genieacs/
total 16K
drwxr-xr-x 3 genieacs genieacs 4.0K Mar 26 19:14 .
drwxr-xr-x 4 root     root     4.0K Mar 26 17:21 ..
drwxr-xr-x 2 genieacs genieacs 4.0K Mar 26 17:21 ext
-rw------- 1 genieacs genieacs  462 Mar 26 17:31 genieacs.env

/etc/systemd/system/.#genieacs-ui.servicea4ab2afb45c1caec                                                         
[Unit]
Description=GenieACS UI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-ui

[Install]
WantedBy=default.target

root@ubunutu-vm:~# systemctl status genieacs-ui
● genieacs-ui.service - GenieACS UI
     Loaded: loaded (/etc/systemd/system/genieacs-ui.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-03-26 17:34:46 UTC; 1h 40min ago
    Process: 9616 ExecStart=/usr/bin/genieacs-ui (code=exited, status=1/FAILURE)
   Main PID: 9616 (code=exited, status=1/FAILURE)

Mar 26 17:34:27 ubunutu-vm genieacs-ui[9616]: 2022-03-26T17:34:27.823Z [ERROR] Worker died; pid=10615 exitCode=0
Mar 26 17:34:29 ubunutu-vm genieacs-ui[10630]: 2022-03-26T17:34:29.774Z [ERROR] Uncaught exception; pid=10630 exceptionName="Error" exceptionMessage="bind EAFNOSUPPORT :::3000" exceptionStack="Error: bind EAFNOSUPPORT :::3000\n    at __nod>
Mar 26 17:34:29 ubunutu-vm genieacs-ui[9616]: 2022-03-26T17:34:29.845Z [ERROR] Worker died; pid=10630 exitCode=0
Mar 26 17:34:31 ubunutu-vm genieacs-ui[10645]: 2022-03-26T17:34:31.754Z [ERROR] Uncaught exception; pid=10645 exceptionName="Error" exceptionMessage="bind EAFNOSUPPORT :::3000" exceptionStack="Error: bind EAFNOSUPPORT :::3000\n    at __nod>
Mar 26 17:34:31 ubunutu-vm genieacs-ui[9616]: 2022-03-26T17:34:31.839Z [ERROR] Worker died; pid=10645 exitCode=0
Mar 26 17:34:33 ubunutu-vm genieacs-ui[10660]: 2022-03-26T17:34:33.769Z [ERROR] Uncaught exception; pid=10660 exceptionName="Error" exceptionMessage="bind EAFNOSUPPORT :::3000" exceptionStack="Error: bind EAFNOSUPPORT :::3000\n    at __nod>
Mar 26 17:34:33 ubunutu-vm genieacs-ui[9616]: 2022-03-26T17:34:33.840Z [ERROR] Worker died; pid=10660 exitCode=0
Mar 26 17:34:33 ubunutu-vm genieacs-ui[9616]: 2022-03-26T17:34:33.840Z [ERROR] Too many crashes, exiting; pid=9616
Mar 26 17:34:46 ubunutu-vm systemd[1]: genieacs-ui.service: Main process exited, code=exited, status=1/FAILURE
Mar 26 17:34:46 ubunutu-vm systemd[1]: genieacs-ui.service: Failed with result 'exit-code'.

You have to use the prefix GENIEACS_ otherwise it will not work.
So it would be GENIEACS_UI_INTERFACE

Ha damn now that you say it, actually, I read it and it must have slipped out of my head.

Thank you