jenkinsci / jenkinsci/java-client-api
java.net.UnknownHostException: build: nodename nor servname provided, or not known
- Lenguaje dominante
- Java
- Estrellas
- 913
- Forks
- 466
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100