Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1931872

Summary: dnf fails when another instance runs in parallel (cache is removed)
Product: Red Hat Enterprise Linux 8 Reporter: Flavio Leitner <fleitner>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DEFERRED QA Contact: swm-qe
Severity: high Docs Contact:
Priority: high    
Version: 8.3CC: amatej, james.antill, jcastran
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-06 12:36:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Flavio Leitner 2021-02-23 13:01:49 UTC
Description of problem:

When two 'dnf' instances are running in parallel, the cache is unprotected leading the second instance waiting to fail.

shell #1
# dnf install vim-enhanced

shell #2
# dnf install vim-enhanced


shell #1
- downloads the dependencies, installs and verifies the deps.

shell #2
- notices the downloads are there, waits shell #1 to complete, then fails.


Version-Release number of selected component (if applicable):
dnf-4.2.23-4.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Just install the same package using two dnf in parallel

Actual results:
[SKIPPED] pkgconf-1.4.2-1.el8.x86_64.rpm: Already downloaded                                              
[SKIPPED] pkgconf-m4-1.4.2-1.el8.noarch.rpm: Already downloaded                                           
[SKIPPED] pkgconf-pkg-config-1.4.2-1.el8.x86_64.rpm: Already downloaded                                   
[SKIPPED] xml-common-0.6.3-50.el8.noarch.rpm: Already downloaded                                          
Running transaction check                                                                                 
Waiting for process with pid 27640 to finish.                    
Transaction check succeeded.                                                                              
Running transaction test                                  
Error: Cannot open file /var/cache/dnf/beaker-AppStream-822659b7f413e82c/packages/pixman-0.38.4-1.el8.x86_6
4.rpm: [Errno 2] No such file or directory: '/var/cache/dnf/beaker-AppStream-822659b7f413e82c/packages/pixm
an-0.38.4-1.el8.x86_64.rpm'                                                                               
TypeError: an integer is required (got type NoneType)                                                     
FATAL ERROR: python callback ??? failed, aborting! 

Expected results:
To proper synchronize the threads.

Additional info:

The example above is a simplified case to make an easy reproducer.

The real use-case is that there is a daemon installed by Beaker that install packages (rstrnt-package) and that happens while the CI is accessing the server to deploy all the dependencies. That problem always happen when the dependencies coincides.

I can imagine another use case that the user could install something using CLI while the package updater is upgrading as well.

Comment 1 Jaroslav Mracek 2022-04-06 12:36:06 UTC
I am really sorry but the issue is very difficult to resolve it in current code base. But we would like to address the issue in the next major packager update that is planned for RHEL10.