Skip to content

MessagePack queries: Exception during parsing InfluxDB version [macOS] #485

@bednar

Description

@bednar

Hi @lxhoan,

I want to try the MessagePack queries at macOS but there is a bug in parsing InfluxDB version. On the macOS the version of InfluxDB is in a format v1.6.0 so parsing of the version fails.

The InfluxDB was installed by brew.

I also created a simple test so you can reproduce it.

The InfluxDB ping response on macOS

HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: ab0cd803-9ee2-11e8-8d8b-000000000000
X-Influxdb-Build: OSS
X-Influxdb-Version: v1.6.0
X-Request-Id: ab0cd803-9ee2-11e8-8d8b-000000000000
Date: Mon, 13 Aug 2018 10:21:40 GMT

The Exception

java.lang.NumberFormatException: For input string: "v1"

	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at org.influxdb.impl.InfluxDBImpl.executeQuery(InfluxDBImpl.java:672)
	at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:507)
	at org.influxdb.MessagePackInfluxDBTest.parsingVersionV1_6_0(MessagePackInfluxDBTest.java:201)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:513)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
	at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:113)
	at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions