-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: Datum Export, SolarUser
-
None
Got another DataIntegrityViolationException in production that seems like a bug:
[2022-04-19 23:32:00.261] ERROR [http-nio-9081-exec-4706 ] .c.w.s.WebServiceGlobalControllerSupport RuntimeException in request uri=/solaruser/u/sec/export/configs?; user [xxx@xxx] org.springframework.dao.DataIntegrityViolationException: ### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "user_export_datum_conf" violates foreign key constraint "user_export_datum_conf_data_fk" Detail: Key (data_conf_id)=(50) is not present in table "user_export_data_conf". ### The error may exist in URL [jar:file:/workspace/WEB-INF/lib/solarnet-user-datum-1.0.1.jar!/net/solarnetwork/central/user/export/dao/mybatis/map/UserDatumExportConfiguration.xml] ### The error may involve net.solarnetwork.central.user.export.domain.UserDatumExportConfiguration.insert-UserDatumExportConfiguration-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO solaruser.user_export_datum_conf ( id, user_id, cname, delay_mins, schedule, data_conf_id, dest_conf_id, outp_conf_id ,created ,min_export_date ) VALUES ( ?, ?, ?, (? * 60), ?, ?, ?, ? ,? ,? ) ### Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "user_export_datum_conf" violates foreign key constraint "user_export_datum_conf_data_fk" Detail: Key (data_conf_id)=(50) is not present in table "user_export_data_conf". ; ERROR: insert or update on table "user_export_datum_conf" violates foreign key constraint "user_export_datum_conf_data_fk" Detail: Key (data_conf_id)=(50) is not present in table "user_export_data_conf".; nested exception is org.postgresql.util.PSQLException: ERROR: insert or update on table "user_export_datum_conf" violates foreign key constraint "user_export_datum_conf_data_fk" Detail: Key (data_conf_id)=(50) is not present in table "user_export_data_conf". at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:251) ~[spring-jdbc-5.3.16.jar:5.3.16] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.16.jar:5.3.16] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91) ~[mybatis-spring-2.0.6.jar:2.0.6] at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) ~[mybatis-spring-2.0.6.jar:2.0.6] at com.sun.proxy.$Proxy89.insert(Unknown Source) ~[na:na] at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.0.6.jar:2.0.6] at net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao.handleInsert(BaseMyBatisGenericDao.java:358) ~[solarnet-common-1.1.1.jar:1.1.1] at net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao.store(BaseMyBatisGenericDao.java:279) ~[solarnet-common-1.1.1.jar:1.1.1] at net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao$$FastClassBySpringCGLIB$$fcda7f1e.invoke(<generated>) ~[solarnet-common-1.1.1.jar:1.1.1] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.16.jar:5.3.16] at net.solarnetwork.central.user.export.dao.mybatis.MyBatisUserDatumExportConfigurationDao$$EnhancerBySpringCGLIB$$21d7abf3.store(<generated>) ~[solarnet-user-datum-1.0.1.jar:1.0.1] at net.solarnetwork.central.user.export.biz.dao.DaoUserExportBiz.saveDatumExportConfiguration(DaoUserExportBiz.java:217) ~[solarnet-user-datum-1.0.1.jar:1.0.1] at net.solarnetwork.central.user.export.biz.dao.DaoUserExportBiz$$FastClassBySpringCGLIB$$c5e48959.invoke(<generated>) ~[solarnet-user-datum-1.0.1.jar:1.0.1] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.16.jar:5.3.16] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) ~[spring-aop-5.3.16.jar:5.3.16] at net.solarnetwork.central.user.export.biz.dao.DaoUserExportBiz$$EnhancerBySpringCGLIB$$71194bc.saveDatumExportConfiguration(<generated>) ~[solarnet-user-datum-1.0.1.jar:1.0.1] at net.solarnetwork.central.reg.web.api.v1.DatumExportController.saveExportConfiguration(DatumExportController.java:200) ~[classes/:na]
- relates to
-
NET-296 DataIntegrityViolationException thrown in user datum export
-
- Closed
-