ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

[Manager.AT] Exception handling event context through reporters and DB exception ERROR: insert or update on table "at_stories" violates foreign key constraint "at_stories_story_id_fkey

book

Article ID: 186364

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

This exception has been observed in APM 10.7 environments


[ERROR] [ReporterExecutor-2] [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)=(749) 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)=(749) 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)=(749) 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)=(749) is not present in table "at_stories_pivot".

        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:243)

        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)

        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655)

        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:876)

        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:900)

        at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:287)

        at com.wily.introscope.appmap.em.model.dao.impl.gmt.GMTNamedParameterJdbcTemplate.update(GMTNamedParameterJdbcTemplate.java:250)

        at com.wily.introscope.appmap.triage.dao.impl.StoriesDaoImpl.createStory(StoriesDaoImpl.java:145)

        at com.wily.introscope.appmap.triage.entity.service.impl.StoryServiceImpl.recordStory(StoryServiceImpl.java:253)

        at com.wily.introscope.appmap.triage.analyst.core.Editor.handleEventContext(Editor.java:289)

        at com.wily.introscope.appmap.triage.analyst.core.Editor$$FastClassBySpringCGLIB$$28f2a185.invoke(<generated>)

        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

        at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

Caused by: 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)=(749) is not present in table "at_stories_pivot".

        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)

        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)

        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)

        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)

        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)

        at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:883)

        at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:876)

        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)

        ... 16 more

Cause

No impact to product has been determined, problems/anomalies are still created/updated.

Environment

Release : 10.7.0

Component : APM Enterprise Manager

Resolution

Suggestion to change logging levels to stop the message being logged in IntroscopeEnterpriseManager.properties, if logging is deemed excessive

log4j.logger.Manager.AT=INFO,console,logfile

to

log4j.logger.Manager.AT=FATAL,console,logfile

Fix will be included in 10.7 SP4