ronivay / XenOrchestraInstallerUpdater

Xen Orchestra install/update script
GNU General Public License v3.0
1.16k stars 189 forks source link

Installation Issue Debian 11,2 #102

Closed bambosd closed 2 years ago

bambosd commented 2 years ago

OS Version: Debian 11,2 Node.js version: node -v latest Yarn version: yarn -v latest

Server specs amount of vCPUs and RAM on the machine where you attempt to install VM 4GB , 20GB hdd

Issue

[info] Starting xo-server... waiting for port to be open waiting for port to be open waiting for port to be open waiting for port to be open waiting for port to be open waiting for port to be open

[fail] Installation completed, but looks like there was a problem when starting xo-server/reading journalctl. Please see logs for more details

I have tried on 3 different VM's. only 1 happent to work. Other 2 starting the apache web server but no XOA.

Installation logfile Attach complete log as a file.

ronivay commented 2 years ago

Hi,

What does the logfile say? You mentioned apache, xen orchestra doesn't use apache. If you have it running on the same VM the installation with default settings will conflict with it as apache most likely is bound to port 80.

As you didn't give any further details, i can only guess that apache is preventing xo-server to start. Try to shutdown apache and start xo-server to see if that's the case.

BlackRockCity commented 2 years ago

I have the same problem as @bambosd except I am on Debian 10 (fully updated).

-- Logs begin at Wed 2021-12-29 22:11:52 MST, end at Wed 2021-12-29 22:27:14 MST. -- Dec 29 22:21:00 debianXOA xo-server[666]: [load-balancer]Execute plans! Dec 29 22:21:08 debianXOA systemd[1]: Stopping XO Server... Dec 29 22:21:08 debianXOA xo-server[666]: 2021-12-30T05:21:08.116Z xo:main INFO SIGTERM caught, closing… Dec 29 22:21:08 debianXOA xo-server[666]: 2021-12-30T05:21:08.123Z xo:main INFO - WebSocket connection (::ffff:192.168.0.10) Dec 29 22:21:08 debianXOA xo-server[666]: 2021-12-30T05:21:08.125Z xo:main INFO bye :-) Dec 29 22:21:08 debianXOA systemd[1]: xo-server.service: Succeeded. Dec 29 22:21:08 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:31 debianXOA systemd[1]: Started XO Server. Dec 29 22:26:31 debianXOA systemd[4239]: xo-server.service: Failed to execute command: No such file or directory Dec 29 22:26:31 debianXOA systemd[4239]: xo-server.service: Failed at step EXEC spawning /opt/xo/xo-server/bin/xo-server: No such file o$ Dec 29 22:26:31 debianXOA systemd[1]: xo-server.service: Main process exited, code=exited, status=203/EXEC Dec 29 22:26:31 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 1. Dec 29 22:26:32 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:32 debianXOA systemd[1]: Started XO Server. Dec 29 22:26:32 debianXOA systemd[4245]: xo-server.service: Failed to execute command: No such file or directory Dec 29 22:26:32 debianXOA systemd[4245]: xo-server.service: Failed at step EXEC spawning /opt/xo/xo-server/bin/xo-server: No such file o$ Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Main process exited, code=exited, status=203/EXEC Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 2. Dec 29 22:26:32 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:32 debianXOA systemd[1]: Started XO Server. Dec 29 22:26:32 debianXOA systemd[4246]: xo-server.service: Failed to execute command: No such file or directory Dec 29 22:26:32 debianXOA systemd[4246]: xo-server.service: Failed at step EXEC spawning /opt/xo/xo-server/bin/xo-server: No such file o$ Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Main process exited, code=exited, status=203/EXEC Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 3. Dec 29 22:26:32 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:32 debianXOA systemd[1]: Started XO Server. Dec 29 22:26:32 debianXOA systemd[4247]: xo-server.service: Failed to execute command: No such file or directory Dec 29 22:26:32 debianXOA systemd[4247]: xo-server.service: Failed at step EXEC spawning /opt/xo/xo-server/bin/xo-server: No such file o$ Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Main process exited, code=exited, status=203/EXEC Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 4. Dec 29 22:26:32 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:32 debianXOA systemd[1]: Started XO Server. Dec 29 22:26:32 debianXOA systemd[4249]: xo-server.service: Failed to execute command: No such file or directory Dec 29 22:26:32 debianXOA systemd[4249]: xo-server.service: Failed at step EXEC spawning /opt/xo/xo-server/bin/xo-server: No such file o$ Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Main process exited, code=exited, status=203/EXEC Dec 29 22:26:32 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:33 debianXOA systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Dec 29 22:26:33 debianXOA systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 5. Dec 29 22:26:33 debianXOA systemd[1]: Stopped XO Server. Dec 29 22:26:33 debianXOA systemd[1]: xo-server.service: Start request repeated too quickly. Dec 29 22:26:33 debianXOA systemd[1]: xo-server.service: Failed with result 'exit-code'. Dec 29 22:26:33 debianXOA systemd[1]: Failed to start XO Server.

BlackRockCity commented 2 years ago

The directory /opt/xo/xo-server/bin is missing?

root@debianXOA:/opt/xo/xo-server# ls -l total 44 -rw-r--r-- 1 root root 5230 Dec 29 22:21 config.toml drwxr-xr-x 8 root root 4096 Dec 29 22:24 dist drwxr-xr-x 2 root root 4096 Dec 29 22:21 docs drwxr-xr-x 12 root root 4096 Dec 29 22:24 node_modules -rw-r--r-- 1 root root 5128 Dec 29 22:21 package.json -rw-r--r-- 1 root root 1331 Dec 29 22:21 README.md -rw-r--r-- 1 root root 2302 Dec 29 22:21 signin.pug drwxr-xr-x 8 root root 4096 Dec 29 22:21 src -rw-r--r-- 1 root root 288 Dec 29 22:26 xo-server.service

BlackRockCity commented 2 years ago

Rolling back to a previous snapshot restored the /bin directory.

root@debianXOA:/opt/xo/xo-server# ls -l total 52 drwxr-xr-x 2 root root 4096 Apr 30 2021 bin -rw-r--r-- 1 root root 4963 Apr 30 2021 config.toml drwxr-xr-x 8 root root 4096 Apr 30 2021 dist drwxr-xr-x 2 root root 4096 Apr 30 2021 docs -rw-r--r-- 1 root root 279 Apr 30 2021 index.js drwxr-xr-x 12 root root 4096 Apr 30 2021 node_modules -rw-r--r-- 1 root root 5061 Apr 30 2021 package.json -rw-r--r-- 1 root root 1331 Apr 30 2021 README.md -rw-r--r-- 1 root root 2302 Apr 30 2021 signin.pug drwxr-xr-x 8 root root 4096 Apr 30 2021 src -rw-r--r-- 1 root root 288 Apr 30 2021 xo-server.service

root@debianXOA:/opt/xo/xo-server# cd bin/

root@debianXOA:/opt/xo/xo-server/bin# ls -l total 16 -rwxr-xr-x 1 root root 282 Apr 30 2021 run-vhd-test -rwxr-xr-x 1 root root 943 Apr 30 2021 xo-server -rwxr-xr-x 1 root root 310 Apr 30 2021 xo-server-logs -rwxr-xr-x 1 root root 93 Apr 30 2021 xo-server-recover-account

ronivay commented 2 years ago

@BlackRockCity please update your xo-install.sh to latest version and re-run update.

It's a known issue due to change done in xen orchestra a while back. Fixed in https://github.com/ronivay/XenOrchestraInstallerUpdater/commit/d04957b972fc009e68830da2504b28e4a07a1663

BlackRockCity commented 2 years ago

I was under the impression that your script would self update according to the documentation.

Feature request: display the script version number when running the script.

ronivay commented 2 years ago

I was under the impression that your script would self update according to the documentation.

It will. As long as you're in recent enough version where that feature was implemented (some months back)

BlackRockCity commented 2 years ago

Updating the script solved the problem, now my xo-server and xo-web are up and running with the latest version. Thank you for the quick support!

ronivay commented 2 years ago

Updating the script solved the problem, now my xo-server and xo-web are up and running with the latest version. Thank you for the quick support!

Great! Version is actually logged in the logfile, but not in the script output unless automatic upgrade happens.

ronivay commented 2 years ago

@bambosd did you manage to get xo-server running by shutting down apache first?

bambosd commented 2 years ago

@bambosd did you manage to get xo-server running by shutting down apache first?

@ronivay Hello Sir and happy new year. I realized that i have click the "web server" option during debian graphical installation wizard. I will try without that again. I'm not very flexible with Linux and commands so i will try again clean without this option. Thanks.

ronivay commented 2 years ago

@bambosd did you manage to get xo-server running by shutting down apache first?

@ronivay Hello Sir and happy new year. I realized that i have click the "web server" option during debian graphical installation wizard. I will try without that again. I'm not very flexible with Linux and commands so i will try again clean without this option. Thanks.

You too :) Yeah the web server option indeed causes a conflict if running this script with default settings. You can either reinstall the OS without it or simply run sudo systemctl stop apache2 && sudo systemctl start xo-server (or run without sudo as root user). This assumes the situation on VM is similar as in first message, ie. installation complete but just service failed to start. If that works as expected and xen orchestra opens instead of apache default page, you should also disable apache with sudo systemctl disable apache2 otherwise it'll conflict on next reboot as well.

Would you like to keep this issue open until you've figured it out or should we close it as the root cause is quite clear here?

bambosd commented 2 years ago

seems clear, thanks a lot. I'm just wondering now if a debian server is hosting many different web interfaces or "instances", how this can be done ? Using different ports ?

olivierlambert commented 2 years ago

You need to search on "Reverse proxy". Run XO on any port (eg 4443) and reverse proxy it via Apache. It's even documented in official XO doc (see https://xen-orchestra.com/docs/configuration.html#reverse-proxy)

ronivay commented 2 years ago

seems clear, thanks a lot.

I'm just wondering now if a debian server is hosting many different web interfaces or "instances", how this can be done ? Using different ports ?

Ideally you shouldn't run anything else on the VM running xen orchestra. If you choose to run websites with apache next to it, you can just install xen orchestra to different port (you can change this in xo-install.cfg) and access it directly or use apache as reverse proxy as Olivier suggested.