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

Empty line in /etc/os-release breaks Ubuntu Pro #2526

Closed
Tracked by #1792 ...
kreeuwijk opened this issue May 1, 2024 · 2 comments · Fixed by kairos-io/kairos-sdk#110
Closed
Tracked by #1792 ...

Empty line in /etc/os-release breaks Ubuntu Pro #2526

kreeuwijk opened this issue May 1, 2024 · 2 comments · Fixed by kairos-io/kairos-sdk#110
Assignees
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed

Comments

@kreeuwijk
Copy link

Kairos version:

PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
KAIROS_IMAGE_REPO="quay.io/kairos/ubuntu:24.04-core-amd64-generic-v3.0.4-48-g2efd774"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_SOFTWARE_VERSION_PREFIX="k3s"
KAIROS_ID_LIKE="kairos-core-ubuntu-24.04"
KAIROS_VERSION="v3.0.4-48-g2efd774"
KAIROS_VERSION_ID="v3.0.4-48-g2efd774"
KAIROS_PRETTY_NAME="kairos-core-ubuntu-24.04 v3.0.4-48-g2efd774"
KAIROS_IMAGE_LABEL="24.04-core-amd64-generic-v3.0.4-48-g2efd774"
KAIROS_FLAVOR_RELEASE="24.04"
KAIROS_FAMILY="ubuntu"
KAIROS_MODEL="generic"
KAIROS_ID="kairos"
KAIROS_GITHUB_REPO="kairos-io/kairos"
KAIROS_VARIANT="core"
KAIROS_REGISTRY_AND_ORG="quay.io/kairos"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_NAME="kairos-core-ubuntu-24.04"
KAIROS_FLAVOR="ubuntu"
KAIROS_TARGETARCH="amd64"
KAIROS_RELEASE="v3.0.4-48-g2efd774"
KAIROS_ARTIFACT="kairos-ubuntu-24.04-core-amd64-generic-v3.0.4-48-g2efd774"

KAIROS_NAME="kairos-core-ubuntu"
KAIROS_VERSION="v3.0.7"
KAIROS_ID="ubuntu"
KAIROS_ID_LIKE="kairos-core-ubuntu"
KAIROS_VERSION_ID="v3.0.7"
KAIROS_PRETTY_NAME="kairos-core-ubuntu v3.0.7"
KAIROS_BUG_REPORT_URL="https://github.com/spectrocloud/CanvOS/issues"
KAIROS_HOME_URL="https://github.com/spectrocloud/CanvOS"
KAIROS_IMAGE_REPO="spectrocloud/CanvOS"
KAIROS_IMAGE_LABEL="latest"
KAIROS_GITHUB_REPO=""
KAIROS_VARIANT="ubuntu"
KAIROS_FLAVOR="ubuntu"
KAIROS_ARTIFACT="kairos-core-ubuntu-v3.0.7"

CPU architecture, OS, and Version:

Linux 0727e700-76d4-11e8-8be2-548351533800 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug
The fact that there is an empty line in /etc/os-release unfortunately breaks Ubuntu Pro, as it uses the following Python code:

def parse_os_release(release_file: Optional[str] = None) -> Dict[str, str]:
    if not release_file:
        release_file = "/etc/os-release"
    data = {}
    for line in load_file(release_file).splitlines():
        key, value = line.split("=", 1)
        if value:
            data[key] = value.strip().strip('"')
    return data

It doesn't skip empty lines and thus the function fails at key, value = line.split("=", 1) due to there not being 2 values.

To Reproduce
Run pro attach <valid-pro-key> on a Kairos 3.0.x image

Expected behavior

If /etc/os-release contains no empty lines, things work fine. I currently use this as a workaround:

sed -i '/^[[:space:]]*$/d' /etc/os-release

Logs

Additional context

@kreeuwijk kreeuwijk added bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed labels May 1, 2024
@ci-robbot
Copy link
Collaborator

Hello! I'm a bot, an experiment of @mudler and @jimmykarily. Thank you for reporting the issue with the empty line in /etc/os-release breaking Ubuntu Pro on Kairos. We understand you've provided a detailed description of the issue and steps on how to reproduce it. However, as the expected behavior isn't mentioned explicitly, I will label the issue as 'triage' for now, and our team will review it as soon as possible.

Please note that we won't be able to provide a solution for this issue in our response. Feel free to ask any further questions, and we'll do our best to assist you!

Kind regards,
Kairos Bot

@mudler mudler mentioned this issue May 2, 2024
33 tasks
@mudler mudler moved this to Todo 🖊 in 🧙Issue tracking board May 6, 2024
@Itxaka
Copy link
Member

Itxaka commented May 6, 2024

we seem to add an empty line at the end of the os-release with base kairos

@Itxaka Itxaka self-assigned this May 6, 2024
@Itxaka Itxaka moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board May 6, 2024
@Itxaka Itxaka moved this from In Progress 🏃 to Under review 🔍 in 🧙Issue tracking board May 6, 2024
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board May 7, 2024
@Itxaka Itxaka mentioned this issue May 7, 2024
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants