jenkinsci / jenkinsci/java-client-api
HttpHostConnectException
- Dominant language
- Java
- Stars
- 913
- Forks
- 466
- PR merge metrics
- No merged PRs in 30d
Description
my code like this:
js=new JenkinsServer(new URI("http://localhost:8080"), "xxx", "xxx");
JobWithDetails job = js.getJob("jobName");
QueueReference queueRef = job.build(map,true);
it report an exception:
org.apache.http.conn.HttpHostConnectException: Connect to 52.xxx.xxx.54:8080 [/52.xxx.xxx.54] failed: Connection timed out (Connection timed out)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:257)
at com.offbytwo.jenkins.model.Job.build(Job.java:151)
at com.offbytwo.jenkins.model.Job.build(Job.java:125)
at com.xxx.App.build(App.java:67)
at com.xxx.App.execJob(App.java:42)
at com.xxx.App.main(App.java:28)
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.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:125)
... 20 more
I use local IP which is replaced by public IP when build it
Contributor guide
Research direction
Start with the reported call path through Job.build and JenkinsHttpClient.post, then compare the supplied JenkinsServer URI with the endpoint in the exception. Reproduce the timeout and establish whether the client reports an actionable defect; done requires a confirmed client-side issue or a clarified, reproducible report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100