-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-9.6, rhel-9.7
-
None
-
None
-
Moderate
-
subs-client-tools-1
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
x86_64
-
None
What were you trying to do that didn't work?
When building container image for Image mode rhel , If insights-client is being pre-installed then execution of "bootc container lint" at the end , would result in an warning
STEP 4/4: RUN bootc container lint Lint warning: var-tmpfiles: Found content in /var missing systemd tmpfiles.d entries: d /var/lib/insights 0750 root root - - Checks passed: 11 Checks skipped: 1 Warnings: 1
But the image gets created just fine.
What is the impact of this issue to you?
If this image is used for a fresh system, everything will be fine., the directory /var/lib/insights will exist (and insights-client can start).
However, if the image built as above is installed to an existing system on which /var/lib/insights does not already exist (using bootc switch), the directory will not be created (and insights-client.service will fail. Error trace would be somthing like
systemd[1]: Started Insights Client. insights-client[36619]: Traceback (most recent call last): insights-client[36619]: File "/usr/bin/insights-client", line 11, in <module> insights-client[36619]: _main() insights-client[36619]: File "/usr/lib/python3.9/site-packages/insights_client/__init__.py", line 415, in _main insights-client[36619]: validated_eggs = sorted_eggs(list(filter(gpg_validate, [STABLE_EGG, RPM_EGG]))) insights-client[36619]: File "/usr/lib/python3.9/site-packages/insights_client/__init__.py", line 213, in gpg_va> insights-client[36619]: home = tempfile.mkdtemp(dir=TEMPORARY_GPG_HOME_PARENT_DIRECTORY) insights-client[36619]: File "/usr/lib64/python3.9/tempfile.py", line 379, in mkdtemp insights-client[36619]: _os.mkdir(file, 0o700) insights-client[36619]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/insights/tmpu_8nqcz4' systemd[1]: insights-client.service: Main process exited, code=exited, status=1/FAILURE
Please provide the package NVR for which the bug is seen:
insights-client-3.2.8-1.el9.noarch
How reproducible is this bug?:
Always
Steps to reproduce
- Create a Containerfile with the following basic instructions:
FROM registry.redhat.io/rhel9/rhel-bootc:9.7-1765350338 RUN dnf install --assumeyes insights-client && dnf clean all RUN rm -r /var/log /var/cache /var/lib/dnf /var/roothome /var/lib/rhsm RUN bootc container lint
- Try building the image
Expected results
No warnings or errors about /var/lib/insights. A fix should be added in insights-client package o e.g. adding the systemd-tmpfiles configuration in /usr/lib/tmpfiles.d/insights-client.conf as suggested by bootc container lint.
Actual results
<provided at the beginning>
Workaround
Add this to the Containerfile to workaround the problem:
RUN ! systemd-tmpfiles --cat | grep /var/lib/insights || exit 1; echo 'd /var/lib/insights 0750 root root - -' > /usr/lib/tmpfiles.d/insights-client.conf