Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39695

Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • Jenkins: 2.19.2
      kubernetes-plugin: 0.9

      Hi,
      I'm trying the job example, but the job fails on the shell step:

      [Pipeline] container
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Build a Go project)
      [Pipeline] sh
      [k8s-test2] Running shell script
      Executing shell script inside container [golang] of pod [jenkins-slave-7be4b22b164184]
      java.net.UnknownHostException: kubernetes.default.svc: unknown error
      	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 com.squareup.okhttp.Dns$1.lookup(Dns.java:39)
      	at com.squareup.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:175)
      	at com.squareup.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:141)
      	at com.squareup.okhttp.internal.http.RouteSelector.next(RouteSelector.java:83)
      	at com.squareup.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:174)
      	at com.squareup.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
      	at com.squareup.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
      	at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
      	at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
      	at com.squareup.okhttp.Call.getResponse(Call.java:286)
      	at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243)
      	at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
      	at com.squareup.okhttp.Call.access$100(Call.java:35)
      	at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:171)
      	at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // container
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      

      But kube-dns is up and running :

      @kubectl run -i --tty busybox --image=busybox --generator="run-pod/v1"
      Waiting for pod default/busybox to be running, status is Pending, pod ready: false
      
      Hit enter for command prompt
      
      / # nslookup kubernetes.default.svc
      Server:    172.18.200.10
      Address 1: 172.18.200.10 kube-dns.kube-system.svc.cluster.local
      
      Name:      kubernetes.default.svc
      Address 1: 172.18.200.1 kubernetes.default.svc.cluster.local
      

      Any ideas?

            csanchez Carlos Sanchez
            sdouche Sébastien Douche
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: