ERROR: insert or update on table "notifications" violates foreign key constraint "fk_eventid3"

Description

This was seen at a customer running trunk:

org.postgresql.util.PSQLException: ERROR: insert or update on table "notifications" violates foreign key
constraint "fk_eventid3"
Detail: Key (eventid)=(<event id>) is not present in table "events".
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:
354)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate
(NewProxyPreparedStatement.java:105)
at org.opennms.netmgt.config.NotificationManager.insertNotice(NotificationManager.java:628)
at org.opennms.netmgt.notifd.BroadcastEventProcessor.scheduleNoticesForEvent
(BroadcastEventProcessor.java:496)
at org.opennms.netmgt.notifd.BroadcastEventProcessor.onEvent(BroadcastEventProcessor.java:
216)
at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$ListenerThread.run
(EventIpcManagerDefaultImpl.java:172)
at java.lang.Thread.run(Thread.java:595)

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Benjamin Reed July 30, 2013 at 11:59 AM

Fixed in 1.10 and up

Benjamin Reed July 30, 2013 at 11:56 AM

Turns out this can still happen in the real world, depending on the event. Just duplicated it.

Benjamin Reed December 9, 2008 at 9:52 PM

there's been no response on this, these types of things are handled by stored procedures and hibernate anyways, I'm going to say screw it, and close this =)

Feel free to reopen if there's any info at all on it.

Benjamin Reed October 6, 2008 at 11:52 AM

moving to 1.6.1 target milestone; only things left pending for 1.6.0 are blocker-level bugs

Benjamin Reed October 6, 2008 at 11:44 AM

Any idea on this issue? Is there more data to help debug, or is it long gone?

Fixed

Details

Assignee

Reporter

Fix versions

Priority

PagerDuty

Created September 15, 2006 at 7:07 AM
Updated January 27, 2017 at 4:31 PM
Resolved July 30, 2013 at 11:59 AM

Flag notifications