jenkinsci / jenkinsci/java-client-api
java.net.UnknownHostException: build: nodename nor servname provided, or not known
- Vorherrschende Sprache
- Java
- Sterne
- 913
- Forks
- 466
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.