Created attachment 431246 [details]
Script for reproducing the error
Description of problem:
When using the channel.software.mergeErrata() API call on a channel cloned by the API call client.channel.software.clone() with the original_state=False option, a org.hibernate.exception.ConstraintViolationException is logged in /var/log/tomcat5/catalina.out
Version-Release number of selected component (if applicable):
Satellite 5.3.0 all updates installed
Steps to Reproduce:
1. run the attached script, for example
./mergeErrata-test.py rhel-i386-client-5 clone-test-rhel-i386-client-5
The data returned by mergeErrata contains all errata when the channel was recently cloned. But when removing some errata from the target (cloned) channel before calling mergeErrata again, the same result is returned, but the errata do not appear in the target channel. On channels with a higher number of errata like rhel-i386-server-5, I've seen "500 Internal Server Error".
mergeErrata should work like mergePackages, it should add the missing errata to the target channel.
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.
Could you please work with your Red Hat support to investigate the problem? In general, going through the support channel will ensure proper attention and triaging of the issues.