-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
podman run fails on Ubuntu 23.10 (Error: install profile containers-default-0.50.1: generate default profile into pipe: get AppArmor version: convert AppArmor patch version: strconv.Atoi: parsing "0~alpha2": invalid syntax) #20278
Comments
Hi @MarcoFalke , I think it happens because of diff --git a/vendor/github.com/containers/common/pkg/apparmor/apparmor_linux.go b/vendor/github.com/containers/common/pkg/apparmor/apparmor_linux.go
index 7ba63ba74..549c1a2ac 100644
--- a/vendor/github.com/containers/common/pkg/apparmor/apparmor_linux.go
+++ b/vendor/github.com/containers/common/pkg/apparmor/apparmor_linux.go
@@ -212,6 +212,11 @@ func parseAAParserVersion(output string) (int, error) {
words := strings.Split(lines[0], " ")
version := words[len(words)-1]
+ if strings.Contains(version, "~") {
+ alpha := strings.Split(version, "~")
+ version = alpha[0]
+ }
+
// split by major minor version
v := strings.Split(version, ".")
if len(v) == 0 || len(v) > 3 { |
Hmm, I think I won't be able to compile from scratch, unless you provide me with a full one-line bash command to copy-paste, to do it. :) The machine is a fresh vanilla Ubuntu. The apparmor package seems to be https://packages.ubuntu.com/mantic/apparmor and the podman package is https://packages.ubuntu.com/mantic/podman-docker |
We first need to get something into the main branch to fix. Ubuntu can then cherry-pick the fix and apply it downstream. Heads up: @siretart |
I'd hope it'll work on final release of Ubuntu 23.10, but I'll set up a VM and try to prepare a PR. |
Cannot reproduce on the latest Ubuntu 23.10 beta, so I think we can close. |
@vrothberg I think it will fail with alpha version of apparmor i.e https://launchpad.net/ubuntu/+source/apparmor/4.0.0~alpha2-0ubuntu5 , could you confirm the version of apparmor which you had on your ubuntu distro |
Ah ... I should have paid better attention. For sure, the profile will only be loaded when running root_ful_ but I ran rootless. |
see #19962, we need someone to send these patches to c/common |
I'm on it. Having all rootful podmans broken on Ubuntu would be bad - unless the package changes the file name. |
Following what Docker did, the following patch to containers/common does the trick: diff --git a/pkg/apparmor/apparmor_linux.go b/pkg/apparmor/apparmor_linux.go
index 7ba63ba7..435422c2 100644
--- a/pkg/apparmor/apparmor_linux.go
+++ b/pkg/apparmor/apparmor_linux.go
@@ -212,6 +212,11 @@ func parseAAParserVersion(output string) (int, error) {
words := strings.Split(lines[0], " ")
version := words[len(words)-1]
+ // trim "-beta1" suffix from version="3.0.0-beta1" if exists
+ version = strings.SplitN(version, "-", 2)[0]
+ // also trim "~..." suffix used historically (https://gitlab.com/apparmor/apparmor/-/commit/bca67d3d27d219d11ce8c9cc70612bd637f88c10)
+ version = strings.SplitN(version, "~", 2)[0]
+
// split by major minor version
v := strings.Split(version, ".")
if len(v) == 0 || len(v) > 3 { |
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This will be resolved on next vendor of |
Fix is in containers/common#1689 |
Is there any workaround? |
I don't think so, apart from waiting for the affected Ubuntu/Debian to pull in the fix. You could use |
Based on the docs I would assume |
apparently this has been reported in ubuntu as https://bugs.launchpad.net/podman/+bug/2040082 |
Apparently this issue is specific to ubuntu mantic (23.10), and curently to noble (the current dev release). It is not observable on earlier releases of ubuntu, such as lunar, or on any Debian release, as none of those distro ship a version of apparmor that comes with |
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Copied from github.com/moby/moby who already has a fix for it. Tested manually on a Ubuntu 23.10 (beta) VM. Fixes: #containers/podman/issues/20278 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Issue Description
Steps to reproduce the issue
Describe the results you received
error
Describe the results you expected
no error
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: