Origin: serviceaccount/token: no such file or directory for Docker quick start

Created on 27 Oct 2016  路  11Comments  路  Source: openshift/origin

The docker quickstart instructions here: https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container

Don't appear to work on CentOS 7, with docker 1.10.

I get the following error when deploying anything, (registry, router, etc)

error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
Version

oc v1.3.1
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://104.236.167.181:8443
openshift v1.3.1
kubernetes v1.3.0+52492b4

Steps To Reproduce
  1. Run the following to boot an OpenShift Origin Instance:

    sudo docker run -d --name "origin" \
       --privileged --pid=host --net=host \
       -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
       -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
       openshift/origin start
    
  2. Attempt to deploy anything, the registry for instance:

    oadm registry --config=admin.kubeconfig --service-account=registry
    
    Current Result

Deployment pod fails with above error

Expected Result

Deployment pod should successfully start

componenauth kinquestion prioritP1

Most helpful comment

Same issue for me as well:

Installed openshift through docker:

sudo docker run -d --name "origin" \
        --privileged --pid=host --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
        openshift/origin start

After select image jenkins in openshift the deployment immediately breaks cause of the error:

error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory

openshift version:

oc v1.4.0-alpha.1+c486348-87
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.7.1.160:8443
openshift v1.4.0-alpha.1+c486348-87
kubernetes v1.4.0+776c994

OS:
CentOS Linux release 7.2.1511 (Core)

Docker Version:
Docker version 1.12.3, build 6b644ec

All 11 comments

@pmorie any thoughts?

Any news about this?

I ran into the same issue on Fedora 24 and Docker 1.12.3

OC version:

oc v1.4.0-alpha.1+9c565ab-8
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://192.168.1.108:8443
openshift v1.4.0-alpha.1+9c565ab-8
kubernetes v1.4.0+776c994

Same issue for me as well:

Installed openshift through docker:

sudo docker run -d --name "origin" \
        --privileged --pid=host --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
        openshift/origin start

After select image jenkins in openshift the deployment immediately breaks cause of the error:

error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory

openshift version:

oc v1.4.0-alpha.1+c486348-87
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.7.1.160:8443
openshift v1.4.0-alpha.1+c486348-87
kubernetes v1.4.0+776c994

OS:
CentOS Linux release 7.2.1511 (Core)

Docker Version:
Docker version 1.12.3, build 6b644ec

Same problem here.

Me too. I have same problem.

Same problem.

oc version
oc v1.5.0-alpha.0+f1e59ea-254
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO
openshift v1.5.0-alpha.0+f1e59ea-254
kubernetes v1.4.0+776c994

docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built:
OS/Arch: linux/amd64

Server:
Version: 1.12.3

Same here, using stock fedora25 server install.
Start the All-in-One Server container per the documentation and then doing the Try It Out steps breaks at the point of doing oc new-app openshift/deployment-example with this error:
error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
(the whole of /var/run/secrets/ is in fact empty on both host and inside the container)

docker version
Client and Server:
Version: 1.12.3
API version: 1.24
Package version: docker-common-1.12.3-12.git97974ae.fc25.x86_64
Go version: go1.7.4
Git commit: 97974ae/1.12.3
Built:
OS/Arch: linux/amd64

oc version
oc v1.5.0-alpha.0+93ca46f-271
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO
openshift v1.5.0-alpha.0+93ca46f-271

there is also separate BZ reported for this. @pmorie bump

This is easy to reproduce using the openshift/origin container and following the install guide as kujeger did. Hopefully these logs help track the problem down:

origin: https://gist.github.com/jpeeler/fe82a0bd3fbcee5dd4e219548e48d98c
pod: https://gist.github.com/jpeeler/ef742e3fe783acd647903202dbfb08ac

confirmed with @jpeeler that using rslave mode on the volume mount directory fixes this issue. Doc PR created: https://github.com/openshift/openshift-docs/pull/3356

Command will be updated to:

$ sudo docker run -d --name "origin" \
        --privileged --pid=host --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes:rslave \
        openshift/origin start

PR has merged

Was this page helpful?
0 / 5 - 0 ratings