Bug 1022004

Summary: package count doesn't match with actual packages in repodata
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: createrepo_cAssignee: Tomas Mlcoch <tmlcoch>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: jzeleny, lmacken, packaging-team-maint, tmlcoch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1022001 Environment:
Last Closed: 2016-07-19 10:30:38 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:
Bug Depends On: 1022001    
Bug Blocks: 578256    

Description Daniel Mach 2013-10-22 13:19:15 UTC
createrepo_c doesn't seem to cover this scenario well too.
It even sometimes hangs forever; strace output is:

futex(0xdb5fb0, FUTEX_WAKE_PRIVATE, 1C_CREATEREPOLIB: Warning: read_header: Fopen of ./<nvr>.x86_64.rpm failed No such file or directory
Warning: Cannot read package: ./<nvr>.x86_64.rpm
)  = 1
write(1, "Pool started (with 5 workers)\n", 30Pool started (with 5 workers)
) = 30
futex(0xdb6024, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
futex(0xdb5fb0, FUTEX_WAKE_PRIVATE, 1)  = 0
futex(0xdb6024, FUTEX_WAIT_PRIVATE, 3, NULL



+++ This bug was initially created as a clone of Bug #1022001 +++

Package version:
createrepo-0.10-1.fc21.noarch

How to reproduce:
1) create a file list with existing packages
2) append a line with package that does not exist
3) run $ createrepo -i <package-list> .


zegrep '<package |packages=' repodata/*primary*xml*
<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="3">
<package type="rpm">
<package type="rpm">

Header says 3 packages while there are just 2 of them in metadata.

Comment 1 Zdeněk Pavlas 2013-10-22 13:46:22 UTC
Fixing this is not going to be simple, as we write the package count to XML header first, then append <package> elements.  And it's gz-compressed, so back-patching the right number is not possible.

To fix this, we need to add a 2nd pass (probably conditional, run on failures only).  Pretty ugly IMO, but it should fix this, and not make createrepo much slower in the common case where the package count does not change.

Comment 2 Tomas Mlcoch 2013-10-23 08:40:33 UTC
Note about the hang:
I've tried to reproduce the issue with no success.
After Dan had updated its createrepo_c to the 0.2.1 version, the problem disappeared. So the "hang part" of this bug is considered as solved.

Comment 3 Jaroslav Reznik 2015-03-03 16:56:24 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 Fedora End Of Life 2016-07-19 10:30:38 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.