When repeatedly importing manifests sometimes a foreign key constraint error occurs. Please see the downstream bug for the log files. The relevant entries in the foreman debug are: at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:996) ~[hibernate-entitymanager-4.2.5.Final-redhat-1.jar:4.2.5.Final-redhat-1] at org.candlepin.model.AbstractHibernateCurator.flush(AbstractHibernateCurator.java:364) ~[AbstractHibernateCurator.class:na] at org.candlepin.model.AbstractHibernateCurator.save(AbstractHibernateCurator.java:359) ~[AbstractHibernateCurator.class:na] at org.candlepin.model.AbstractHibernateCurator.create(AbstractHibernateCurator.java:112) ~[AbstractHibernateCurator.class:na] at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58) ~[guice-persist-3.0-redhat-1.jar:3.0-redhat-1] and Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "cp_subscription" violates foreign key constraint "fk_sub_branding_sub_id" on table "cp_sub_branding" Detail: Key (id)=(8aa2a3e44ba4ec4e014ba4f83d320058) is still referenced from table "cp_sub_branding".
This is likely a timing issue on manifest delete & import. Someone needs to go though the manifest import & delete code to validate why this is happening and figure out the path to prevent it.
*** Bug 1338951 has been marked as a duplicate of this bug. ***