Non Fatal Error Starting XOA
-
I was trying to make the self built XOA from sources to test drive the features. But I noticed that when starting XOA using the default config file everything seems to work fine. But if I edit the file to make the server listen on HTTPS or even pin the XOA to a specific IP the server is generating an error while starting. The error seems non fatal and I am still able to access XOA, The error message is something like what is given below.
The process that is already listening on the port when digging further was
/root/xen-orchestra/packages/xo-server/dist/cli.mjsERROR TEXT BELOW --------
023-05-06T02:06:00.737Z xo:main INFO Configuration loaded. 2023-05-06T02:06:00.757Z xo:main WARN Web server could not listen on http://localhost:80 { error: Error: listen EADDRINUSE: address already in use :::80 at Server.setupListenHandle [as _listen2] (node:net:1740:16) at listenInCluster (node:net:1788:12) at Server.listen (node:net:1876:7) at Server.listen (/root/xen-orchestra/node_modules/http-server-plus/index.js:171:12) at makeWebServerListen (file:///root/xen-orchestra/packages/xo-server/src/index.mjs:455:41) at Array.<anonymous> (file:///root/xen-orchestra/packages/xo-server/src/index.mjs:477:5) at Function.from (<anonymous>) at asyncMap (/root/xen-orchestra/@xen-orchestra/async-map/index.js:23:28) at createWebServer (file:///root/xen-orchestra/packages/xo-server/src/index.mjs:476:9) at main (file:///root/xen-orchestra/packages/xo-server/src/index.mjs:745:27) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 80, niceAddress: 'http://localhost:80' } } 2023-05-06T02:06:00.759Z xo:main WARN Address already in use. 2023-05-06T02:06:00.776Z xo:main INFO Web server listening on https://[::]:443
-
Hi,
Please carefully read the error message. It's pretty self explanatory
-
Thanks Oliver. Sorry it could be me but from what I see is that the error states Address in Use. This happens even if i use the localhost address or a specific IP address. But the error seems to be generated since the port&address is used by cli.mjs.
Am I missing something obvious
-
EADDRINUSE: address already in use :::80
Means you already have something listening on port 80.
-
Sorry if was not clear earlier. What I mean is that the stuff that already is listening on port 80 seems to be the XOA service itself (root/xen-orchestra/packages/xo-server/dist/cli.mjs) so it looks like the service is trying to start again when it is already running and due to that this error is generated
Even though the error is thrown the XOA service works fine. So looks more like a nuisance than anything major that this error is generated
-
And how do you know that? Have you tried to use
netstat
or something before starting XO? -
@olivierlambert Hi Thanks Oliver
I dug into this a little more and it seems that the issue is with the forever service which seems to be not shutting down the XOA service even though systemd shows it is down. On a clean install start of the XOA (from a host which is turned off and then just started) there is no error.I used SS and ps to identify the service which is runnning
After a Clean start from a cold boot : No such error
node:508) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) 2023-05-07T17:05:03.776Z xo:main INFO Configuration loaded. 2023-05-07T17:05:03.784Z xo:main INFO Web server listening on http://172.17.12.35:80 2023-05-07T17:05:03.847Z xo:main INFO Web server listening on https://172.17.12.35:443 2023-05-07T17:05:04.475Z xo:main INFO Setting up / ā /root/xen-orchestra/packages/xo-web/dist
But when XOA is restarted after shutting down using service orchestra stop or service orchestra restart the error is thrown
Even when the service is shown as down in the system the XOA is not shut down and I can still access the web interface. The below are the commands and the response from serverigops@xoa:/var/log$ sudo service orchestra status ā orchestra.service - LSB: forever-service startup script for orchestra Loaded: loaded (/etc/init.d/orchestra; generated) Active: inactive (dead) since Sun 2023-05-07 12:28:00 CDT; 7min ago Docs: man:systemd-sysv-generator(8) Process: 16540 ExecStop=/etc/init.d/orchestra stop (code=exited, status=0/SUCCESS) CPU: 3ms May 07 12:14:48 xoa systemd[1]: Starting LSB: forever-service startup script for orchestra... May 07 12:14:48 xoa orchestra[867]: Starting orchestra May 07 12:14:49 xoa systemd[1]: Started LSB: forever-service startup script for orchestra. May 07 12:28:00 xoa systemd[1]: Stopping LSB: forever-service startup script for orchestra... May 07 12:28:00 xoa orchestra[16540]: Shutting down orchestra: May 07 12:28:00 **xoa orchestra[16540]: Not running** May 07 12:28:00 xoa systemd[1]: orchestra.service: Succeeded. May 07 12:28:00 xoa systemd[1]: Stopped LSB: forever-service startup script for orchestra.
**bigops@xoa:/var/log$ sudo ss -ltnp | grep 80**
The service is still running!!
LISTEN 0 511 172.17.12.35:80 0.0.0.0:* users:(("node",pid=517,fd=19))
bigops@xoa:/var/log$ ps aux | grep 517 root 427 0.0 0.4 15176 8444 ? Ss 12:04 0:00 /lib/systemd/systemd --user root 517 0.5 8.2 11487772 164044 ? Sl 12:04 0:10 /usr/bin/node /root/xen-orchestra/packages/xo-server/dist/cli.mjs bigops 16770 0.0 0.0 6240 636 pts/0 S+ 12:36 0:00 grep 517
-
Quick note: XOA is for our Xen Orchestra virtual Appliance. You are using XO from the sources So it's just "XO".
Anyway, indeed, it seems that your forever service isn't able to kill the process therefore, keep it.