Bug 1332131 - The oc login gives mkdir /src: permission denied
Summary: The oc login gives mkdir /src: permission denied
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.x
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-02 10:19 UTC by Michal Fojtik
Modified: 2016-09-19 13:55 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:55:37 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.