ronivay / XenOrchestraInstallerUpdater

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

Auto power on - problems #52

Closed GogoFC closed 3 years ago

GogoFC commented 3 years ago

Flipping Auto power on and Prevent accidental deletion switches in XO advanced setting the machine does not boot anymore even after I revert it, it says no bootable media and it goes of in 30 seconds. The General tab says "no Xen tools detected" after hitting Auto power even though it did have it before, I think version 7 something.

I don't need this but is this a problem or just not implemented :) , idk if you noticed just letting you know, I will reinstall it again now and just not flip any buttons :)

I can't really provide any logs from inside VM since it doesn't boot and nothing useful in the other XO, it just says VM started.

ronivay commented 3 years ago

Hi,

What install method did you use? Appliance or the script to existing VM?

GogoFC commented 3 years ago

oh sorry, I used appliance, this refers to appliance method.

I couldn't get the script to work it says at the end waiting for port to be opened and I don't really have a firewall installed in VM, so couldn't figure that out.

ronivay commented 3 years ago

Hi,

Okay, thanks. Xen tools not installed might be simply because i use a little order xcp-ng version to build the image. That shouldn't affect the boot ability of the VM itself at all though.

When using the install script, did you follow the readme and install it to fresh installation to any of the supported OS types? Most obvious reason that it doesn't start is that there is already some other service listening the same port (apache for example). It should tell you the reason either in the logfile or via journaltcl (xo-server service). Firewall doesn't ever prevent the service to start.

Did the appliance boot once okay but after restart it doesn't start anymore? This is also little weird since nothing is changed related to bootup process during first start.

GogoFC commented 3 years ago

So regarding the Appliance, I have the new one running and in General tab it says "Management agent 7.4 detected" so but after I check those things off like Auto Start this doesn't show up anymore and instead it says no Xen tools detected. And it doesn't boot of course, I see the console says no boot loader. Yeah it is little bit weird, also I don't really understand what Auto Start does to change something in VM :)

The script I did follow with a fresh clean new Debian Net install small version stable, I'm going to try again once more now and let u know, so there isn't anything running on port 80, I'll look at logs now and report back.

GogoFC commented 3 years ago

OK I have succesfully installed the script using root :), did I not read instructions again, can I not just use sudo? I used sudo previously and this is what happened

Using sudo to run the script, this is a first time I saw this, I don't think it happened before target '/opt/xo/xo-builds/xen-orchestra-202010101806/packages/xo-server/node_modules/' is not a directory: No such file or directory

It is now stuck at this screen, no activity whatsoever and it's not going anywhere. Stopped the machine.

Logs show nodejs 12x installed fine and went on to install yarn after that

So I ctrl c to stop it as there was no activity, after that I tried running it again and is stuck at running installation and no activity.

[fail] Something went wrong, exiting. Check /home/gogoakira/XenOrchestraInstallerUpdater/logs/xo-install.log-202010101806 for more details and use rollback feature if needed

[fail] Removing /opt/xo/xo-builds/xen-orchestra-202010101806 because of failed installation.
[ok] Installing plugins

[info] Fixing binary path in systemd service configuration file
sed: can't read /opt/xo/xo-builds/xen-orchestra-202010101806/packages/xo-server/xo-server.service: No such file or directory

[fail] Something went wrong, exiting. Check /home/gogoakira/XenOrchestraInstallerUpdater/logs/xo-install.log-202010101806 for more details and use rollback feature if needed
ronivay commented 3 years ago

Hi,

Using sudo shouldn't be an issue. I'm little confused from the outputs, are all of these from a single run and what is the actual spot it got stuck and how did you verify it's not doing anything? Latter output is weird if it's from a single run because the script should definitely quit and stop doing anything when it hits that first fail.

GogoFC commented 3 years ago

Yes this is from a single run I'm 99% confident, but the below pasted text is after I hit ctrl c, I can't actually now confirm if it's a single run because my head is overloaded :) and I tried many times.

the text target '/opt/xo/xo-builds/xen-orchestra-202010101806/packages/xo-server/node_modules/' is not a directory: No such file or directory was all over the screen repeatedly, that's all it was on the screen so I hit ctrl+c , then possibly the text below explained I stopped the script.

Other times I tried the script stopped I looked at the stats in XO and no cpu ram or disk activity for a long time, time enough to install the new one XO via script using root and not sudo, the script with sudo just stayed there saying it's installing for a long time so I eventually stopped it.

I am going to do this again now :) , I delted the non working versions, which logs should I provide, now I'll try to be clear OK I did keep the sudo non working version, didn't delete it, which logs should I provide? :)

Here's the logs from inside your git cloned directory

https://0bin.net/paste/EmPJC3DT#43DT-ypLK23+LSotMUxgI1DQ/kBv77vF3exkKFhh8Iz https://0bin.net/paste/Fc26HGcz#4oFS3pLuuSZZK1ygGMLsoS28jicTAI9y0N62KzR36Lg

There are two logs so I guess I tried twice on this one.

GogoFC commented 3 years ago

I swear I'm not making this up :D

Now it installed and port is open and everything is fine using sudo and not root.

Please close this issue and thanks :D I did everything the same, I mean I don't do much just run the script :) soo I'm lost

ronivay commented 3 years ago

Hi,

Okay, thanks for the logs, this makes more sense now. So there's been some connection issue while trying to build xen-orchestra with yarn. "error An unexpected error occurred: "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz: ESOCKETTIMEDOUT"."

Unfortunately yarn doesn't really tell with exit code that it had any issues so the script keeps on going after that. Then it tried to install the plugins, which obviously couldn't be moved in place because the actual build process failed.

So all in all, sudo didn't have anything to do with your issue. It was a connection issue with node package manager for some reason. This is why it might have worked once for you eventually and no issues after that either.

Based on your feedback i adjusted the plugin symlink logging so that it goes to logfile as it should and also made the script to exit immediately if ctrl+c is being pressed so that "something went wrong" doesn't multiply.

ronivay commented 3 years ago

and just as a sidenote for the first message in this issue. i tested the appliance and enabled auto power on for it, but didn't see any issues while rebooting. xen tools won't be detected if VM isn't booting up since those run within the OS.

if that needs more debugging, i'd need some more information about where it tries to boot, what boot options the VM has enabled, script disables all other boot options except disk to speed up boot process but i don't see how auto power on would have effect on this, maybe some other changes were modified as well which prevent the VM to start.

GogoFC commented 3 years ago

That makes sense xen tools won't be detected if it didn't boot :) sometimes some things only make sense after someone says them out loud :) , as for the Appliance, I'm going to try it again, yes it's still doing it, I hit autopower on and I hit save, it doesn't break unless I save it.

I didn't delete the VM but I don't know how to find any logs, the logs in XOA are just powered on powered off, are there any more legit logs and where would I find them. There are a bunch of logs in /var/log on the XCP-NG server, if I grep through all of them what keyword would I be looking for that is relevant to this, I see some named user log, seems promising :) IMG_20201013_134250

GogoFC commented 3 years ago

HAHAHA I might be stupid :( .. :D , what I was doing without realising the SAVE button is for the boot order and I didn't see that XOA's default setting for buttons is all boot sources off and I was hitting save and it saved all the buttons switched off.

How can we delete this whole "issue" from github and our biological memories :) I owe you coffee for patience _/?

:)

ronivay commented 3 years ago

Heh no worries. Glad you figured it out :)