test/fix hetzner/ubuntu_install.rhai #74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
herolib_rust/packages/clients/examples/rhai/hetzner/ubuntu_install.rhai
most seems to be working
lets do more tests, make sure docs are ok...
the install took too long, also debugging didn't seem to be working well from the rhai scripts, need to make sure we get more visibility if we use debug, I just asked AI to put something in but not checked
it worked, install also, now more testing and doc checking
debug now also working
it worked, but at end should return and say its ok...
ib_clients::hetzner::api] ✓ SSH port is open
[DEBUG herolib_clients::hetzner::api] Running: ssh-keygen -R 135.181.217.244
[INFO herolib_clients::hetzner::api] ✓ Removed old host key for 135.181.217.244 from known_hosts
[DEBUG herolib_clients::hetzner::api] Waiting 5s for SSH to fully start...
[DEBUG herolib_clients::hetzner::api] Verifying Ubuntu installation via SSH...
[DEBUG herolib_clients::hetzner::api] SSH command returned code: 0
[DEBUG herolib_clients::hetzner::api] ✓ Ubuntu detected in os-release
[INFO herolib_clients::hetzner::api] ╔════════════════════════════════════════════════════════════╗
[INFO herolib_clients::hetzner::api] ║ ✓ UBUNTU INSTALLATION SUCCESSFUL ║
[INFO herolib_clients::hetzner::api] ╚════════════════════════════════════════════════════════════╝
[INFO herolib_clients::hetzner::api] Server: kristof6
[INFO herolib_clients::hetzner::api] IP: 135.181.217.244
[INFO herolib_clients::hetzner::api] SSH: ssh root@135.181.217.244
[INFO herolib_clients::hetzner::api] Duration: 235s
====================================
INSTALLATION SUCCESSFUL!
Server: kristof6
IP: 135.181.217.244
Duration: 235 seconds
Message: Ubuntu 24.04 installed successfully
Connect with: ssh root@135.181.217.244
despiegk@kristofs-MacBook-Pro-1092 herolib_rust %
wow might be ok, never know
The Rhai scripts in the repo used a newer API:
But the old binary didn't have log_level() or connect() registered as Rhai functions.
Fix:
Tested the rhai script again worked but i need the password to be able to test it
The
ubuntu_install.rhaiscript was timing out with the error"Installation timed out"even when the Ubuntu installation completed successfully.Output:
When i SSH into the server showed Ubuntu was successfully installed:
The issue is the rhai script after the install script completes and reboots the server, SSH reconnects to the fresh Ubuntu installation. The monitoring loop kept checking for /tmp/install_complete which only existed on the rescue system's tmpfs which is doesnt exist in the fresh installed ubuntu, causing a timeout.
Added detection for when we're no longer in rescue mode during the polling loop. If SSH is connected but we're not in rescue mode, the installation is considered complete since the server has rebooted into the new OS.
Tested and verified
Code pushed here: https://forge.ourworld.tf/geomind_research/herolib_rust/src/branch/develop_hetzner_rescuemode
@peter thanks create a PR against develop to merge it