Bug 1215943 - [Build 20231003] busybox-gzip's zgrep is incompatible with busybox-grep
Summary: [Build 20231003] busybox-gzip's zgrep is incompatible with busybox-grep
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Containers (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dirk Mueller
QA Contact: E-mail List
URL: https://openqa.opensuse.org/tests/362...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-04 12:25 UTC by Guillaume GARDET
Modified: 2023-12-10 12:36 UTC (History)
6 users (show)

See Also:
Found By: openQA
Services Priority:
Business Priority:
Blocker: Yes
Marketing QA Status: ---
IT Deployment: ---


Attachments
k3s check-config output (3.99 KB, text/plain)
2023-10-04 12:25 UTC, Guillaume GARDET
Details
microos install log (3.64 MB, text/plain)
2023-10-06 09:46 UTC, Martin Loviska
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume GARDET 2023-10-04 12:25:25 UTC
Created attachment 869906 [details]
k3s check-config output

## Observation

openQA test in scenario microos-Tumbleweed-DVD-aarch64-container-host@aarch64-4G-HD40G fails in
[podman_pods](https://openqa.opensuse.org/tests/3620135/modules/podman_pods/steps/201)

k3s check-config has been introduced with https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/17699
but this fails on microos, likely because grep from busybox does not support '--label=XYZ' option.


## Test suite description



## Reproducible

Fails since (at least) Build [20231003](https://openqa.opensuse.org/tests/3619949)


## Expected result

Last good: [20231002](https://openqa.opensuse.org/tests/3615977) (or more recent)


## Further details

Always latest result in this scenario: [latest](https://openqa.opensuse.org/tests/latest?arch=aarch64&distri=microos&flavor=DVD&machine=aarch64-4G-HD40G&test=container-host&version=Tumbleweed)
Comment 1 Martin Loviska 2023-10-06 09:46:27 UTC
Created attachment 869949 [details]
microos install log
Comment 2 Martin Loviska 2023-10-06 09:46:43 UTC
The check-config script is reading /proc/config.gz [1], therefore using zgrep [2].

In DVD test suite the installer pulls busybox-gzip instead of gzip package.

```
2023-10-06 00:44:42 <1> install(3735) [zypp::exec++] forkspawnengine.cc(start):274 Executing[C] 'rpm' '--root' '/mnt' '--dbpath' '/var/lib/rpm' '-U' '--percent' '--noglob' '--excludedocs' '--force' '--nodeps' '--' '/mnt/var/cache/zypp/packages/openSUSE-MicroOS-20231005-0/noarch/busybox-gzip-1.36.1-30.1.noarch.rpm'
2023-10-06 00:44:42 <1> install(3735) [Ruby] modules/PackageSlideShow.rb(PkgInstallDone):405 Installed package busybox-gzip
2023-10-06 00:44:42 <1> install(3735) [zypp-core] PathInfo.cc(unlink):706 unlink /mnt/var/cache/zypp/packages/openSUSE-MicroOS-20231005-0/noarch/busybox-gzip-1.36.1-30.1.noarch.rpm
```

Replacing busybox-gzip by gzip fixes the issue.

```
cat: /sys/kernel/security/apparmor/profiles: No such file or directory                                                                                                                                      [37/741]

Verifying binaries in /var/lib/rancher/k3s/data/3dfc950bd39d2e2b435291ab8c1333aa6051fcaf46325aee898819f3b99d4b21/bin:
- sha256sum: good
- links: good

System:
- /sbin iptables v1.8.9 (legacy): ok
- swap: disabled
- routes: ok

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: cgroups V2 mounted, cpu|cpuset|memory controllers status: good
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_PIDS: enabled
...
```

[1] https://github.com/k3s-io/k3s/blob/master/contrib/util/check-config.sh#L14
[2] https://github.com/k3s-io/k3s/blob/master/contrib/util/check-config.sh#L36
Comment 3 Felix Niederwanger 2023-10-11 11:50:14 UTC
I filed https://github.com/k3s-io/k3s/issues/8585 as an upstream bug for this issue.
Comment 4 Dominique Leuenberger 2023-11-02 17:29:09 UTC
k3s check-config runs zgrep (unless on an Apparmor system, as then zgrep throws permission denied when calling out to zcat - so they detect that and fall back to an internal zcat | grep, just as if zgrep would not exist)


the zgrep file shipped as part of /busybox-gzip seems to be broken:

    while [ "$#" -gt 0 ]; do
        # shellcheck disable=SC2086
        if [ $pattern_found -eq 2 ]; then
            "zcat" -- "$1" | "grep" --label="${1}" ${grep_args} -- -
        else
            "zcat" -- "$1" | "grep" --label="${1}" ${grep_args} -- "${pattern}" -
        fi
        [ "$?" -ne 0 ] && EXIT_CODE=1
        shift
    done

buzysbox-grep does not support --label though; which essentially means, busybox-gzip would need to conflict busybox-grep to ensure the 'real' grep is there; hard to believe this would be intentional
Comment 5 Thorsten Kukuk 2023-11-02 19:35:17 UTC
The files zless, zmore and zgrep are from Dirk:

https://build.opensuse.org/package/rdiff/openSUSE:Factory/busybox-links?linkrev=base&rev=22
Comment 6 Dominique Leuenberger 2023-11-03 07:50:06 UTC
(In reply to Thorsten Kukuk from comment #5)
> The files zless, zmore and zgrep are from Dirk:
> 
> https://build.opensuse.org/package/rdiff/openSUSE:Factory/busybox-
> links?linkrev=base&rev=22

Indeed; apologies for that. I searched for zgrep in the changes file and only found this:
Fri Aug 28 08:09:37 UTC 2020 - Thorsten Kukuk

- Add zgrep to gzip sub-package

Dirk's files are indeed newer and replacing the original variants we had
Comment 7 Dirk Mueller 2023-11-20 13:01:17 UTC
I have submitted a fix for busybox-links, but I think microos tumbleweed should consider installing gzip by default..
Comment 8 OBSbugzilla Bot 2023-12-08 14:55:04 UTC
This is an autogenerated message for OBS integration:
This bug (1215943) was mentioned in
https://build.opensuse.org/request/show/1132118 Factory / busybox-links
Comment 9 Dominique Leuenberger 2023-12-10 12:36:11 UTC
(In reply to OBSbugzilla Bot from comment #8)
> This is an autogenerated message for OBS integration:
> This bug (1215943) was mentioned in
> https://build.opensuse.org/request/show/1132118 Factory / busybox-links

Merged and confirmed by openQA:
https://openqa.opensuse.org/tests/3797247