Skip to content

fix: install gitlab-runner-helper-packages if version is specified#363

Merged
guenhter merged 2 commits intoriemers:masterfrom
nicoklaus:master
Feb 4, 2025
Merged

fix: install gitlab-runner-helper-packages if version is specified#363
guenhter merged 2 commits intoriemers:masterfrom
nicoklaus:master

Conversation

@nicoklaus
Copy link
Copy Markdown
Contributor

Description

As of gitlab-runner version v17.7.1, when you install a specific version of gitlab-runner that is not the latest version, you must explicitly install the required gitlab-runner-helper-packages for that version. This requirement exists due to an apt/apt-get limitation.

Current Behavior

The playbooks fail, as the required dependency is not met and apt can't resolve it automatically.

TASK [riemers.ansible-gitlab-runner : (Debian) Install GitLab Runner] **************************************************************************************************************************************
task path: /workspaces/Development/IaC/Ansible/Roles/riemers.ansible-gitlab-runner/tasks/install-debian.yml:45
fatal: [dettlx712.intra.ifm]: FAILED! => {"cache_update_time": 1738662513, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'gitlab-runner=17.7.1-1' --allow-downgrades --allow-change-held-packages' failed: E: Unable to correct problems, you have held broken packages.\n", "rc": 100, "stderr": "E: Unable to correct problems, you have held broken packages.\n", "stderr_lines": ["E: Unable to correct problems, you have held broken packages."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n gitlab-runner : Depends: gitlab-runner-helper-images (= 17.7.1-1) but 17.8.3-1 is to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Some packages could not be installed. This may mean that you have", "requested an impossible situation or if you are using the unstable", "distribution that some required packages have not yet been created", "or been moved out of Incoming.", "The following information may help to resolve the situation:", "", "The following packages have unmet dependencies:", " gitlab-runner : Depends: gitlab-runner-helper-images (= 17.7.1-1) but 17.8.3-1 is to be installed"]}

Related Issue

Since gitlab-runner v14 the env GITLAB_RUNNER_DISABLE_SKEL is default to true. The latest available gitlab-runner version for buster is v17.7.
As of gitlab-runner version v17.7.1, when you install a specific version of gitlab-runner that is not the latest version, you must explicitly install the required gitlab-runner-helper-packages for that version.
@guenhter guenhter merged commit a2d45f3 into riemers:master Feb 4, 2025
1 check passed
@guenhter
Copy link
Copy Markdown
Collaborator

guenhter commented Feb 4, 2025

Thx for this contribution

@nicoklaus
Copy link
Copy Markdown
Contributor Author

Hey @guenhter, short question. Is there a release planned in the near future? There are some changes and in my prod environment I use the Galaxy requirements and not the GitHub repo as bleeding edge. Thank you.

@guenhter
Copy link
Copy Markdown
Collaborator

guenhter commented Feb 4, 2025

@riemers Forward this to you.

@riemers
Copy link
Copy Markdown
Owner

riemers commented Feb 4, 2025

Bumped the version and updated galaxy. Had a fight again with it, but both roles (the new and the old) are updated.

@fkleon
Copy link
Copy Markdown
Contributor

fkleon commented Feb 25, 2025

Hi @nicoklaus and @riemers - we found this to be an unexpected breaking change in v2.0.8.

The package gitlab-runner-helper-images does not exist prior to GitLab release 17.7.1 so provisioning fails for users having gitlab_runner_package_version pinned to <= 17.7.0.

We'll just continue to use v2.0.7 for now, but would be good to point out breaking changes in the merge request and/or release notes.

@guenhter
Copy link
Copy Markdown
Collaborator

@nicoklaus could you handle that?

@nicoklaus
Copy link
Copy Markdown
Contributor Author

nicoklaus commented Feb 26, 2025

Hey @fkleon, sorry on that. As I interpreted the warning in the GitLab Documentation it sounded like the package was always a needed dependency and existed but now needs to be manually installed.

As of gitlab-runner version v17.7.1, when you install a specific version of gitlab-runner that is not the latest version, you must explicitly install the required gitlab-runner-helper-packages for that version. This requirement exists due to an apt/apt-get limitation.

@guenhter for sure. I will write a fix which checks if the package is available and only install it if it's true, a breaking change would be ugly as this mean that the playbook from version 2.0.8 can only handle gitlab-runner versions higher than 17.7.1.

@nicoklaus
Copy link
Copy Markdown
Contributor Author

@guenhter #370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants