Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upgrading kairos 3.21 to 3.2.2 via k8s #3010

Closed
Itxaka opened this issue Nov 13, 2024 · 3 comments · Fixed by kairos-io/packages#1139
Closed

Error upgrading kairos 3.21 to 3.2.2 via k8s #3010

Itxaka opened this issue Nov 13, 2024 · 3 comments · Fixed by kairos-io/packages#1139
Assignees

Comments

@Itxaka
Copy link
Member

Itxaka commented Nov 13, 2024

Hello,

When upgrading within kubernetes from e.g. 22.04-standard-amd64-generic-v3.2.2-k3sv1.30.5-k3s1

the upgrade gives below error and can not be applied

making a symbolic link works as a workaround

ln -s /etc/os-release /etc/kairos-release

+ HOST_DIR=/host
+ '[' '' '!=' true ']'
+ '[' -f /etc/kairos-release ']'
++ source /etc/kairos-release
+++ KAIROS_TARGETARCH=amd64
+++ KAIROS_ID=kairos
+++ KAIROS_VERSION=v3.2.2-v1.31.1-k3s1
+++ KAIROS_VERSION_ID=v3.2.2-v1.31.1-k3s1
+++ KAIROS_PRETTY_NAME='kairos-standard-ubuntu-22.04 v3.2.2-v1.31.1-k3s1'
+++ KAIROS_IMAGE_LABEL=22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1-k3s1
+++ KAIROS_FLAVOR_RELEASE=22.04
+++ KAIROS_MODEL=generic
+++ KAIROS_RELEASE=v3.2.2
+++ KAIROS_BUG_REPORT_URL=https://github.com/kairos-io/kairos/issues
+++ KAIROS_HOME_URL=https://github.com/kairos-io/kairos
+++ KAIROS_SOFTWARE_VERSION_PREFIX=k3s
+++ KAIROS_FLAVOR=ubuntu
+++ KAIROS_REGISTRY_AND_ORG=quay.io/kairos
+++ KAIROS_SOFTWARE_VERSION=v1.31.1+k3s1
+++ KAIROS_NAME=kairos-standard-ubuntu-22.04
+++ KAIROS_ID_LIKE=kairos-standard-ubuntu-22.04
+++ KAIROS_IMAGE_REPO=quay.io/kairos/ubuntu:22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1-k3s1
+++ KAIROS_ARTIFACT=kairos-ubuntu-22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1+k3s1
+++ KAIROS_FAMILY=ubuntu
+++ KAIROS_VARIANT=standard
+++ KAIROS_GITHUB_REPO=kairos-io/kairos
++ echo v3.2.2-v1.31.1-k3s1
+ UPDATE_VERSION=v3.2.2-v1.31.1-k3s1
+ '[' -f /etc/kairos-release ']'
++ source /host/etc/kairos-release
/usr/sbin/suc-upgrade: line 13: /host/etc/kairos-release: No such file or directory
+ CURRENT_VERSION=
+ HOST_DIR=/host
+ '[' '' '!=' true ']'
+ '[' -f /etc/kairos-release ']'
++ source /etc/kairos-release
+++ KAIROS_TARGETARCH=amd64
+++ KAIROS_ID=kairos
+++ KAIROS_VERSION=v3.2.2-v1.31.1-k3s1
+++ KAIROS_VERSION_ID=v3.2.2-v1.31.1-k3s1
+++ KAIROS_PRETTY_NAME='kairos-standard-ubuntu-22.04 v3.2.2-v1.31.1-k3s1'
+++ KAIROS_IMAGE_LABEL=22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1-k3s1
+++ KAIROS_FLAVOR_RELEASE=22.04
+++ KAIROS_MODEL=generic
+++ KAIROS_RELEASE=v3.2.2
+++ KAIROS_BUG_REPORT_URL=https://github.com/kairos-io/kairos/issues
+++ KAIROS_HOME_URL=https://github.com/kairos-io/kairos
+++ KAIROS_SOFTWARE_VERSION_PREFIX=k3s
+++ KAIROS_FLAVOR=ubuntu
+++ KAIROS_REGISTRY_AND_ORG=quay.io/kairos
+++ KAIROS_SOFTWARE_VERSION=v1.31.1+k3s1
+++ KAIROS_NAME=kairos-standard-ubuntu-22.04
+++ KAIROS_ID_LIKE=kairos-standard-ubuntu-22.04
+++ KAIROS_IMAGE_REPO=quay.io/kairos/ubuntu:22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1-k3s1
+++ KAIROS_ARTIFACT=kairos-ubuntu-22.04-standard-amd64-generic-v3.2.2-k3sv1.31.1+k3s1
+++ KAIROS_FAMILY=ubuntu
+++ KAIROS_VARIANT=standard
+++ KAIROS_GITHUB_REPO=kairos-io/kairos
++ echo v3.2.2-v1.31.1-k3s1
+ UPDATE_VERSION=v3.2.2-v1.31.1-k3s1
+ '[' -f /etc/kairos-release ']'
++ source /host/etc/kairos-release
/usr/sbin/suc-upgrade: line 13: /host/etc/kairos-release: No such file or directory
+ CURRENT_VERSION=

Originally posted by @Wolverine65 in #2908 (comment)

@Itxaka
Copy link
Member Author

Itxaka commented Nov 13, 2024

yeah good catch, this is a wrong check on the script side: kairos-io/packages#1139

Basically the suc-upgrade runs with the upgraded system as root (3.2.2) and the underlying OS under /host (3.2.1)
The current version tries to get the read the info fromt he host, so it sources the $HOST/etc/os-release for example, but the check to see if we need to read from kairos-release or os-release is done on the upgraded container, which will always have the kairos-release file.

so the check though the underlying OS had the kairos-release file and tried to read from there

@Itxaka Itxaka self-assigned this Nov 13, 2024
@Itxaka Itxaka moved this to Under review 🔍 in 🧙Issue tracking board Nov 13, 2024
@Itxaka
Copy link
Member Author

Itxaka commented Nov 13, 2024

workaround, run before the upgrade:

ln -s /etc/os-release /etc/kairos-release

@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Nov 13, 2024
@Itxaka Itxaka reopened this Nov 13, 2024
@github-project-automation github-project-automation bot moved this from Done ✅ to Under review 🔍 in 🧙Issue tracking board Nov 13, 2024
@Itxaka
Copy link
Member Author

Itxaka commented Nov 14, 2024

Now fixes on v3.2.3

@Itxaka Itxaka closed this as completed Nov 14, 2024
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant