Bug 2149036 - Error in PREIN scriptlet in rpm package unbound-anchor
Summary: Error in PREIN scriptlet in rpm package unbound-anchor
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: unbound
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Menšík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2157669 2142368
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-28 16:18 UTC by Vendula Poncova
Modified: 2023-03-10 10:44 UTC (History)
10 users (show)

Fixed In Version: unbound-1.17.1-1.fc37 unbound-1.17.1-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-19 06:10:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vendula Poncova 2022-11-28 16:18:21 UTC
Description of problem:

Anaconda's gating tests are failing during the package installation with the following error: "An error occurred during the transaction: Error in PREIN scriptlet in rpm package unbound-anchor." (see [0]) The gating tests are failing since October 11. The last successful run was on September 19.

Version-Release number of selected component (if applicable):
Probably unbound-anchor-1.17.0-1.fc38.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:
# tmt reproducer
git clone https://src.fedoraproject.org/forks/packit/rpms/anaconda testcode
git -C testcode checkout -b testbranch 5a7836f84c54d146627a664474cde9bc58a1259a
cd testcode
tmt --context arch=x86_64 --context distro=fedora-38 --context trigger=commit run --all --verbose provision --how virtual --image Fedora-Rawhide prepare --how shell --script '

' plan --name ^/plans/integration$

Actual results:
The PREIN scriptlet exists with a non-zero exit code.

Expected results:
All scriptlets exit with the zero exit status (see [1]). 

Additional info:
[0] https://artifacts.dev.testing-farm.io/fccee813-5773-4b40-9507-ef1969206499/
[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/

Comment 1 Petr Menšík 2022-11-30 15:45:37 UTC
Hmm, strange. Preinstall just ensures the group and user for unbound exists. There should be no reason for its failure on normal system.

preinstall scriptlet (using /bin/sh):
getent group unbound >/dev/null || groupadd -r unbound
getent passwd unbound >/dev/null || \
useradd -r -g unbound -d /etc/unbound -s /sbin/nologin \
-c "Unbound DNS resolver" unbound

Comment 2 Petr Menšík 2022-12-01 15:43:21 UTC
I have issues starting reproduction machine. tmt fails for some reason to spawn rawhide system on my f37 system. Not sure how can I debug what is the actual problem.

$ LC_ALL=C.UTF-8 sudo tmt --context arch=x86_64 --context distro=fedora-38 --context trigger=commit run --all --verbose provision --how virtual --image Fedora-Rawhide prepare -vvv --how shell --script '

' plan --name ^/plans/integration$
/var/tmp/tmt/run-009
Found 1 plan.

/plans/integration
summary: Integration tests for anaconda
    discover
        how: fmf
        directory: /home/pemensik/rhel/tests/testcode
        hash: 5a7836f
        filter: tag: integration
        summary: 1 test selected
            /tests/dirinstall/dirinstall/text
    provision
        how: virtual
        user: root
        image: Fedora-Rawhide
        memory: 2048 MB
        disk: 10 GB
        connection: session
        arch: x86_64
        qcow: Fedora-Cloud-Base-Rawhide-20221129.n.0.x86_64.qcow2
        name: tmt-009-SAEhtZih
        key: /var/tmp/tmt/run-009/plans/integration/provision/default-0/id_ecdsa
        progress: booting...
libvirt: QEMU Driver error : vnitřní chyba: qemu neočekávaně ukončilo monitor: 2022-12-01T15:41:44.935951Z qemu-system-x86_64: -device {"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1,"write-cache":"on"}: PCI: slot 2 function 0 not available for virtio-blk-pci, in use by virtio-net-pci,id=(null)
Instance startup failed, retrying in 5 seconds...
libvirt: QEMU Driver error : vnitřní chyba: qemu neočekávaně ukončilo monitor: 2022-12-01T15:41:50.425676Z qemu-system-x86_64: -device {"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1,"write-cache":"on"}: PCI: slot 2 function 0 not available for virtio-blk-pci, in use by virtio-net-pci,id=(null)
    finish
        how: shell
        overview: 1 script found
        script: command -v journalctl && journalctl -a || true
The guest is not available.

Comment 3 Petr Menšík 2022-12-01 20:28:33 UTC
Found alternative reproduction, just use Rawhide machine to install anaconda, prepare the same ks.cfg and use:

cat > ks.cfg << EOF
url --metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-rawhide&arch=x86_64
repo --name=fedora-modular --metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-rawhide&arch=x86_64
# The repository configuration (url, repo) needs to be added here.
# It varies by the product and version we are running on / testing

lang en_US.UTF-8
keyboard --vckeymap=us --xlayouts='us'
rootpw --plaintext redhat
timezone --utc Europe/Prague

shutdown

%packages
%end
EOF

anaconda --dirinstall /var/tmp/dirinstall.UrZKlu/install_dir --kickstart $PWD/ks.cfg --text --noninteractive

It reproduces described issue. Problem is I would need more details from dnf transaction. I think any failures should be printed to stderr. Is there perhaps way to request anaconda to add --verbose flag to dnf during install? Is it possible to use kickstart file for that? Is there log with more details somewhere in install_dir?

Comment 4 Jiri Konecny 2022-12-02 12:34:41 UTC
All the require information should be found in logs in /tmp/. Probably want the dnf.log and dnf.librepo.log.

Also a note it started with Fedora 38, on Fedora 37 this worked just fine.

Comment 5 Jiri Konecny 2022-12-02 12:38:23 UTC
Sorry I meant you want `packaging.log`.

Attaching it from the installation.

Comment 6 Jiri Konecny 2022-12-02 12:40:14 UTC
Created attachment 1929324 [details]
packaging.log

Comment 7 Jiri Konecny 2022-12-02 12:40:52 UTC
Created attachment 1929325 [details]
dnf.librepo.log

Comment 8 Jiri Konecny 2022-12-02 12:42:04 UTC
I see there is an issue with

```
dnf.rpm: groupadd connet open /etc/group
```

Could be an issue with adding groups on Rawhide?

Comment 9 Petr Menšík 2022-12-06 15:26:59 UTC
(In reply to Jiri Konecny from comment #6)
> Created attachment 1929324 [details]
> packaging.log

Thanks! found inside:

13:36:15,525 INF dnf.rpm: groupadd: cannot open /etc/group
useradd: group 'unbound' does not exist
error: %prein(unbound-anchor-1.17.0-1.fc38.x86_64) scriptlet failed, exit status 6

13:36:15,526 ERR dnf.rpm: Error in PREIN scriptlet in rpm package unbound-anchor
13:36:15,573 INF dnf.rpm: error: unbound-anchor-1.17.0-1.fc38.x86_64: install failed
warning: user unbound does not exist - using root
warning: group unbound does not exist - using root
warning: user unbound does not exist - using root
warning: group unbound does not exist - using root

13:36:16,419 INF dnf.rpm: Created symlink /etc/systemd/system/graphical.target.wants/udisks2.service → /usr/lib/systemd/system/udisks2.service.
Running in chroot, ignoring request.
Running in chroot, ignoring request.

Could you please verify group file is present soon enough for packages to evaluate? It is part of setup package. Is setup package order enforced to be before any service adding a new user? I am not sure even using systemd-sysusers would allow creating users at this stage.

It seems to me much more packages might have issues with this error. I doubt I should have Requires(pre): setup in the unbound-libs package.

Comment 10 Jiri Konecny 2022-12-07 18:38:51 UTC
Hi, I honestly not sure how this is handled but I don't think Anaconda is in charge or configuring this somehow special.

Maybe DNF team could help us here. Jardo, are you able to help us here?

Comment 11 Martin Kolman 2022-12-15 14:30:33 UTC
Adding RPM team members to CC to check if this scriptlet failure should be fatal for the transaction or not. Thanks jmracek for the suggestion! :)

Comment 12 Petr Menšík 2023-01-02 11:40:30 UTC
(In reply to Martin Kolman from comment #11)
> Adding RPM team members to CC to check if this scriptlet failure should be
> fatal for the transaction or not. Thanks jmracek for the suggestion! :)

I think more important would be adding more details into useradd/groupadd when the adding failed. If it is permission problem, it should clearly state it.
Message:

groupadd: cannot open /etc/group

is not much helpful. Errno of the failure would help a lot, because it is unclear to me what the problem is and how to debug it during the install process.

Comment 13 Petr Menšík 2023-01-03 14:11:25 UTC
Maybe I have found a fix. Not sure whether it is correction of ownership of unbound-libs with user created there. Or usage of systemd-sysusers helped instead. Not sure which one.

With following kickstart with my copr unbound, installation passes successfully.

cat >ks-copr.cfg <<EOF
url --metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-rawhide&arch=x86_64
repo --name=fedora-modular --metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-modular-rawhide&arch=x86_64
repo --name=copr-unbound --baseurl=https://download.copr.fedorainfracloud.org/results/pemensik/unbound/fedora-rawhide-x86_64/
# The repository configuration (url, repo) needs to be added here.
# It varies by the product and version we are running on / testing

lang en_US.UTF-8
keyboard --vckeymap=us --xlayouts='us'
rootpw --plaintext redhat
timezone --utc Europe/Prague

shutdown

%packages
%end
EOF

Comment 14 Fedora Update System 2023-01-16 22:12:39 UTC
FEDORA-2023-f1a7ba0307 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f1a7ba0307

Comment 15 Fedora Update System 2023-01-17 02:40:26 UTC
FEDORA-2023-f1a7ba0307 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-f1a7ba0307`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-f1a7ba0307

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2023-01-17 20:01:46 UTC
FEDORA-2023-43a9d5fbe6 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2023-43a9d5fbe6

Comment 17 Fedora Update System 2023-01-18 03:39:47 UTC
FEDORA-2023-43a9d5fbe6 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-43a9d5fbe6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-43a9d5fbe6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2023-01-19 06:10:56 UTC
FEDORA-2023-f1a7ba0307 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2023-02-02 02:02:02 UTC
FEDORA-2023-43a9d5fbe6 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.