Bug 1314042 - When repeatedly importing a manifest a foreign key constraint sometimes occurs
Summary: When repeatedly importing a manifest a foreign key constraint sometimes occurs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 2.0
Assignee: pjonasti
QA Contact: Katello QA List
URL:
Whiteboard:
: 1338951 (view as bug list)
Depends On:
Blocks: 1194565
TreeView+ depends on / blocked
 
Reported: 2016-03-02 19:20 UTC by Barnaby Court
Modified: 2020-08-13 08:24 UTC (History)
3 users (show)

Fixed In Version: candlepin-2.0.22-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-20 12:23:30 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 1398 0 None None None 2016-11-23 16:26:15 UTC

Description Barnaby Court 2016-03-02 19:20:01 UTC
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".

Comment 1 Barnaby Court 2016-03-03 21:05:13 UTC
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.

Comment 2 Barnaby Court 2017-01-18 18:01:15 UTC
*** Bug 1338951 has been marked as a duplicate of this bug. ***


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