Bug 1365410 - Deletion of errata does not regenerate updateinfo.xml
Summary: Deletion of errata does not regenerate updateinfo.xml
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Herget
QA Contact: Patrik Segedy
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2016-08-09 08:15 UTC by Patrik Segedy
Modified: 2017-06-21 12:15 UTC (History)
3 users (show)

Fixed In Version: spacewalk-java-2.6.37-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:15:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Patrik Segedy 2016-08-09 08:15:26 UTC
Description of problem:
When you delete erratum from channel repodata are regenerated except for updateinfo.xml.gz. This file contains metadata of actually deleted erratum.

Version-Release number of selected component (if applicable):
spacewalk-java-2.3.8-149.el6sat.noarch

How reproducible:
always

Steps to Reproduce:
1. Create channel and push some packages
2. Create erratum from some pushed packages and publish it
3. Repodata in /var/cache/rhn/<channel> looks like 
-rw-r--r--. 1 root root  13968 Aug  9 03:47 filelists.xml.gz
-rw-r--r--. 1 root root 626146 Aug  9 03:47 other.xml.gz
-rw-r--r--. 1 root root   3751 Aug  9 03:47 primary.xml.gz
-rw-r--r--. 1 root root   1134 Aug  9 03:47 repomd.xml
-rw-r--r--. 1 root root    712 Aug  9 03:47 updateinfo.xml.gz

4. Delete created erratum
5. updateinfo.xml.gz isn't modified
-rw-r--r--. 1 root root  13649 Aug  9 03:53 filelists.xml.gz
-rw-r--r--. 1 root root 625833 Aug  9 03:53 other.xml.gz
-rw-r--r--. 1 root root   3305 Aug  9 03:53 primary.xml.gz
-rw-r--r--. 1 root root    871 Aug  9 03:53 repomd.xml
-rw-r--r--. 1 root root    712 Aug  9 03:47 updateinfo.xml.gz


Actual results:
updateinfo.xml.gz isn't modified and contains metadata of deleted erratum

Expected results:
updateinfo.xml.gz should be modified

Additional info:
repomd.xml does not list updateinfo.xml.gz

Comment 1 Eric Herget 2016-09-29 15:20:46 UTC
I am unable to reproduce this issue.  I'm running spacewalk-java-2.6.30-1.git.36.78c3c2e.el6 on RHEL 6.8 system.

I'm in /var/cache/rhn/repodata/testchannellabel and see this before and after dir listing:

-rw-r--r--. 1 root root 1358 Sep 29 10:56 filelists.xml.gz
-rw-r--r--. 1 root root  264 Sep 29 10:56 other.xml.gz
-rw-r--r--. 1 root root 1616 Sep 29 10:56 primary.xml.gz
-rw-r--r--. 1 root root 1134 Sep 29 10:56 repomd.xml
-rw-r--r--. 1 root root  469 Sep 29 10:56 updateinfo.xml.gz


-rw-r--r--. 1 root root  859 Sep 29 10:59 filelists.xml.gz
-rw-r--r--. 1 root root  219 Sep 29 10:59 other.xml.gz
-rw-r--r--. 1 root root 1408 Sep 29 10:59 primary.xml.gz
-rw-r--r--. 1 root root 1134 Sep 29 10:59 repomd.xml
-rw-r--r--. 1 root root  384 Sep 29 10:59 updateinfo.xml.gz

So it appears to be working.  I checked the updateinfo.xml and the reference to the deleted erratum is, in fact, gone.

Looking for bz's where this issue was potentially fixed between v2.3.8 and 2.6.30, I find a few, but none that speak directly to a problem where updateinfo.xml.gz is not regenerated after deleting an erratum.  Possibly this issue was addressed when fixing some other updateinfo.xml.gz issue, such as this one...

1135073 - (fixed in 2.3.25) updateinfo.xml.gz does not contain correct url for bugs referenced

Comment 2 Eric Herget 2016-09-29 19:01:40 UTC
I also tested this on a Satellite 5.7 system to check that this is not an issue fixed in Spacewalk that didn't make it into Satellite.  I also cannot reproduce this issue on Satellite 5.7.

Comment 3 Eric Herget 2016-09-29 19:31:09 UTC
I checked the code that writes these files (RpmRepositoryWrite.java) and don't see any changes since an abstraction layer was introduced to support both Rpm and Debian repos - back on Oct 1, 2010.  see commit 2e68c64438e375f40b711346259bc8533918956d

Its hard to guess at how this issue occurred since the updateinfo file is updated just after writing filelists, other and primary files, but before writing the repomd file.  The only scenario I can guess involves something preventing the updateinfo file from being overwritten, such as the file already being opened by some other process or some weird change of selinux fcontext, etc.

I'm going to close this since I can't reproduce it on Satellite 5.7 or Spacewalk.  If you find a way to reproduce this, please reopen with more detailed steps to reproduce.

Comment 4 Eric Herget 2016-09-29 20:46:18 UTC
Reopened.  Found the scenario in which this issue occurs.  The code which creates/updates the updateinfo file does not run where the channel has no errata.  So the caveat here is that the deleted erratum must be the only, or the last, erratum associated with the channel.

I believe the fix is to delete the file, if it exists, and the channel has no errata.

Comment 5 Tomas Lestach 2016-09-30 10:07:46 UTC
I think I was able to reproduce this issue. Comment 4 is absolutely correct.

Comment 6 Eric Herget 2016-09-30 17:29:20 UTC
spacewalk.github:
d82253722be5e7f6f1b1aa97557942a43c45c819

Comment 8 Patrik Segedy 2016-11-28 10:03:28 UTC
Verified on Satellite 5.8 compose with spacewalk-java-2.5.14-26.el6sat.noarch

I followed steps to reproduce and I see this before and after deletion

-rw-r--r--. 1 root root  744 Nov 28 04:46 filelists.xml.gz
-rw-r--r--. 1 root root  752 Nov 28 04:46 other.xml.gz
-rw-r--r--. 1 root root 1544 Nov 28 04:46 primary.xml.gz
-rw-r--r--. 1 root root 1134 Nov 28 04:46 repomd.xml
-rw-r--r--. 1 root root  725 Nov 28 04:46 updateinfo.xml.gz


-rw-r--r--. 1 root root  488 Nov 28 04:53 filelists.xml.gz
-rw-r--r--. 1 root root  517 Nov 28 04:53 other.xml.gz
-rw-r--r--. 1 root root 1134 Nov 28 04:53 primary.xml.gz
-rw-r--r--. 1 root root  871 Nov 28 04:53 repomd.xml


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