On Red Hat Satellite 6, Manifest refresh fails with error "Failed to import archive.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.3, 6.4, 6.5

Issue

  • Manifest refresh fails with error "Failed to import archive".
  • Manifest refresh fails with the following error.
rg.quartz.JobExecutionException: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.candlepin.model.Entitlement#b513240a06144eecb05af38a9a3fc6f1]
        at org.candlepin.pinsetter.tasks.KingpinJob.refireCheck(KingpinJob.java:143) ~[KingpinJob.class:na]
        at org.candlepin.pinsetter.tasks.KingpinJob.execute(KingpinJob.java:111) ~[KingpinJob.class:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.2.1.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]
Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.candlepin.model.Entitlement#b513240a06144eecb05af38a9a3fc6f1]
  • The error might also be:
2020-02-13 10:04:05,200 [thread=http-bio-8443-exec-44] [req=4d99e793-243a-4f5d-825d-beb94cfe9e1d, org=UBIS-Linux, csid=9072ec81] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: deadlock detected
  Detail: Process 4147 waits for ShareLock on transaction 3084380529; blocked by process 18285.
Process 18285 waits for ShareLock on transaction 3084379745; blocked by process 4147.
  Hint: See server log for query details.
2020-02-13 10:04:05,205 [thread=http-bio-8443-exec-44] [req=4d99e793-243a-4f5d-825d-beb94cfe9e1d, org=UBIS-Linux, csid=9072ec81] ERROR org.candlepin.sync.Importer - Failed to import archive

Resolution

For more KB articles/solutions related to Red Hat Satellite 6.x Manifest Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Manifest Issues

Diagnostic Steps

  • Below logs captured in /var/log/candlepin/error.log
rg.quartz.JobExecutionException: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.candlepin.model.Entitlement#b513240a06144eecb05af38a9a3fc6f1]
        at org.candlepin.pinsetter.tasks.KingpinJob.refireCheck(KingpinJob.java:143) ~[KingpinJob.class:na]
        at org.candlepin.pinsetter.tasks.KingpinJob.execute(KingpinJob.java:111) ~[KingpinJob.class:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.2.1.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]
Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [org.candlepin.model.Entitlement#b513240a06144eecb05af38a9a3fc6f1]
  • In another scenario /var/log/candlepin/error.log will show:
2020-02-13 10:04:05,200 [thread=http-bio-8443-exec-44] [req=4d99e793-243a-4f5d-825d-beb94cfe9e1d, org=UBIS-Linux, csid=9072ec81] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: deadlock detected
  Detail: Process 4147 waits for ShareLock on transaction 3084380529; blocked by process 18285.
Process 18285 waits for ShareLock on transaction 3084379745; blocked by process 4147.
  Hint: See server log for query details.
2020-02-13 10:04:05,205 [thread=http-bio-8443-exec-44] [req=4d99e793-243a-4f5d-825d-beb94cfe9e1d, org=UBIS-Linux, csid=9072ec81] ERROR org.candlepin.sync.Importer - Failed to import archive
  • Check if there are any pool id present with null pointer to subscription.
foreman-rake console
# Re-Import the subscriptions from manifest first
User.current = User.first 
Katello::Subscription.import_all 
Katello::Pool.import_all 
# Check if there are any poll with no subscription associated.
Katello::Pool.where(:subscription => nil)
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.