Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.influxdb.exceptions.InfluxException: For input string: "",when reciving error from influxdb #171

Closed
lonelyleaf opened this issue Nov 9, 2020 · 3 comments · Fixed by #173
Milestone

Comments

@lonelyleaf
Copy link
Contributor

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

send a requets like

from(bucket:"waterstrategy")
	|> range(start:2020-11-08T09:46:48.705000000Z, stop:2020-11-09T01:43:38.928000000Z)
	|> filter(fn: (r) => r["_measurement"] == "c_00000005_C2_B1_UB")
	|> aggregateWindow(every:60s, fn:mean)
	|> map(fn: (r) => ({r with
_measurement: "p_8a8d80b675a703110175a70445490038",processorId: "8a8d80b675a703110175a70445490038"}))
	|> to(bucket:"waterstrategy")

when revicing error,the client throws exception below:

com.influxdb.exceptions.InfluxException: For input string: ""
	at com.influxdb.internal.AbstractQueryApi.lambda$static$1(AbstractQueryApi.java:72) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractRestClient.catchOrPropagateException(AbstractRestClient.java:142) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractQueryApi$1.onResponse(AbstractQueryApi.java:170) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractQueryApi.query(AbstractQueryApi.java:193) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractQueryApi.query(AbstractQueryApi.java:104) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:803) ~[influxdb-client-java-1.12.0.jar:1.12.0]
	at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:105) ~[influxdb-client-java-1.12.0.jar:1.12.0]
	at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:83) ~[influxdb-client-java-1.12.0.jar:1.12.0]
	at cn.waterstrategy.timeserial.InfluxdbTimeserialDataManager.fluxProcessTo(InfluxdbTimeserialDataManager.java:281) ~[main/:na]
	at cn.waterstrategy.processor.MetricProcessor.lambda$doProcess$1(MetricProcessor.java:63) ~[main/:na]
	at cn.waterstrategy.service.MetricProcessorService.execProcessor(MetricProcessorService.java:196) ~[main/:na]
	at cn.waterstrategy.service.MetricProcessorService$$FastClassBySpringCGLIB$$19db3893.invoke(<generated>) ~[main/:na]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.2.8.RELEASE.jar:5.2.8.RELEASE]
	at cn.waterstrategy.service.MetricProcessorService$$EnhancerBySpringCGLIB$$13429916.execProcessor(<generated>) ~[main/:na]
	at cn.waterstrategy.processor.MetricProcessor.lambda$doProcess$2(MetricProcessor.java:59) ~[main/:na]
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313) ~[vertx-core-3.9.4.jar:3.9.4]
	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) ~[vertx-core-3.9.4.jar:3.9.4]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.51.Final.jar:4.1.51.Final]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:662) ~[na:na]
	at java.base/java.lang.Integer.parseInt(Integer.java:770) ~[na:na]
	at com.influxdb.query.internal.FluxCsvParser.parseFluxResponse(FluxCsvParser.java:194) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractQueryApi.lambda$query$2(AbstractQueryApi.java:98) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	at com.influxdb.internal.AbstractQueryApi$1.onResponse(AbstractQueryApi.java:162) ~[influxdb-client-core-1.12.0.jar:1.12.0]
	... 26 common frames omitted

it seems the client dose‘t pasre the response properly,when it contain error
influx-client

FluxColumn[index=0, label='error', dataType='string', group=true, defaultValue='']

CSVRecord [comment='null', recordNumber=967, values=[, engine: unknown field type for value: p_8a8d80b675a703110175a70445490038,cid=SN2_23002_160215_00019_DC1,name=C2_B1_UB,processorId=8a8d80b675a703110175a70445490038 value= 1604883900000000000, ]]

Specifications:

  • Client Version: 1.13.0
  • InfluxDB Version: 2.0-rc
  • JDK Version: 11
  • Platform: linux
@bednar
Copy link
Contributor

bednar commented Nov 9, 2020

Hi @lonelyleaf,

thanks for issue. Could you share a response from server? You could set a detail logging via:

client.setLogLevel(LogLevel.BODY);

Regards

@lonelyleaf
Copy link
Contributor Author

@bednar

2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : <-- 200 OK http://XXXXXXX/api/v2/query?org=waterstrategy (29ms)
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : Content-Type: text/csv; charset=utf-8
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : Vary: Accept-Encoding
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : Date: Mon, 09 Nov 2020 08:07:04 GMT
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : Transfer-Encoding: chunked
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : 
2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : #datatype,string,long,string,string,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string
#group,false,false,true,true,true,true,false,false,true,true,false
#default,to8,,,,,,,,,,
,result,table,_field,_measurement,_start,_stop,_time,_value,cid,name,processorId
,,0,value,p_8a8d80b675ab14a60175ab18df020000,2020-11-09T08:06:16.544Z,2020-11-09T08:07:06.25Z,2020-11-09T08:07:00Z,8.558,SN2_23002_160215_00019_DC1,C1_B1_IA,8a8d80b675ab14a60175ab18df020000
,,0,value,p_8a8d80b675ab14a60175ab18df020000,2020-11-09T08:06:16.544Z,2020-11-09T08:07:06.25Z,2020-11-09T08:07:06.25Z,,SN2_23002_160215_00019_DC1,C1_B1_IA,8a8d80b675ab14a60175ab18df020000

#datatype,string,string
#group,true,true
#default,,
,error,reference
,"engine: unknown field type for value: p_8a8d80b675ab14a60175ab18df020000,cid=SN2_23002_160215_00019_DC1,name=C1_B1_IA,processorId=8a8d80b675ab14a60175ab18df020000 value= 1604909226250000000",

2020-11-09 16:07:06.280  INFO 10572 --- [orker-thread-18] okhttp3.OkHttpClient                     : <-- END HTTP (940-byte body)

@bednar
Copy link
Contributor

bednar commented Nov 9, 2020

@lonelyleaf thanks

The fixed version is prepared in #173

@bednar bednar added this to the 1.14.0 milestone Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants