Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1788652 - virt-who hypervisor update jobs are failing with a duplicate entry for key cp_consumer_hypervisor_ukey
Summary: virt-who hypervisor update jobs are failing with a duplicate entry for key cp...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.5.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On: 1788671 1788672
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-07 17:17 UTC by Danny Synk
Modified: 2023-09-07 21:23 UTC (History)
11 users (show)

Fixed In Version: candlepin-2.5.20-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1791504 (view as bug list)
Environment:
Last Closed: 2020-10-29 21:03:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1766345 0 high CLOSED hypervisor checkin fails with cp_consumer_hypervisor_ukey error 2023-09-07 20:53:16 UTC

Description Danny Synk 2020-01-07 17:17:31 UTC
Description of problem:

A customer's Satellite is encountering an issue with processing virt-who reports that appears to be cause by the issue in bug 1766345. Hypervisor update jobs are failing with a duplicate entry for key cp_consumer_hypervisor_ukey. 

The customer is requesting a backport of the fix to Satellite 6.5.

Here is an example of the error and traceback from /var/log/candlepin/candlepin.log:

2019-10-31 03:51:47,190 [thread=QuartzScheduler_Worker-12] [job=hypervisor_update_xxxxxxxxxxxxxxxxxxxxx-4d1138d53ebf, org=xxxx, csid=] ERROR org.candlepin.pinsetter.core.PinsetterJobListener - Job [hypervisor_update_xxxxxxxxxxxxxxxxxxxxx-4d1138d53ebf] failed.
org.quartz.JobExecutionException: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.candlepin.pinsetter.tasks.HypervisorUpdateJob.toExecute(HypervisorUpdateJob.java:364)
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70)
        at org.candlepin.pinsetter.tasks.KingpinJob.execute(KingpinJob.java:115)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
        at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1460)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1440)
        at org.candlepin.model.AbstractHibernateCurator.flush(AbstractHibernateCurator.java:569)
        at org.candlepin.pinsetter.tasks.HypervisorUpdateJob.toExecute(HypervisorUpdateJob.java:356)
        ... 4 common frames omitted
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3356)
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3229)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3630)
        at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:146)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:478)
        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:356)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
        at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1454)
        ... 7 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "cp_consumer_hypervisor_ukey"
  Detail: Key (hypervisor_id, owner_id)=(host.example.com, xxxxxxxxxxxxxxxxxxxxxx) already exists.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
        at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
        ... 16 common frames omitted


Version-Release number of selected component (if applicable):

satellite-6.5.2.1-1.el7sat.noarch
candlepin-2.5.17-1.el7sat.noarch
virt-who-0.24.7-1.el7.noarch

Comment 9 Mike McCune 2020-10-29 21:03:52 UTC
6.5 is EOL, closing


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