Insert/Update OspfElement: null value in column "ospfrouteridifindex" violates not-null constrain

Description

Exception in thread "EnhancedLinkd-Thread-5-of-5" org.springframework.dao.DataIntegrityViolationException: could not update: [org.opennms.netmgt.model.OspfElement#526638]; SQL [update ospfElement set nodeId=?, ospfASBdrRtrStatus=?, ospfAdminStat=?, ospfBdrRtrStatus=?, ospfNodeCreateTime=?, ospfNodeLastPollTime=?, ospfRouterId=?, ospfRouterIdIfindex=?, ospfRouterIdNetmask=?, ospfVersionNumber=? where id=?]; constraint [ospfrouteridifindex]; nested exception is org.hibernate.exception.ConstraintViolationException: could not update: [org.opennms.netmgt.model.OspfElement#526638]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:659)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:414)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:416)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:379)
at org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:938)
at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.flush(AbstractDaoHibernate.java:94)
at org.opennms.netmgt.enlinkd.EnhancedLinkdServiceImpl.store(EnhancedLinkdServiceImpl.java:496)
at org.opennms.netmgt.enlinkd.EnhancedLinkdServiceImpl$$FastClassBySpringCGLIB$$fe4d2451.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at org.opennms.netmgt.enlinkd.EnhancedLinkdServiceImpl$$EnhancerBySpringCGLIB$$bdb44706.store(<generated>)
at org.opennms.netmgt.enlinkd.NodeDiscoveryOspf.runCollection(NodeDiscoveryOspf.java:119)
at org.opennms.netmgt.enlinkd.NodeDiscovery.run(NodeDiscovery.java:112)
at org.opennms.netmgt.enlinkd.scheduler.Scheduler$1.run(Scheduler.java:187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:124)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.ConstraintViolationException: could not update: [org.opennms.netmgt.model.OspfElement#526638]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2613)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2495)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2822)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:113)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.springframework.orm.hibernate3.HibernateTemplate$27.doInHibernate(HibernateTemplate.java:941)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
... 21 more
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "ospfrouteridifindex" violates not-null constraint
Detail: Failing row contains (526638, 2228, 10.21.0.108, 1, 2, 2, 1, 255.255.255.255, null, 2016-05-18 13:21:16.617+02, 2017-05-25 08:30:53.995+02).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:171)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:138)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2591)

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Antonio Russo May 29, 2017 at 3:42 AM

commit ba0ed6a861d6d9ff52e0e5a2671e94cb0ab2e1a5
Merge: aed2521 fd38ee9
Author: Antonio Russo <rssntn67@yahoo.it>
Date: Mon May 29 09:39:20 2017 +0200

Merge pull request #1508 from OpenNMS/jira/https://opennms.atlassian.net/browse/NMS-9374#icft=NMS-9374

https://opennms.atlassian.net/browse/NMS-9374#icft=NMS-9374 Fixed Insert/Update OspfElement

Antonio Russo May 26, 2017 at 3:27 PM

Antonio Russo May 26, 2017 at 6:35 AM

Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "ospfrouteridifindex" violates not-null constraint
Detail: Failing row contains (789997, 7113, 172.17.15.253, 1, 2, 2, 1, 255.255.255.255, null, 2017-05-19 12:39:15.38+02, 2017-05-19 12:39:15.38+02).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:171)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:138)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2435)
... 31 more

Antonio Russo May 26, 2017 at 6:33 AM

Exception in thread "EnhancedLinkd-Thread-3-of-5" org.springframework.dao.DataIntegrityViolationException: could not insert: [org.opennms.netmgt.model.OspfElement]; SQL [insert into ospfElement (nodeId, ospfASBdrRtrStatus, ospfAdminStat, ospfBdrRtrStatus, ospfNodeCreateTime, ospfNodeLastPollTime, ospfRouterId, ospfRouterIdIfindex, ospfRouterIdNetmask, ospfVersionNumber, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [ospfrouteridifindex]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [org.opennms.netmgt.model.OspfElement]

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

PagerDuty

Created May 26, 2017 at 6:27 AM
Updated June 8, 2017 at 10:22 AM
Resolved May 29, 2017 at 3:42 AM

Flag notifications