If an ueber certificate exists for an Owner when a manifest import is undone, the ueber certifcate will be deleted. This will leave the ueber data in a bad state and will break the GET /owners/:owner_key/uebercert API. Steps to Reproduce: 1. Create a new owner. 2. Import a manifest for that owner. 3. Generate an ueber certificate for that owner. curl -k -u admin:admin -X POST https://localhost:8443/candlepin/owners/:owner_key/uebercert 4. Undo the manifest that was imported. curl -k -u admin:admin -X DELETE https://localhost:8443/candlepin/owners/:owner_key/imports 5. Fetch the ueber cert for the owner. curl -k -u admin:admin https://localhost:8443/candlepin/owners/:owner_key/uebercert Actual results: 2017-02-08 13:02:22,308 [thread=http-nio-8443-exec-3] [req=4b76a72e-e753-4952-aefe-b2419fa50e03, org=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/owners/defaultorg/uebercert 2017-02-08 13:02:22,355 [thread=http-nio-8443-exec-3] [req=4b76a72e-e753-4952-aefe-b2419fa50e03, org=defaultorg] ERROR org.candlepin.common.exceptions.mappers.CandlepinExceptionMapper - Runtime Error Index: 0, Size: 0 at java.util.ArrayList.rangeCheck:653 java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[na:1.8.0_111] at java.util.ArrayList.get(ArrayList.java:429) ~[na:1.8.0_111] at org.candlepin.resource.OwnerResource.getUeberCertificate(OwnerResource.java:1440) ~[classes/:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111] Expected results: An appropriate ueber certificate should be returned by the ueber cert API after the manifest is removed.
Candlepin's UndoImportsJob is deleting the Ueber Pools/Entitlements along with the pools that were imported as part of the manifest. The ueber pools should be left alone.