ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey"

book

Article ID: 142775

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

Seeing a large number of errors:

 [ERROR] [ReporterExecutor-20] [Manager.AT] Exception handling event context through reporters: PreparedStatementCallback; SQL [insert into at_stories(story_id, start_time, end_time, fork, latest, statements) values(?, ?, ?, ?, ?, ?)]; ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey" Detail: Key (story_id)=(191497) is not present in table "at_stories_pivot".; nested exception is org.postgresql.util.PSQLException: ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey" Detail: Key (story_id)=(191497) is not present in table "at_stories_pivot". org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into at_stories(story_id, start_time, end_time, fork, latest, statements) values(?, ?, ?, ?, ?, ?)]; ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey" Detail: Key (story_id)=(191497) is not present in table "at_stories_pivot".; nested exception is org.postgresql.util.PSQLException: ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey"

 

 

Cause

Per engineering, A foreign key constraint specifies that the values in a column (or a group of columns) must match the values appearing in some row of another table. 

Engineering has created a fix for the APM PostgreSQL Database to handle this edge case more gracefully.

 

Environment

Release : 10.7.0.211 HF 35

Component : APM 

Resolution

Please open a support case and request the Hot Fix.

Refer the defect number,  DE430016 in the case.