Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 591291 - Satellite 5.3: mergeErrata API call does not copy/add packages, it will also associate (instead of clone) non-custom errata to a custom channel (should not be allowed)
Satellite 5.3: mergeErrata API call does not copy/add packages, it will also ...
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
high Severity high
: ---
: ---
Assigned To: Tomas Lestach
Šimon Lukašík
:
Depends On:
Blocks: sat531-triage
  Show dependency treegraph
 
Reported: 2010-05-11 15:47 EDT by Xixi
Modified: 2018-11-14 14:35 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-18 03:28:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
catalina.out (11.15 KB, text/plain)
2010-09-08 09:01 EDT, Šimon Lukašík
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0897 normal SHIPPED_LIVE Red Hat Network Satellite bug fix update 2010-11-18 03:27:31 EST

  None (edit)
Description Xixi 2010-05-11 15:47:49 EDT
Description of problem:
Running mergeErrata API will associate errata but with 2 issues:
1. no packages are copied/added
2. it does not clone the errata, just associate the original errata, this means it will add non-custom errata to a custom channel, which we've never allowed anywhere

Version-Release number of selected component (if applicable):
Red Hat Network (RHN) Satellite 5.3.0

How reproducible:
Always.

Steps to Reproduce:
1. create a clone of the Red Hat Enterprise Linux Desktop (v. 5 for 32-bit x86) channel (chosen arbitrarily) - original state (no errata)
2. run mergeErrata for the cloned channel from original channel

Actual results:
The original errata from original channel are added to the cloned channel, instead of clones of the errata.
No packages for the errata were added to the cloned channel.

Expected results:
Errata are cloned, and pkgs are added.

Additional info:
Confirmed bug w/ Justin.
Comment 2 Tomas Lestach 2010-06-08 08:07:54 EDT
Point 2 is correct. The fix is available in
spacewalk.git: 5c14ba73da7e5f19bdc73092bbfa51f632cb536a

Regarding point 1, I'd say the behavior is correct. For adding packages there's another api call: channel.software.mergePackages.
Comment 3 Tomas Lestach 2010-06-08 11:11:32 EDT
Please, ignore my previous comment regarding point 1.

It makes sense to associate packages, when merging errata.
spacewalk.git: ee10f6731672b225976fdb70a5123f40f6d8cf89
Comment 5 Tomas Lestach 2010-06-30 04:18:44 EDT
Fix also for mergeErrata with given start and end date
spacewalk.git: bc0f1dfe1ca5c7c9910e8c44a2711570f90bb6ae
Comment 6 Stephan Dühr 2010-07-09 11:27:24 EDT
Just wanted to mention that mergeErrata (without given start and end date) in Satellite 5.3 with all updates installed is still broken. The following is logged in /var/log/tomcat5/catalina.out:

2010-07-09 16:40:44,308 [TP-Processor2] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 1, SQLState: 23000
2010-07-09 16:40:44,308 [TP-Processor2] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00001: unique constraint (RHNSAT.RHN_CE_CE_UQ) violated

2010-07-09 16:40:44,308 [TP-Processor2] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not insert collection rows: [com.redhat.rhn.domain.channel.Channel.erratas#596]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
...

via XMLRPC you just get a "500 Internal Server Error"

When cloning a channel using API call channel.software.clone with original_state=False, the Errata are linked/associated (same errata id), so mergeErrata should do the same. As a workaround, it works to determine the latest update_date of source and target channel and then use mergeErrata with start and end date (each +1), which works fine.

Anyway, mergeErrata should work as fine as mergePackages.

And yes, the other problem is that when cloning via Webinterface, all Errata are cloned (CLA-nnnn:nnnn), see also #568962. When using mergeErrata on such a channel, you get all the original errata, too, so that it would be necesary to use the errata.clone API call on each missing erratum.
Comment 7 Tomas Lestach 2010-07-12 03:58:58 EDT
Hey Stephan,
you're right. The bug is fixed in the upstream and wasn't released as an erratum for sat530 yet (MODIFIED state).
However the traceback you're getting looks like another problem than this BZ.  If you're able to reproduce it, please file another BZ.
Comment 8 Stephan Dühr 2010-07-12 15:35:42 EDT
Yes, it's reproducable.
https://bugzilla.redhat.com/show_bug.cgi?id=613773
Comment 10 Justin Sherrill 2010-07-22 15:48:58 EDT
Note if a customer requests a hotfix for this bug, available packages are found here:


RHEL4:
https://brewweb.devel.redhat.com/buildinfo?buildID=137465


RHEL5:
https://brewweb.devel.redhat.com/buildinfo?buildID=137464
Comment 20 Šimon Lukašík 2010-09-08 09:01:07 EDT
Created attachment 445978 [details]
catalina.out

This is the traceback I get, while deleting the cloned channel.
Comment 22 Tomas Lestach 2010-09-09 07:39:26 EDT
The behavior is expected. Because we really clone the errata now, the merge process takes much longer than just the original assigning of errata to another channel.
For channels with bigger amount of errata the process takes longer than the tomcat timeout, so we were forced just to trigger the merge process within the api call and to continue with the process after the api call is finished.
This is the reason, why the cloned errata are not visible right after the api call is finished. The errata get visible after the whole merge process is finished.
Comment 23 Šimon Lukašík 2010-09-09 08:06:01 EDT
Thanks Tomas for clarification.

Changing to VERIFIED:

Testing procedure:
Merging errata between multiple channels. 

Verified against:
spacewalk-java*-0.5.44-9
Comment 29 Clifford Perry 2010-10-12 10:31:51 EDT
Approving bug 642287 - this bug needs to be re-QA'd once bug 642287 is ON_QA.
Comment 31 Šimon Lukašík 2010-11-08 02:38:40 EST
Retested on sat530 and Sat540. And behaviour is the same.
Comment 33 Stephan Dühr 2010-11-17 12:11:26 EST
I just want to add a comment regarding #1 2.: client.channel.software.clone() does link orginal errata, that's where you already allow ist. mergeErrata should behave consistently. If mergeErrata would change in this way, some API scripts used by customer would probably break. I would not consider channels cloned from RH Channels as "custom". They are often used for staging purposes without any custom content.
Comment 34 errata-xmlrpc 2010-11-18 03:28:50 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0897.html

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