Bug 1022004 - package count doesn't match with actual packages in repodata
package count doesn't match with actual packages in repodata
Product: Fedora
Classification: Fedora
Component: createrepo_c (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomas Mlcoch
Fedora Extras Quality Assurance
Depends On: 1022001
Blocks: 578256
  Show dependency treegraph
Reported: 2013-10-22 09:19 EDT by Daniel Mach
Modified: 2016-07-19 06:30 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1022001
Last Closed: 2016-07-19 06:30:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Daniel Mach 2013-10-22 09:19:15 EDT
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:

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 09:46:22 EDT
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 04:40:33 EDT
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 11:56:24 EST
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:
Comment 4 Fedora End Of Life 2016-07-19 06:30:38 EDT
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

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

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