Article - CS334229

"Wrapped by: java.net.SocketTimeoutException: timeout" is seen when attempting to create, update or utilize an InfluxDB Persistence Provider in ThingWorx Platform

Modified: 29-Feb-2024   


Applies To

  • ThingWorx Platform 8.5 to 9.5
  • InfluxDB

Description

  • Data export of Value Stream data from InfluxDB does not work
  • Value Stream with several million rows fails to export from InfluxDB
  • Some or all operations being performed against a remote Influx Persistence Provider are timing out
  • How to adjust the InfluxDB timeout of an Influx Persistence Provider
  • Can the timeout for an Influx Persistence Provider be set?
  • Trying to perform an operation against an InfluxDB but constantly getting a timeout error
  • Timeout errors from the InfluxDB render ThingWorx Platform unusable
  • Property updates are not being written to Influx successfully for some Persistence Providers
  • Persistence Providers based on Influx2PersistenceProviderPackage are not working as expected when set on a Value Stream
  • InfluxPersistenceProviderPackage does not provide anyway to configure the timeout of reads or writes
  • Issue with changing the Persistence Provider from ThingworxPersistenceProvider to InfluxPersistenceProvider
  • Unable to export large Value Stream from InfluxDB with error:
com.thingworx.common.exceptions.DataAccessException in ThingWorx
  • Seeing the following when attempting to save an Influx2PersistenceProviderPackage in ThingWorx Platform:
Unable to update PersistenceProvider: Unable to connect to the PersistenceProvider: <Influxv2 Persistence Provider Name>
image.png
  • <ThingworxStorage>\logs\ApplicationLog.log shows one of the following when updating a Value Stream backed by the Influx Persistence Provider:
Error exporting entries in: ValueStream <Value Stream>: com.thingworx.common.exceptions.DataAccessException: [2,000] Error occurred while accessing the data provider.
Unable to delete entry for id:<ID> update due to [2,000] Error occurred while accessing the data provider.
  • <ThingworxStorage>\logs\ErrorLog.log shows the following with Error Stack Tracing enabled
    • InfluxPersistenceProviderPackage
...
Wrapped by: org.influxdb.InfluxDBIOException: java.net.SocketTimeoutException: Read timed out
...
[message: [2,000] Error occurred while accessing the data provider.] java.net.SocketException: Socket closed
    at java.net.SocketInputStream.read(SocketInputStream.java:204)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at okio.Okio$2.read(Okio.java:140)
    ...
Wrapped by: java.net.SocketTimeoutException: timeout
    at okio.Okio$4.newTimeoutException(Okio.java:232)
    at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
    at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
    ...
Wrapped by: org.influxdb.InfluxDBIOException: java.net.SocketTimeoutException: timeout
    at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:812)
    at org.influxdb.impl.InfluxDBImpl.executeQuery(InfluxDBImpl.java:795)
    at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:552)
    ...
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.InfluxStreamDao.delete(InfluxStreamDao.java:389)
    at com.thingworx.persistence.influx.dao.InfluxStreamDao.deleteEntryIfUpdateRequired(InfluxStreamDao.java:465)
    ...
  • Influx2PersistenceProviderPackage
[L: ERROR] [O: E.c.t.p.i.Influxdb2DataExceptionTranslator] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-8080-exec-5] Read timed out 
[L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-8080-exec-5] [2,006] Unknown error occurred. Contact the administrator if this re-occurs. java.net.SocketTimeoutException: Read timed out
	at java.base/java.net.SocketInputStream.socketRead0(Native Method)
	at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
	...
Wrapped by: com.influxdb.exceptions.InfluxException: Read timed out
	at com.influxdb.internal.AbstractQueryApi.lambda$static$1(AbstractQueryApi.java:88)
	at com.influxdb.internal.AbstractRestClient.catchOrPropagateException(AbstractRestClient.java:142)
	at com.influxdb.internal.AbstractQueryApi.query(AbstractQueryApi.java:240)
	...
Wrapped by: com.thingworx.common.exceptions.DataAccessException: [2,006] Unknown error occurred. Contact the administrator if this re-occurs.
	at com.thingworx.persistence.influxdb2.Influxdb2DataExceptionTranslator.rethrowTranslated(Influxdb2DataExceptionTranslator.java:34)
	at com.thingworx.persistence.influxdb2.Influxdb2Datasource.checkInfluxdbConnection(Influxdb2Datasource.java:375)
	at com.thingworx.persistence.influxdb2.Influxdb2Datasource.testConnectivity(Influxdb2Datasource.java:177)
	...

[L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-8080-exec-5] *** Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name> ***. 
[L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-8080-exec-5] Unable to process import: Unable to update PersistenceProvider: Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name> 
[L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-8080-exec-5] Import Failed: Unable to update PersistenceProvider: Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name> java.lang.Exception: Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name>
	at com.thingworx.persistence.provider.PersistenceProviderManager.handleUpdateEntity(PersistenceProviderManager.java:297)
	... 55 common frames omitted
Wrapped by: java.lang.Exception: Unable to update PersistenceProvider: Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name>
	at com.thingworx.persistence.provider.PersistenceProviderManager.handleUpdateEntity(PersistenceProviderManager.java:300)
	at com.thingworx.system.managers.BaseManager.updateEntity(BaseManager.java:772)
	at com.thingworx.system.managers.BaseManager.updateEntity(BaseManager.java:666)
	...
Wrapped by: java.lang.Exception: Import Failed: Unable to update PersistenceProvider: Unable to connect to the PersistenceProvider: <Influx2 Persistence Provider Name>
	at com.thingworx.contentmanagement.ImportProcessorWorker.run(ImportProcessorWorker.java:373)
	at com.thingworx.contentmanagement.ImportProcessor.processImport(ImportProcessor.java:80)
	at com.thingworx.webservices.BaseService.handleUpdate(BaseService.java:1053)
	...
This is a printer-friendly version of Article 334229 and may be out of date. For the latest version click CS334229