Hey, i tired to upgrade my longhorn install and al...
# general
m
Hey, i tired to upgrade my longhorn install and along the way thing went wrong. Rancher now thinks it should upgrade from 1.7 to 1.9 while i have 1.6.4 installed and running. How can i get rancher to recognise whats the actual version installed and offer the other upgrade versions (from 1.6.4 to 1.7.3)? I'm kinda lost and google is not helping 😞
s
The install may be on that version, and it's just the application of the change by helm failed. In the UI try just editing the application, that may re-apply the change using the version helm believes it installed
m
Hey, had a quick look. But when doing an edit on longhorn it only shows same versions and goes into a upgrade step. While the versions installed are lower then what the upgrade step thinks it is. longhorn-crd on the other hand will give me a full list op versions (backwards and forwards) Following the longhorn documentation it should first upgrade to 1.7.x and then 1.8.x before going to 1.9
I think i should install 106.1.1+up1.7.3 next and then continue from there
Maybe extra note, longhorn ui reports as version 1.6.4 (and tells me new versions are available 😅)
@stocky-account-63046 Do you have any other idea's on how to fix this?
s
it may be best to manually use the helm cli with your required version (this is basically what rancher is doing under the hood anyway)
m
Hey @stocky-account-63046, took me a while to get back to this. But when trying to run the commands from my local machine via helm. I get the following errors. Upgrade to the same version i should be running to hopefully reset the issue
Copy code
helm upgrade --history-max=5 --install=true --labels=<http://catalog.cattle.io/cluster-repo-name=rancher-charts|catalog.cattle.io/cluster-repo-name=rancher-charts> --namespace=longhorn-system --timeout=10m0s --values=/Users/matthijs/workspace/rancher/longhornvalues.yml --version=105.0.1+up1.6.4 --wait=true longhorn /Users/matthijs/workspace/rancher/charts/assets/longhorn/longhorn-105.0.1+up1.6.4.tgz

Error: UPGRADE FAILED: pre-upgrade hooks failed: 1 error occurred:
        * job longhorn-pre-upgrade failed: BackoffLimitExceeded
Upgrading to the next version of longhorn:
Copy code
helm upgrade --history-max=5 --install=true --labels=<http://catalog.cattle.io/cluster-repo-name=rancher-charts|catalog.cattle.io/cluster-repo-name=rancher-charts> --namespace=longhorn-system --timeout=10m0s --values=/Users/matthijs/workspace/rancher/longhornvalues.yml --version=106.1.1+up1.7.3 --wait=true longhorn /Users/matthijs/workspace/rancher/charts/assets/longhorn-crd/longhorn-crd-106.1.1+up1.7.3.tgz

Error: UPGRADE FAILED: Unable to continue with update: CustomResourceDefinition "<http://backingimagedatasources.longhorn.io|backingimagedatasources.longhorn.io>" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "<http://meta.helm.sh/release-name|meta.helm.sh/release-name>" must equal "longhorn": current value is "longhorn-crd"
The files are from the https://github.com/rancher/charts/tree/release-v2.12 git repo as that is used by rancher itself. The values I copied out of rancher. I only really found this reddit post about it https://www.reddit.com/r/kubernetes/comments/1f34e1q/cant_update_longhorn_due_to_metahelmshreleasename/ But that didn't help me further. Do you have any idea what to do next?
Hi all just reaching out to general again because I'm stuck and don't know how to continue forward. I would like to avoid having to backup everything delete and reinstall longhorn .... I hope someone has an idea to fix this.
@stocky-account-63046 Do you have any other idea's? I'm still firmly stuck
s
try upgrading the crd first, then the main app. make sure you get the correct name each time. that second one failed because the name of the app was longhorn, and not longhorn-crd
m
@stocky-account-63046 really appreciate the help 🙂 I always update the crd first (because thats what rancher ui does) and changing the crd never fails.
Copy code
helm upgrade --history-max=5 --install=true --labels=<http://catalog.cattle.io/cluster-repo-name=rancher-charts|catalog.cattle.io/cluster-repo-name=rancher-charts> --namespace=longhorn-system --timeout=10m0s --values=/Users/matthijs/workspace/rancher/charts/charts/longhorn-crd/106.1.1+up1.7.3 /values-longhorn-crd-106.1.1+up1.7.3.yaml --version=106.1.1+up1.7.3 --wait=true longhorn-crd /Users/matthijs/workspace/rancher/charts/assets/longhorn-crd/longhorn-crd-106.1.1+up1.7.3.tgz
The rancher gui installs the crd as longhorn-crd the longhorn helm chart itself seems to want longhorn and not longhorn-crd, I'm not sure how i can change that? Because I'm assuming this chart should update the longhorn application itself and not longhorn crd
Copy code
helm upgrade --history-max=5 --install=true --labels=<http://catalog.cattle.io/cluster-repo-name=rancher-charts|catalog.cattle.io/cluster-repo-name=rancher-charts> --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-106.1.1+up1.7.3.yaml --version=106.1.1+up1.7.3--wait=true longhorn /home/shell/helm/longhorn-106.1.1+up1.7.3.tgz
I'm I using the correct chart? Or maybe I dont understand what you mean Note: I have tried various versions but none work.
It seems that no matter what version i give the helm command the
longhorn-pre-upgrade
always thinks i want to upgrade to 1.9.4 and that's not compatible
I managed to figure some things out, • Disable to update check • Reinstall the version I already had • Update to the next version while manually specifying all the images ◦ Use default images did not work and was bugged • Update to the next version disabling default images ◦ and again manually specify the images • Update to the next version enabling default images again • I'm now on 1.9.1