ronivay / XenOrchestraInstallerUpdater

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

Fails for new install. #253

Closed eangulus closed 2 months ago

eangulus commented 2 months ago

Debian 12.6: No Node: node -v No Yarn: yarn -v

Server specs 2 CPU's, 4Gb RAM XCP VM.

Issue I run the script for the new install and it tells me xo-server service is already running. I double checked no service there at all and never has been (clean debian install). I hit y to continue then it fails because it cant stop the non-existent service.

Installation logfile Have no idea where the logs are but here's a copy of my terminal:

root@DEBIAN-TEMPLATE-12-6-0:~# bash -c "$(curl -s https://raw.githubusercontent.com/ronivay/XenOrchestraInstallerUpdater/master/xo-install.sh)" cp: cannot stat './sample.xo-install.cfg': No such file or directory bash: line 21: ./xo-install.cfg: No such file or directory

Welcome to automated Xen Orchestra install

Following options will be used for installation:

OS: Debian 12 Basedir: /opt/xo User: root Port: 80 HTTPS: false Git Branch for source: master Following plugins will be installed: all Number of previous installations to preserve: 3 Node.js and yarn auto update: true

Errorlog is stored to /root/logs/xo-install.log-202409031526 for debug purposes

Depending on which installation is chosen:

Xen Orchestra configuration will be stored to /root/.config/xo-server/config.toml, if you don't want it to be replaced with every update, set CONFIGUPDATE to false in xo-install.cfg Xen Orchestra Proxy configuration will be stored to /root/.config/xo-proxy/config.toml. Config won't be overwritten during update, ever

  1. Install
  2. Update
  3. Rollback
  4. Install proxy
  5. Update proxy
  6. Exit

: 1 Looks like xo-server process is already running, consider running update instead. Continue anyway?

Stopping xo-server... [fail] failed to stop service, exiting... root@DEBIAN-TEMPLATE-12-6-0:~# node -v -bash: node: command not found root@DEBIAN-TEMPLATE-12-6-0:~# yarn -v -bash: yarn: command not found root@DEBIAN-TEMPLATE-12-6-0:~#

ronivay commented 2 months ago

Could you please run pgrep -f 'node.*xo-server' on the server you're trying to install xo-server to, to see why it fails the check.

eangulus commented 2 months ago

Nothing comes up.

root@DEBIAN-TEMPLATE-12-6-0:~# pgrep -f 'node.*xo-server' root@DEBIAN-TEMPLATE-12-6-0:~#

eangulus commented 2 months ago

This is a 100% new Debian install. Clean base Debian 12.6 and the only thing I have installed is nfs for some shares and Webmin.

ronivay commented 2 months ago

Nothing comes up.

root@DEBIAN-TEMPLATE-12-6-0:~# pgrep -f 'node.*xo-server' root@DEBIAN-TEMPLATE-12-6-0:~#

Hmm i don't get why it would complain then that xo-server is already running. Check the logs then if there's anything. You mentioned you have no idea where the logs are. Check the output of the script and it'll tell you :) Errorlog is stored to /root/logs/xo-install.log-202409031526 for debug purposes

eangulus commented 2 months ago

Running script version undefined with config:

No config file found

ronivay commented 2 months ago

What are those two pids that it found before? ps -p 5062 and ps -p 5131

eangulus commented 2 months ago

Not sure, they dont seem to be there.

root@DEBIAN-TEMPLATE-12-6-0:~# ps -p 5062 PID TTY TIME CMD root@DEBIAN-TEMPLATE-12-6-0:~# ps -p 5131 PID TTY TIME CMD root@DEBIAN-TEMPLATE-12-6-0:~#

ronivay commented 2 months ago

Beats me. Based on this, it should work just fine now.

eangulus commented 2 months ago

just tried again. and nope. same error.

I just tried again, and before answering if I want to continue (after detecting I am already running xo-server) I looked in the logs, there a different numbers there this time and they also don't exist. There are no processes with the numbers from the logs.

eangulus commented 2 months ago

Just had top runnign and tried again. I got 1 of the pid's from the latest logs.

8432 root 20 0 7828 4392 3164 S 0.0 0.1 0:00.00 bash

ronivay commented 2 months ago

just tried again. and nope. same error.

I just tried again, and before answering if I want to continue (after detecting I am already running xo-server) I looked in the logs, there a different numbers there this time and they also don't exist. There are no processes with the numbers from the logs.

Ah now i get it. It's because you're running the script via curl as oneliner which isn't a documented way to use xo-install.sh. Since basically the entire script content is found from ps output, it'll cause the process check to fail. Please clone the repository first as instructed and then run the xo-install.sh script after that.

eangulus commented 2 months ago

OK, will do that Thank you.

Thanks heaps for the fast responses too, didn't expect this.

I used this method cause stupid AI told me to.

`For installing Xen Orchestra on a Debian VM and allowing easy updates, I recommend using the XenOrchestraInstallerUpdater script by ronivay. This script automates the installation process and provides an easy way to update Xen Orchestra in the future. Here are the steps to use this script: First, ensure your Debian VM meets the minimum requirements: At least 4GB of RAM About 1GB of free disk space 2 vCPUs recommended Connect to your Debian VM via SSH as root or a user with sudo privileges. Run the following command to download and execute the installation script: bash bash -c "$(curl -s https://raw.githubusercontent.com/ronivay/XenOrchestraInstallerUpdater/master/xo-install.sh)"

The script will automatically install all necessary dependencies, compile Xen Orchestra from source, and set it up as a systemd service. Once the installation is complete, you can access Xen Orchestra through your web browser using the VM's IP address. To update Xen Orchestra in the future, you can simply run the same script again. It will detect the existing installation and perform an update. Key benefits of using this script: Supports Debian 10, 11, and 12 Automatically installs all required dependencies Compiles Xen Orchestra from source, giving you access to all features Sets up Xen Orchestra as a systemd service for easy management Provides an easy way to update your installation in the future Remember to secure your Xen Orchestra installation by changing the default credentials and configuring proper access controls after the initial setup.`

eangulus commented 2 months ago

I should have verified better... and done some more reading.

ronivay commented 2 months ago

Technically that should work too. It's just the process check that isn't tested with this. I might look into improving it as it's a bit stupid how it fails here :)

eangulus commented 2 months ago

Stupid question I think, I haven't done much with GitHub stuff before, but how do I clone?

I cant find the instructions here, I can only see that you say to first clone.

ronivay commented 2 months ago

Stupid question I think, I haven't done much with GitHub stuff before, but how do I clone?

I cant find the instructions here, I can only see that you say to first clone.

Just install git first to the machine with apt install -y git and then git clone https://github.com/ronivay/XenOrchestraInstallerUpdater. Then jump to the cloned dir with cd XenOrchestraInstallerUpdater and finally run the script with ./xo-install.sh and you should be good.

eangulus commented 2 months ago

Cool. Thanks again.

ronivay commented 2 months ago

I'm going to assume you got the install going and will close this :)

I merged an improvement to the running process check. It should match better now to actually running xo-server process.