Bug 1332131

Summary: The oc login gives mkdir /src: permission denied
Product: OKD Reporter: Michal Fojtik <mfojtik>
Component: ocAssignee: Juan Vallejo <jvallejo>
Status: CLOSED CURRENTRELEASE QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, dmace, ffranz, jokerman, jvallejo, mmccomas, xiaocwan, xxia, yanpzhan
Target Milestone: ---   
Target Release: 3.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 13:55:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Fojtik 2016-05-02 10:19:26 UTC
Description of problem:

$ oc login https://api.dev-preview-int.openshift.com --token=xxx
Logged into "https://api.dev-preview-int.openshift.com:443" as "mfojtik" using the token provided.

Using project "mfojtik-blog".
error: mkdir /src: permission denied

Version-Release number of selected component (if applicable):

$ oc version
oc v1.1.6
kubernetes v1.2.0-36-g4a3f9c5

This is happening on OSX (haven't tested the Linux binary). The 'oc' was installed from brew (but seems like it is pretty recent).

Actual results:

error: mkdir /src: permission denied


Expected results:

Should not see this error (where does it come from?)

Additional info:

Comment 1 Michal Fojtik 2016-05-02 10:27:02 UTC
This also happen when you download the 'oc' tarball from web console.

Comment 2 Michal Fojtik 2016-05-02 10:27:31 UTC
Also after this error, you're not logged in...

Comment 3 Yanping Zhang 2016-05-03 09:56:11 UTC
QE tried with many oc versions including oc v3.2.0.20, v1.1.3, v1.0.6 and so on, We can login successfully.
We think Michal may export KUBECONFIG uncorrectly, because after we exprot KUBECONFIG=/src, login will show error: mkdir /src: permission denied.
Pls check again, thanks!

Comment 4 Michal Fojtik 2016-05-03 10:12:15 UTC
(In reply to Yanping Zhang from comment #3)
> QE tried with many oc versions including oc v3.2.0.20, v1.1.3, v1.0.6 and so
> on, We can login successfully.
> We think Michal may export KUBECONFIG uncorrectly, because after we exprot
> KUBECONFIG=/src, login will show error: mkdir /src: permission denied.
> Pls check again, thanks!

I think you're right:

Σ~/.../openshift/sti-php ∎ echo $KUBECONFIG
/src/github.com/openshift/origin/openshift.local.certificates/admin/.kubeconfig

I have no idea where I do export this, but of course it is my problem. However, it would be nice to print what is wrong to user when the mkdir failed (it prints just /src, but it should print something like:

Failed to create kubeconfig under "/full/path". Please check the $KUBECONFIG variable.

Comment 5 Dan Mace 2016-05-03 15:31:51 UTC
Reassigning to Fabiano as a usability issue for the CLI.

Comment 6 Juan Vallejo 2016-07-20 22:17:48 UTC
Related PR: https://github.com/openshift/origin/pull/9968

Comment 7 XiaochuanWang 2016-07-29 03:21:40 UTC
Not reproduced on latest origin:
Verified on oc/opensift version:
v1.3.0-alpha.2+768ffed