Bug 1470804 - Error product references content which does not exist after importing manifest
Error product references content which does not exist after importing manifest
Status: VERIFIED
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Candlepin (Show other bugs)
6.3.0
Unspecified Unspecified
high Severity high (vote)
: GA
: --
Assigned To: Chris Rog
Patrik Segedy
: Triaged
Depends On: 1471787
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-13 13:35 EDT by Justin Sherrill
Modified: 2017-09-29 11:57 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1471787 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Justin Sherrill 2017-07-13 13:35:09 EDT
Description of problem:

When importing a manifest, deleting it, importing a 2nd (possibly older manifest), deleting it, and then attempting to import the 1st manifest again, I get an error:

Error importing manifest. Runtime Error product references content which does not exist: ContentData [id: 4051, name: Red Hat Enterprise Linux 7 for IBM Power LE - Supplementary (Debug RPMs), label: rhel-7-for-power-le-supplementary-debug-rpms] at org.candlepin.controller.ProductManager.applyProductChanges:675


Version-Release number of selected component (if applicable):
candlepin-2.0.25-1.el7.noarch  (noticed upstream)

How reproducible:
always

Steps to Reproduce:
1. Import the manifest "one.zip" 
2. Delete the manifest "one.zip" from the owner/organization
3. Import the manifest "two.zip" to the same owner
4. Delete the manifest "two.zip" from the owner
5. Attempt to import "One.zip" again

Actual results:
Error importing manifest. Runtime Error product references content which does not exist: ContentData [id: 4051, name: Red Hat Enterprise Linux 7 for IBM Power LE - Supplementary (Debug RPMs), label: rhel-7-for-power-le-supplementary-debug-rpms] at org.candlepin.controller.ProductManager.applyProductChanges:675

Expected results:
Should import fine.

Additional info:

I'm not sure of the full implications of this, but it seems to basically break that owner for me.
Comment 3 Justin Sherrill 2017-07-13 13:39:40 EDT
traceback

2017-07-13 13:28:33,337 [thread=http-bio-8443-exec-1] [req=c84f694c-9098-4046-94c8-0f852c236765, org=testorg1] ERROR org.candlepin.common.exceptions.mappe
rs.CandlepinExceptionMapper - Runtime Error product references content which does not exist: ContentData [id: 4051, name: Red Hat Enterprise Linux 7 for I
BM Power LE - Supplementary (Debug RPMs), label: rhel-7-for-power-le-supplementary-debug-rpms] at org.candlepin.controller.ProductManager.applyProductChan
ges:675
java.lang.IllegalStateException: product references content which does not exist: ContentData [id: 4051, name: Red Hat Enterprise Linux 7 for IBM Power LE
 - Supplementary (Debug RPMs), label: rhel-7-for-power-le-supplementary-debug-rpms]
        at org.candlepin.controller.ProductManager.applyProductChanges(ProductManager.java:675) ~[ProductManager.class:na]
        at org.candlepin.controller.ProductManager.importProducts(ProductManager.java:311) ~[ProductManager.class:na]
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58) ~[guice-persist-3.0.jar:na]
        at org.candlepin.controller.ContentManager.importContent(ContentManager.java:493) ~[ContentManager.class:na]
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58) ~[guice-persist-3.0.jar:na]
        at org.candlepin.controller.CandlepinPoolManager.refreshPoolsWithRegeneration(CandlepinPoolManager.java:309) ~[CandlepinPoolManager.class:na]
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58) ~[guice-persist-3.0.jar:na]
        at org.candlepin.controller.Refresher.run(Refresher.java:155) ~[Refresher.class:na]
        at org.candlepin.sync.Importer.importObjects(Importer.java:578) ~[Importer.class:na]
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) ~[guice-persist-3.0.jar:na]
        at org.candlepin.sync.Importer.doExport(Importer.java:415) ~[Importer.class:na]
        at org.candlepin.sync.Importer.loadExport(Importer.java:174) ~[Importer.class:na]
        at org.candlepin.controller.ManifestManager.importManifest(ManifestManager.java:172) ~[ManifestManager.class:na]
        at org.candlepin.resource.OwnerResource.importManifest(OwnerResource.java:1275) ~[OwnerResource.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) ~[resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296) ~[resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) ~[resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237) ~[resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) [resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.10.Final.
jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.10.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.10.Final.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [tomcat-servlet-3.0-api.jar:na]
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) [guice-servlet-3.0.jar:na]
Comment 4 Alex Wood 2017-07-14 15:35:24 EDT
This is actually a regression.  With git-bisect I tracked this issue down to commit 190bd341c6c76f518f07429ec3e7f2879a49e354
Comment 5 Chris Rog 2017-07-17 13:57:14 EDT
This bug appears to have been addressed in 2.0.26+ and 2.1+. If the problem persists in these versions, please reopen this BZ.


commit ef6db0ac239a40ed8436a04ff3065e4faa40bf3a
Author: Chris Rog <crog@redhat.com>
Date:   Tue Feb 14 15:32:00 2017 -0500

    Fixed an issue with ContentCurator.getContentByProducts not fetching data
    
    - Worked around an issue in ContentCurator where the getContentByProducts
      method would always return an empty collection
Comment 7 Patrik Segedy 2017-09-29 11:57:02 EDT
Verified on Sat 6.3 snap with candlepin-2.0.40-1.el7.noarch using reproducer from comment 0 using attached manifests.

Steps:
1. hammer --username admin --password pass subscription upload --organization-label Default_Organization --file one.zip
2. hammer --username admin --password pass subscription delete-manifest --organization-label Default_Organization
3. hammer --username admin --password pass subscription upload --organization-label Default_Organization --file two.zip
4. hammer --username admin --password pass subscription delete-manifest --organization-label Default_Organization
5. Upload first manifest again: 
hammer --username admin --password pass subscription upload --organization-label Default_Organization --file one.zip
6. Manifest was imported with no traceback

VERIFIED

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