I've set up a Jenkins master-slave deployment on GKE using the official Helm chart, modified the Slave image configuration to pull my custom image, where I installed the Google Cloud SDK, instead of "jenkinsci/jnlp-slave" and I'm trying to run gcloud commands as part of a shell script in a jenkins job.
I've tried running other jobs (of any size) not dependent on gcloud and I have no issue, but when I run "gcloud info" (or any other gcloud command except "gcloud version"), the connection from the slaves seems to drop.
[gcloud-test] $ /bin/sh -xe /tmp/hudson5806299107057008746.sh
+ gcloud info
Google Cloud SDK [146.0.0]
Platform: [Linux, x86_64]
Python Version: [2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]
Installation Root: [/opt/google-cloud-sdk]
Installed Components:
kubectl: []
core-nix: [2016.11.07]
core: [2017.02.28]
gcloud-deps: [2017.02.28]
gcloud: []
gsutil-nix: [4.18]
gcloud-deps-linux-x86_64: [2017.02.21]
gsutil: [4.22]
bq: [2.0.24]
kubectl-linux-x86_64: [1.5.3]
bq-nix: [2.0.24]
System PATH: [/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games]
Cloud SDK on PATH: [False]
Kubectl on PATH: [False]
Installation Properties: [/opt/google-cloud-sdk/properties]
User Config Directory: [/home/jenkins/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/home/jenkins/.config/gcloud/configurations/config_default]
Project: [xxx]
Current Properties:
[core]
project: [xx]
disable_usage_reporting: [False]
log_http: [true]
Logs Directory: [/home/jenkins/.config/gcloud/logs]
Last Log File: [None]
FATAL: java.io.IOException: Unexpected EOF while receiving the data from the channel. FIFO buffer has been already closed
hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected EOF while receiving the data from the channel. FIFO buffer has been already closed
at hudson.remoting.Request.abort(Request.java:307)
at hudson.remoting.Channel.terminate(Channel.java:888)
at org.jenkinsci.remoting.nio.NioChannelHub$3.run(NioChannelHub.java:617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
at ......remote call to Channel to /
10.112.7.167(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1537)
at hudson.remoting.Request.call(Request.java:172)
at hudson.remoting.Channel.call(Channel.java:821)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:984)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:540)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: Unexpected EOF while receiving the data from the channel. FIFO buffer has been already closed
at org.jenkinsci.remoting.nio.NioChannelHub$3.run(NioChannelHub.java:617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Caused by: org.jenkinsci.remoting.nio.FifoBuffer$CloseCause: Buffer close has been requested
at org.jenkinsci.remoting.nio.FifoBuffer.close(FifoBuffer.java:426)
at org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport.closeR(NioChannelHub.java:332)
at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:565)
... 6 more
Finished: FAILURE
The same issue happens on minikube. I am also using the Jenkins Google OAuth Credentials Plugin to import Google Cloud credentials from metadata or JSON file but nothing changes.
Any help would be much appreciated.