Field 'MortgageId' doesn't have a default value in "Write Record" smart service

Certified Associate Developer

Hello everyone.

I have tihis error message in a "Write Record": Unable to write to the source because the data source did not respond. Error Details: Field 'MortgageId' doesn't have a default value

I understand the problem sems to be that 'MortgageId' has not value and the database is refusing my update, but I don't understand why, because when I open the process and watch the varibles, 'MortgageId' is filled:

Indeed, I have other "Write Record" smart service that is doing something similar and, in that case, all work fine...

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Did you check the log file tomcat-stdout.log for any additional details?

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    It seems that I haven't got access to tomcat directory:

  • 0
    Certified Lead Developer
    in reply to jp-Stemdo

    It's in the base log directory. Not inside the tomcat folder.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Sorry, I am newbie in Appian. I paste you some errors of tomcat-stdOut.log around the hour that my "Write record" failed:

    2023-09-09 13:39:43,297 [pool-79-thread-1] INFO  com.appiancorp.oauth.inbound.authserver.tokens.TokenFamilyMaintenanceRunnable - Starting OAuth Token Family table maintenance...
    2023-09-09 13:39:43,303 [pool-79-thread-1] INFO  com.appiancorp.oauth.inbound.authserver.tokens.TokenFamilyMaintenanceRunnable - Finished OAuth Token Family table maintenance.
    2023-09-09 13:40:48,980 [Appian Timer - 1] WARN  com.appiancorp.common.ObjectSynchronizer - 1 services were missing users.
    2023-09-09 13:42:12,926 [http-nio-8080-exec-787] ERROR com.appiancorp.security.auth.phpmyadmin.PhpMyAdminSessionUtils - Session not cleared, response code: 500
    2023-09-09 13:42:47,870 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:47,870 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,785 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,785 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,785 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,785 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,786 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,786 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,786 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,786 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,787 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,787 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,788 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,788 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,788 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:42:48,788 [Appian Timer - 3] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:43:13,451 [Appian AppianServerThreadPoolProvider 271710] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:43:13,451 [Appian AppianServerThreadPoolProvider 271710] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:43:13,469 [Appian AppianServerThreadPoolProvider 271723] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:43:13,469 [Appian AppianServerThreadPoolProvider 271723] WARN  com.appiancorp.suiteapi.common.GlobalIdMapReturnConverter - Skipping translationSetDesignObject in return conversion of GlobalIdMap
    2023-09-09 13:44:53,398 [http-nio-8080-exec-830] ERROR com.appiancorp.ap2.listings.ListingsServletFilter - Invalid path requested for log listing. Request URI = /suite/shared-logs/gxot-1/tomcat/ Dispatch URI = /shared-logs/gxot-1/tomcat/
    2023-09-09 13:45:20,778 [http-nio-8080-exec-816] ERROR com.appiancorp.ap2.listings.ListingsServletFilter - Invalid path requested for log listing. Request URI = /suite/shared-logs/gxot-1/internal/ Dispatch URI = /shared-logs/gxot-1/internal/
    2023-09-09 13:45:43,290 [http-nio-8080-exec-792] ERROR com.appiancorp.ap2.listings.ListingsServletFilter - Invalid path requested for log listing. Request URI = /suite/shared-logs/gxot-1/tomcat/ Dispatch URI = /shared-logs/gxot-1/tomcat/
    2023-09-09 13:47:45,027 [http-nio-8080-exec-826] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:47:45,028 [http-nio-8080-exec-826] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:47:51,369 [http-nio-8080-exec-812] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:47:51,375 [http-nio-8080-exec-812] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:47:51,378 [http-nio-8080-exec-812] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:47:51,379 [http-nio-8080-exec-812] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 13:48:02,072 [http-nio-8080-exec-830] ERROR com.appiancorp.type.handlers.RecordType2Handler - Failed to find uuid attribute with namespace [Namespace: prefix "a" is mapped to URI "http://www.appian.com/ae/types/2009"] + in the XML element
    2023-09-09 14:00:00,039 [RecordSyncScheduler_Worker-1] INFO  com.appiancorp.record.service.quartz.LoggingTriggerListener - Trigger [group: record_load_group, name: record_synchronize_ads_join_indices] fired for job [group: record_load_group, name: record_synchronize_ads_join_indices]
    2023-09-09 14:00:00,470 [RecordSyncScheduler_Worker-1] INFO  com.appiancorp.record.service.quartz.LoggingTriggerListener - Trigger [group: record_load_group, name: record_synchronize_ads_join_indices] completed for job [group: record_load_group, name: record_synchronize_ads_join_indices]
  • 0
    Certified Associate Developer
    in reply to jp-Stemdo

    I add more information of my last try:

    2023-09-09 14:20:49,245 [Appian Timer - 1] WARN  com.appiancorp.common.ObjectSynchronizer - 1 services were missing users.
    2023-09-09 14:21:31,499 [Appian Work Item - 1221 - WorkID 7 - execution00 - process 216 - model 851 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=2373, classname=com.appiancorp.process.runtime.activities.WriteRecordsActivity
    com.appiancorp.suiteapi.process.framework.ActivityExecutionException: Unable to write to the source because the data source did not respond.
    Error Details: Field 'MortgageId' doesn't have a default value
    	at com.appiancorp.process.runtime.activities.MutateRecordsOnSourceActivityBase.execute(MutateRecordsOnSourceActivityBase.java:132)
    	at com.appiancorp.suiteapi.process.framework.AbstractActivity.perform(AbstractActivity.java:104)
    	at com.appiancorp.process.runtime.framework.LegacyActivityExecutor$2.call(LegacyActivityExecutor.java:90)
    	at com.appiancorp.process.runtime.framework.LegacyActivityExecutor$2.call(LegacyActivityExecutor.java:87)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:24)
    	at com.appiancorp.process.runtime.framework.LegacyActivityExecutor.execute(LegacyActivityExecutor.java:87)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:22)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:129)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:241)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: com.appiancorp.record.data.persist.error.RecordSourceWriteException: com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to write to the source because the data source did not respond.
    Error Details: Field 'MortgageId' doesn't have a default value (APNX-1-4565-000)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.translateToSourceWriteException(RecordWriteServiceImpl.java:177)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.writeRecordsInner(RecordWriteServiceImpl.java:129)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.lambda$writeRecords$0(RecordWriteServiceImpl.java:98)
    	at com.appiancorp.record.data.persist.WriteResult$MutableMetrics.captureTotalDuration(WriteResult.java:161)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.writeRecords(RecordWriteServiceImpl.java:97)
    	at com.appiancorp.record.activity.WriteRecordsVersion3.writeRecords(WriteRecordsVersion3.java:81)
    	at com.appiancorp.process.runtime.activities.WriteRecordsActivity.mutateRecords(WriteRecordsActivity.java:33)
    	at com.appiancorp.process.runtime.activities.MutateRecordsOnSourceActivityBase.execute(MutateRecordsOnSourceActivityBase.java:123)
    	... 18 more
    Caused by: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; (conn=236478) Field 'MortgageId' doesn't have a default value; nested exception is java.sql.SQLTransientConnectionException: (conn=236478) Field 'MortgageId' doesn't have a default value
    	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:251)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
    	at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:991)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.insertWithAutoIncrementedRecordId(RdbmsDataWriter.java:196)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.insert(RdbmsDataWriter.java:133)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.performUpsert(RdbmsDataWriter.java:110)
    	at java.util.ArrayList.forEach(ArrayList.java:1259)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.performUpserts(RdbmsDataWriter.java:274)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.lambda$write$0(RdbmsDataWriter.java:85)
    	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
    	at com.appiancorp.record.sources.systemconnector.rdbms.RdbmsDataWriter.write(RdbmsDataWriter.java:83)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.lambda$writeToSource$2(RecordWriteServiceImpl.java:221)
    	at com.appiancorp.record.data.persist.WriteResult$MutableMetrics.captureWriteToSourceDuration(WriteResult.java:148)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.writeToSource(RecordWriteServiceImpl.java:221)
    	at com.appiancorp.record.service.mutate.RecordWriteServiceImpl.writeRecordsInner(RecordWriteServiceImpl.java:124)
    	... 24 more
    Caused by: java.sql.SQLTransientConnectionException: (conn=236478) Field 'MortgageId' doesn't have a default value
    	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:79)
    	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:158)
    	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:262)
    	at org.mariadb.jdbc.ClientSidePreparedStatement.executeInternal(ClientSidePreparedStatement.java:229)
    	at org.mariadb.jdbc.ClientSidePreparedStatement.execute(ClientSidePreparedStatement.java:149)
    	at org.mariadb.jdbc.ClientSidePreparedStatement.executeUpdate(ClientSidePreparedStatement.java:181)
    	at sun.reflect.GeneratedMethodAccessor501.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118)
    	at com.sun.proxy.$Proxy220.executeUpdate(Unknown Source)
    	at org.springframework.jdbc.core.JdbcTemplate.lambda$update$3(JdbcTemplate.java:992)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651)
    	... 37 more
    Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Field 'MortgageId' doesn't have a default value
    	at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:195)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:178)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:322)
    	at org.mariadb.jdbc.ClientSidePreparedStatement.executeInternal(ClientSidePreparedStatement.java:220)
    	... 46 more
    Caused by: java.sql.SQLException: Field 'MortgageId' doesn't have a default value
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1693)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1555)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1518)
    	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:319)
    	... 47 more
  • 0
    Certified Lead Developer
    in reply to jp-Stemdo

    This is an odd error. Is this in your dev environment?

  • 0
    Certified Lead Developer
    in reply to jp-Stemdo

    I think you should check that the configuration for that field morgageId in the record matches that in the database.

  • 0
    Certified Associate Developer
    in reply to Mathieu Drouin

    Yes, the error is very weird. Finally, I solved it doing something like this:

    Basically, I replicate the behavior of the "Write Record" smart service with the above sequence of smart services.

  • 0
    Certified Lead Developer
    in reply to jp-Stemdo

    That's a bad idea. The internet is full of error message like yours. I highly recommend to fix the root cause instead of working around it.

    mariadb.com/.../

  • Can you share what the structure of your database table looks like? Also can you provide more information about what you have tried? For example, does writing to this record type fail in every scenario or only with certain data?