apache / apache/hugegraph-toolchain

Exception in thread "main" org.apache.hugegraph.rest.ClientException: Failed to do request

Open
#515 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
121
Forks
125
Avg merge
10d 10h
Merged PRs (30d)
3

Description

### Bug Type (问题类型)

exception / error (异常报错)

### Before submit

- [X] I had searched in the [issues](https://github.com/apache/hugegraph-toolchain/issues) and found no similar issues.

### Environment (环境信息)

- Server Version: v1.0.0(docker)
- Toolchain Version: v1.0.0

### Expected & Actual behavior (期望与实际表现)

通过client连接报超时异常,直接通过http访问没问题,用hubble访问也没问题
连接代码:
HugeClient hugeClient = HugeClient.builder("http://10.5.31.101:28080",
"hugegraph")
.build();
pom文件:

org.apache.hugegraph
hugegraph-client
1.0.0

报错:
Exception in thread "main" org.apache.hugegraph.rest.ClientException: Failed to do request
at org.apache.hugegraph.rest.AbstractRestClient.request(AbstractRestClient.java:200)
at org.apache.hugegraph.rest.AbstractRestClient.get(AbstractRestClient.java:297)
at org.apache.hugegraph.rest.AbstractRestClient.get(AbstractRestClient.java:271)
at org.apache.hugegraph.api.version.VersionAPI.get(VersionAPI.java:39)
at org.apache.hugegraph.driver.VersionManager.getApiVersion(VersionManager.java:43)
at org.apache.hugegraph.driver.HugeClient.checkServerApiVersion(HugeClient.java:111)
at org.apache.hugegraph.driver.HugeClient.initManagers(HugeClient.java:95)
at org.apache.hugegraph.driver.HugeClient.(HugeClient.java:67)
at org.apache.hugegraph.driver.HugeClientBuilder.build(HugeClientBuilder.java:62)
at org.example.SingleExample.main(SingleExample.java:24)
Caused by: jakarta.ws.rs.ProcessingException: java.net.SocketTimeoutException: Read timed out
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:531)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:297)
at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:662)
at org.glassfish.jersey.client.JerseyInvocation.call(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation.lambda$runInScope$3(JerseyInvocation.java:691)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
at org.glassfish.jersey.client.JerseyInvocation.runInScope(JerseyInvocation.java:691)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:661)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:413)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:313)
at org.apache.hugegraph.rest.AbstractRestClient.lambda$get$3(AbstractRestClient.java:302)
at org.apache.hugegraph.rest.AbstractRestClient.request(AbstractRestClient.java:198)
... 9 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:483)
... 23 more

### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with org.apache.hugegraph.rest.AbstractRestClient.request at line 200 and the VersionAPI.get call shown in the stack trace. Reproduce the HugeClient.builder setup against the v1.0.0 Docker server, then compare the client request with direct HTTP and Hubble access. Done means identifying and resolving the cause of the read timeout during client initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.