Article - CS333946

Migration or Import of Value Streams from PostgreSQL to InfluxDB fails for certain value streams in ThingWorx Platform

Modified: 22-Oct-2024   


Applies To

  • ThingWorx Platform 8.4 to 9.5
  • PostgreSQL
  • InfluxDB

Description

  • Importing into InfluxDB certain Value Streams data fails with error: 
com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider
  • Migrating Value Streams from PostgreSQL to InfluxDB script is failing with duplicate entries
  • ThingWorx Platform logs located in <ThingworxStorage>\logs show the following:
    • ApplicationLog.log
[L: ERROR] [O: c.t.c.DataImportProcessor] [I: ] [U: <User>] [S: ] [T: Worker-a4253e02-c797-4ecd-863e-4be74ab8c516-1] Task-1605070440176 Import issue with ValueStream <Value Stream>: com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider.
[L: ERROR] [O: c.t.c.DataImportProcessor] [I: ] [U: <User>] [S: ] [T: Worker-a4253e02-c797-4ecd-863e-4be74ab8c516-1] Task-1605070440176 Failed to import file [<ThingworxStorage>/repository/SystemRepository/<Export Date>/ValueStreams/<Value Stream>/data-0.twx] : com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider.
[L: ERROR] [O: c.t.p.c.a.AsyncExecutionHelper] [I: ] [U: <User>] [S: ] [T: Worker-a4253e02-c797-4ecd-863e-4be74ab8c516-1] Task-1605070440176 Import FAILED for entity [<Value Stream>] File:[data-0.twx]. Data imported : [10000 rows]. Path to file [<ThingworxStorage>/repository/SystemRepository/<Export Date>/ValueStreams/<Value Stream>/data-0.twx] Failure Reason : Error: . com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider.. [2,000] Error occurred while accessing the data provider. 
  • ErrorLog.log (with Enable stack tracing checked in the LoggingSubsystem)
[L: ERROR] [O: E.c.t.p.i.InfluxdbDataExceptionTranslator] [I: ] [U: <User>] [S: ] [T: Worker-a4253e02-c797-4ecd-863e-4be74ab8c516-1] [message: [2,000] Error occurred while accessing the data provider.] org.influxdb.InfluxDBException$FieldTypeConflictException: field type conflict
    at org.influxdb.InfluxDBException.buildExceptionFromErrorMessage(InfluxDBException.java:144)
    at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:188)
    at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:806)
	...
Wrapped by: com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider.
    at com.thingworx.persistence.influxdb.InfluxdbDataExceptionTranslator.rethrowTranslated(InfluxdbDataExceptionTranslator.java:30)
    at com.thingworx.persistence.influx.dao.InfluxValueStreamDao.save(InfluxValueStreamDao.java:100)
    at com.thingworx.persistence.influxdb.dataprovider.InfluxValueStreamDataProvider.addEntries(InfluxValueStreamDataProvider.java:150)
    at com.thingworx.persistence.common.ValueStreamEngine.lambda$writeStreamEntries$16(ValueStreamEngine.java:440)
    at com.thingworx.persistence.TransactionFactory.createDataTransaction(TransactionFactory.java:141)
    at com.thingworx.persistence.common.BaseEngine.createTransaction(BaseEngine.java:192)
	...
This is a printer-friendly version of Article 333946 and may be out of date. For the latest version click CS333946