Skip to content

rpm --query attempt a transaction lock #4110

@fmo25

Description

@fmo25

If rpm --query is used during a running transaction, it complains on
stderr with:

    error: can't create transaction lock on /usr/lib/sysimage/rpm/.rpm.lock (Resource temporarily unavailable)

but succeeds anyway and gives the proper output..

Steps to reproduce :

  1. install a package as root, pause it mid-transaction
  2. execute: rpm -q bash < /dev/null
  3. result in:
    error: can't create transaction lock on /usr/lib/sysimage/rpm/.rpm.lock (Resource temporarily unavailable)
    bash-5.3.0-2.fc43.x86_64

Without < /dev/null one gets:

    warning: waiting for transaction lock on /usr/lib/sysimage/rpm/.rpm.lock

Expected behavior
Nothing on stderr

Environment

  • Fedora 43
  • rpm.x86_64 6.0.1-1.fc43

Additional context

This has been shown in the akmods command that is called in
posttrans of the akmod-KMOD and kernel-core RPM's

This doesn't happens on Fedora 42 with rpm-4.20.1-1.fc42.x86_64

I guess that this is due to this commit:

79b26f1

Workaround

Add the --nosignature option to rpm --query

Possible fix

Add the RPMVSF_MASK_NOSIGNATURES flags to vsflags in the
rpmcliQuery function.

AFAIK: none of the options usable with --query needs to load the
keyring

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions