<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):</p>
<ul dir="auto">
<li>No</li>
</ul>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p>
<ul dir="auto">
<li>kubectl "does not allow access"</li>
</ul>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p>
<ul dir="auto">
<li>Bug report</li>
</ul>

<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.6&quot;, GitCommit:&quot;e569a27d02001e343cb68086bc06d47804f62af6&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-11-12T05:22:15Z&quot;, GoVersion:&quot;go1.7.1&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.5&quot;, GitCommit:&quot;5a0a696437ad35c133c0c8493f7e9d22b0f9b81b&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-10-29T01:32:42Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}"><pre class="notranslate"><code class="notranslate">Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.6", GitCommit:"e569a27d02001e343cb68086bc06d47804f62af6", GitTreeState:"clean", BuildDate:"2016-11-12T05:22:15Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.5", GitCommit:"5a0a696437ad35c133c0c8493f7e9d22b0f9b81b", GitTreeState:"clean", BuildDate:"2016-10-29T01:32:42Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre></div>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>:
<ul dir="auto">
<li>GCP GKE 1.4.5</li>
</ul>
</li>
<li><strong>OS</strong> (e.g. from /etc/os-release):
<ul dir="auto">
<li>Not sure, using gci</li>
</ul>
</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):
<ul dir="auto">
<li>Not sure, using gci</li>
</ul>
</li>
<li><strong>Install tools</strong>:
<ul dir="auto">
<li>GKE web UI</li>
</ul>
</li>
<li><strong>Others</strong>:
<ul dir="auto">
<li>N/A</li>
</ul>
</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<ul dir="auto">
<li>In juggling multiple gcloud accounts with GKE clusters I accidentally used <code class="notranslate">kubectl</code> with the wrong application default credentials and it cached bad creds in <code class="notranslate">~/.kube/config</code></li>
<li>After pointing gcloud at the right application default credentials and re-running <code class="notranslate">kubectl</code>, it continued trying and failing to use the bad creds cached in <code class="notranslate">~/.kube/config</code>; at this point I was stuck and confused for a few hours</li>
<li>To repair, I had to manually edit <code class="notranslate">~/.kube/config</code> to remove <code class="notranslate">users[].user.auth-provider.config</code>, and then <code class="notranslate">kubectl</code> started working again (or else wait ~1h for the access token to expire and refresh itself)</li>
</ul>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<ul dir="auto">
<li>After pointing gcloud at the right application default credentials <code class="notranslate">kubectl</code> should just work, or at least provide an error msg to the user that can help them figure out that they need to revoke the bad access token and how to do it</li>
</ul>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<p dir="auto">Good scenario: just works</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Avoid calling kubectl with wrong application default credentials
gcloud auth application-default login # -&gt; Auth with user A
kubectl --context cluster-A version   # Ok + caches good creds
gcloud auth application-default login # -&gt; Auth with user B
kubectl --context cluster-B version   # Ok + caches good creds

# Both now work
kubectl --context cluster-A version   # Ok, using cached good creds
kubectl --context cluster-B version   # Ok, using cached good creds"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> Avoid calling kubectl with wrong application default credentials</span>
gcloud auth application-default login <span class="pl-c"><span class="pl-c">#</span> -&gt; Auth with user A</span>
kubectl --context cluster-A version   <span class="pl-c"><span class="pl-c">#</span> Ok + caches good creds</span>
gcloud auth application-default login <span class="pl-c"><span class="pl-c">#</span> -&gt; Auth with user B</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Ok + caches good creds</span>

<span class="pl-c"><span class="pl-c">#</span> Both now work</span>
kubectl --context cluster-A version   <span class="pl-c"><span class="pl-c">#</span> Ok, using cached good creds</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Ok, using cached good creds</span></pre></div>
<p dir="auto">Bad scenario: user makes one mistake and gets stuck</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Use kubectl with wrong ADC
gcloud auth application-default login # -&gt; Auth with user A
kubectl --context cluster-A version   # Ok + caches good creds
kubectl --context cluster-B version   # Oops + caches bad creds
gcloud auth application-default login # -&gt; Auth with user B
kubectl --context cluster-B version   # Fails, stuck on bad creds cached in ~/.kube/config
kubectl --context cluster-A version   # Still works, using cached good creds

# User is now stuck and confused with no clear approach to resolve...

# Tada!
vim ~/.kube/config                    # Manually remove users[].user.auth-provider.config for cluster-B
kubectl --context cluster-B version   # Ok + caches good creds

# Both now work
kubectl --context cluster-A version   # Ok, using cached good creds
kubectl --context cluster-B version   # Ok, using cached good creds"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> Use kubectl with wrong ADC</span>
gcloud auth application-default login <span class="pl-c"><span class="pl-c">#</span> -&gt; Auth with user A</span>
kubectl --context cluster-A version   <span class="pl-c"><span class="pl-c">#</span> Ok + caches good creds</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Oops + caches bad creds</span>
gcloud auth application-default login <span class="pl-c"><span class="pl-c">#</span> -&gt; Auth with user B</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Fails, stuck on bad creds cached in ~/.kube/config</span>
kubectl --context cluster-A version   <span class="pl-c"><span class="pl-c">#</span> Still works, using cached good creds</span>

<span class="pl-c"><span class="pl-c">#</span> User is now stuck and confused with no clear approach to resolve...</span>

<span class="pl-c"><span class="pl-c">#</span> Tada!</span>
vim <span class="pl-k">~</span>/.kube/config                    <span class="pl-c"><span class="pl-c">#</span> Manually remove users[].user.auth-provider.config for cluster-B</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Ok + caches good creds</span>

<span class="pl-c"><span class="pl-c">#</span> Both now work</span>
kubectl --context cluster-A version   <span class="pl-c"><span class="pl-c">#</span> Ok, using cached good creds</span>
kubectl --context cluster-B version   <span class="pl-c"><span class="pl-c">#</span> Ok, using cached good creds</span></pre></div>
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):</p>
<p dir="auto">Bug?</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p>
<p dir="auto">exec format error</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p>

<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p>
<p dir="auto">Build from source K8s master and 1.5.0a</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>:</li>
</ul>
<p dir="auto">Raspberry Pi 3</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release):</li>
</ul>
<p dir="auto">HypriotOS 1.0</p>
<ul dir="auto">
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li>
</ul>
<p dir="auto">Linux k8smaster 4.4.15-hypriotos-v7+ <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a> SMP PREEMPT Mon Jul 25 08:46:52 UTC 2016 armv7l GNU/Linux</p>
<ul dir="auto">
<li><strong>Install tools</strong>:</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Status: Downloaded newer image for gcr.io/google_containers/kube-cross:v1.6.3-9<br>
---&gt; e4ded450d60b<br>
Step 2 : RUN touch /kube-build-image<br>
---&gt; Running in 309c88797965<br>
standard_init_linux.go:175: exec user process caused "exec format error"<br>
The command '/bin/sh -c touch /kube-build-image' returned a non-zero code: 1</p>
<p dir="auto">To retry manually, run:</p>
<p dir="auto">docker build -t kube-build:build-cc7f4ab6d3-4-v1.6.3-9 --pull=false /home/pirate/kubernetes/_output/images/kube-build:build-cc7f4ab6d3-4-v1.6.3-9</p>
<p dir="auto">Makefile:239: recipe for target 'release' failed<br>
make: *** [release] Error 1</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">make release to complete</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<p dir="auto">o Download Hypriot flash tool: flash <a href="https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip" rel="nofollow">https://downloads.hypriot.com/hypriotos-rpi-v1.0.0.img.zip</a><br>
o Flash image on SD card: <a href="http://blog.hypriot.com/post/releasing-HypriotOS-1-0/" rel="nofollow">http://blog.hypriot.com/post/releasing-HypriotOS-1-0/</a><br>
o Boot rpi 3 from SD card<br>
o git clone <a href="https://github.com/kubernetes/kubernetes.git">https://github.com/kubernetes/kubernetes.git</a><br>
o cd kubernetes &amp;&amp; make release</p>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto">docker version<br>
Client:<br>
Version:      1.12.1<br>
API version:  1.24<br>
Go version:   go1.6.3<br>
Git commit:   23cf638<br>
Built:        Thu Aug 18 05:31:15 2016<br>
OS/Arch:      linux/arm</p>
<p dir="auto">Server:<br>
Version:      1.12.1<br>
API version:  1.24<br>
Go version:   go1.6.3<br>
Git commit:   23cf638<br>
Built:        Thu Aug 18 05:31:15 2016<br>
OS/Arch:      linux/arm</p>