jenkinsci / jenkinsci/java-client-api

java.net.UnknownHostException: build: nodename nor servname provided, or not known

オープン
#314 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
913
フォーク
466
PR マージ指標
30日以内にマージされた PR はありません

説明

Tried simple code from the example:

`Map jobs = null;
try {
jobs = jenkins.getJobs();
System.out.println(jobs.keySet());
JobWithDetails ios = jobs.get("My job").details();
} catch (IOException e) {
e.printStackTrace();
}`

Fails with:
`java.net.UnknownHostException: build: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:102)
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.get(JenkinsHttpClient.java:134)
at com.offbytwo.jenkins.model.Job.details(Job.java:45)
at Jenkins.main(Jenkins.java:26)`

Tried to google, found out several similar issues, like [this](http://crunchify.com/getting-java-net-unknownhostexception-nodename-nor-servname-provided-or-not-known-error-on-mac-os-x-update-your-privateetchosts-file/). But **build** is not my hostname and even if I add it to /etc/hosts, this code won't run anyway.

Any idea how to fix this?

macos 10.13.1
java 1.8.0_141

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the example entry point, then trace Job.details in Job.java through JenkinsHttpClient.get in JenkinsHttpClient.java. Reproduce the UnknownHostException using the reported Java and macOS versions and inspect where the host named in the request is selected. Done means the example reaches the Jenkins API without resolving the unintended host.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。