origin icon indicating copy to clipboard operation
origin copied to clipboard

Token file for service account /var/run/secrets/kubernetes.io/serviceaccount/token is missing

Open abdelhegazi opened this issue 9 years ago • 6 comments

Version
oc@abdel-oc:~$ oc version
oc v1.5.0+031cbe4
kubernetes v1.5.2+43a9be4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://172.16.6.13:8443
openshift v1.5.0+031cbe4
kubernetes v1.5.2+43a9be4
oc@abdel-oc:~$ docker version
Client:
 Version:      17.04.0-ce
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64
 Experimental: false
oc@abdel-oc:~$ 

And this is the output of oc cluster up

oc@abdel-oc:~$ oc cluster up
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... 
   WARNING: Cannot verify Docker version
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.5.0 image ... 
   Pulling image openshift/origin:v1.5.0
   Pulled 1/3 layers, 37% complete
   Pulled 2/3 layers, 82% complete
   Pulled 3/3 layers, 100% complete
   Extracting
   Image pull complete
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... 
   WARNING: Binding DNS on port 8053 instead of 53, which may not be resolvable from all clients.
-- Checking type of volume mount ... 
   Using nsenter mounter for OpenShift volumes
-- Creating host directories ... OK
-- Finding server IP ... 
   Using 172.16.6.13 as the server IP
-- Starting OpenShift container ... 
   Creating initial OpenShift configuration
   Starting OpenShift using container 'origin'
   Waiting for API server to start listening
   OpenShift server started
-- Adding default OAuthClient redirect URIs ... OK
-- Installing registry ... OK
-- Installing router ... OK
-- Importing image streams ... OK
-- Importing templates ... OK
-- Login to server ... OK
-- Creating initial project "myproject" ... OK
-- Removing temporary directory ... OK
-- Checking container networking ... OK
-- Server Information ... 
   OpenShift server started.
   The server is accessible via web console at:
       https://172.16.6.13:8443

   You are logged in as:
       User:     developer
       Password: developer

   To login as administrator:
       oc login -u system:admin

and upon previous request someone asked the output of this command

oc@abdel-oc:~$ findmnt -o +PROPAGATION
TARGET                                SOURCE         FSTYPE          OPTIONS                                                                                         PROPAGATION
/                                     /dev/nvme0n1p2 ext4            rw,relatime,errors=remount-ro,data=ordered                                                      shared
├─/sys                                sysfs          sysfs           rw,nosuid,nodev,noexec,relatime                                                                 shared
│ ├─/sys/kernel/security              securityfs     securityfs      rw,nosuid,nodev,noexec,relatime                                                                 shared
│ ├─/sys/fs/cgroup                    tmpfs          tmpfs           ro,nosuid,nodev,noexec,mode=755                                                                 shared
│ │ ├─/sys/fs/cgroup/systemd          cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=sys shared
│ │ ├─/sys/fs/cgroup/memory           cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,memory                                                          shared
│ │ ├─/sys/fs/cgroup/pids             cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,pids                                                            shared
│ │ ├─/sys/fs/cgroup/blkio            cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,blkio                                                           shared
│ │ ├─/sys/fs/cgroup/cpu,cpuacct      cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,cpu,cpuacct                                                     shared
│ │ ├─/sys/fs/cgroup/freezer          cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,freezer                                                         shared
│ │ ├─/sys/fs/cgroup/perf_event       cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,perf_event                                                      shared
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,net_cls,net_prio                                                shared
│ │ ├─/sys/fs/cgroup/cpuset           cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,cpuset                                                          shared
│ │ ├─/sys/fs/cgroup/devices          cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,devices                                                         shared
│ │ └─/sys/fs/cgroup/hugetlb          cgroup         cgroup          rw,nosuid,nodev,noexec,relatime,hugetlb                                                         shared
│ ├─/sys/fs/pstore                    pstore         pstore          rw,nosuid,nodev,noexec,relatime                                                                 shared
│ ├─/sys/firmware/efi/efivars         efivarfs       efivarfs        rw,nosuid,nodev,noexec,relatime                                                                 shared
│ ├─/sys/fs/fuse/connections          fusectl        fusectl         rw,relatime                                                                                     shared
│ └─/sys/kernel/debug                 debugfs        debugfs         rw,relatime                                                                                     shared
├─/proc                               proc           proc            rw,nosuid,nodev,noexec,relatime                                                                 shared
│ └─/proc/sys/fs/binfmt_misc          systemd-1      autofs          rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct                                 shared
│   └─/proc/sys/fs/binfmt_misc        binfmt_misc    binfmt_misc     rw,relatime                                                                                     shared
├─/dev                                udev           devtmpfs        rw,nosuid,relatime,size=8135568k,nr_inodes=2033892,mode=755                                     shared
│ ├─/dev/pts                          devpts         devpts          rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000                                           shared
│ ├─/dev/shm                          tmpfs          tmpfs           rw,nosuid,nodev                                                                                 shared
│ ├─/dev/hugepages                    hugetlbfs      hugetlbfs       rw,relatime                                                                                     shared
│ └─/dev/mqueue                       mqueue         mqueue          rw,relatime                                                                                     shared
├─/run                                tmpfs          tmpfs           rw,nosuid,noexec,relatime,size=1631140k,mode=755                                                shared
│ ├─/run/lock                         tmpfs          tmpfs           rw,nosuid,nodev,noexec,relatime,size=5120k                                                      shared
│ ├─/run/docker/netns/default         nsfs[net:[4026531969]]
│ │                                                  nsfs            rw                                                                                              shared
│ └─/run/user/1000                    tmpfs          tmpfs           rw,nosuid,nodev,relatime,size=1631140k,mode=700,uid=1000,gid=1000                               shared
│   └─/run/user/1000/gvfs             gvfsd-fuse     fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000                                             shared
├─/boot/efi                           /dev/nvme0n1p1 vfat            rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remou shared
├─/var/lib/docker/containers/9fee9d1a26941048aa8695db8ec5b46103b005e73f7618737499f36c28b58217/shm
│                                     shm            tmpfs           rw,nosuid,nodev,noexec,relatime,size=65536k                                                     shared
├─/var/lib/docker/aufs                /dev/nvme0n1p2[/var/lib/docker/aufs]
│                                                    ext4            rw,relatime,errors=remount-ro,data=ordered                                                      private
│ └─/var/lib/docker/aufs/mnt/10cb8b72ec3df65319fa68feab2330311763ca39c3eff2a39c905fef7d60e9e1
│                                     none           aufs            rw,relatime,si=50c467de43749969,dio,dirperm1                                                    private
├─/var/lib/origin/openshift.local.volumes/pods/58608c41-2b44-11e7-b511-9cb6d0d37a71/volumes/kubernetes.io~secret/pvinstaller-token-t8p0g
│                                     tmpfs          tmpfs           rw,relatime                                                                                     shared
├─/var/lib/origin/openshift.local.volumes/pods/59155c53-2b44-11e7-b511-9cb6d0d37a71/volumes/kubernetes.io~secret/deployer-token-42hff
│                                     tmpfs          tmpfs           rw,relatime                                                                                     shared
├─/var/lib/origin/openshift.local.volumes/pods/5953f9c9-2b44-11e7-b511-9cb6d0d37a71/volumes/kubernetes.io~secret/deployer-token-42hff
│                                     tmpfs          tmpfs           rw,relatime                                                                                     shared
└─/keybase                            /dev/fuse      fuse            rw,nosuid,nodev,relatime,user_id=1000,group_id=1000                                             shared

And this command too

oc@abdel-oc:~$ grep MountFlags /lib/systemd/system/docker.service
Current Result

Nothing is actually working as I want basically tried to create a new jenkins application as mentioned in the documentation as a start point before heading for s2i but as you see the state of the cluster isn't good at all

oc@abdel-oc:~$ oc get pods
NAME                            READY     STATUS    RESTARTS   AGE
docker-registry-1-deploy        0/1       Error     0          36m
persistent-volume-setup-04sn4   0/1       Error     0          31m
persistent-volume-setup-05bkx   0/1       Error     0          17m
persistent-volume-setup-05ctj   0/1       Error     0          18m
persistent-volume-setup-05v83   0/1       Error     0          22m
persistent-volume-setup-09gz9   0/1       Error     0          32m
persistent-volume-setup-09gzh   0/1       Error     0          16m
persistent-volume-setup-0bczt   0/1       Error     0          27m
persistent-volume-setup-0dkmf   0/1       Error     0          27m
persistent-volume-setup-0fqql   0/1       Error     0          19m
persistent-volume-setup-0gbvs   0/1       Error     0          29m
persistent-volume-setup-0gj4c   0/1       Error     0          16m
persistent-volume-setup-0gw49   0/1       Error     0          28m
persistent-volume-setup-0j229   0/1       Error     0          30m
persistent-volume-setup-0ks5g   0/1       Error     0          35m
persistent-volume-setup-0l8vp   0/1       Error     0          27m
persistent-volume-setup-0sh4q   0/1       Error     0          25m
persistent-volume-setup-0vh3s   0/1       Error     0          36m
.
.
and it goes all the way

When I try to create a new namespace for testing and to track down the pods' logs what is going on to cause all of this this is what I see

oc@abdel-oc:~$ oc get pods
NAME               READY     STATUS    RESTARTS   AGE
frontend-1-build   0/1       Error     0          4m
jenkins-1-deploy   0/1       Error     0          5m

**oc@abdel-oc:~$ oc logs jenkins-1-deploy
error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory**
Additional Information

And this is the output of oc adm diagnostics

oc@abdel-oc:~$ oc adm diagnostics
[Note] Determining if client configuration exists for client/cluster diagnostics
Info:  Successfully read a client config file at '/home/oc/.kube/config'
Info:  Using context for cluster-admin access: 'default/172-16-6-13:8443/system:admin'

[Note] Running diagnostic: ConfigContexts[myproject/172-16-6-13:8443/developer]
       Description: Validate client config context is complete and has connectivity
       
Info:  The current client config context is 'myproject/172-16-6-13:8443/developer':
       The server URL is 'https://172.16.6.13:8443'
       The user authentication is 'developer/172-16-6-13:8443'
       The current project is 'myproject'
       Successfully requested project list; has access to project(s):
         [myproject]
       
[Note] Running diagnostic: ConfigContexts[myproject/172-16-6-13:8443/system:admin]
       Description: Validate client config context is complete and has connectivity
       
Info:  For client config context 'myproject/172-16-6-13:8443/system:admin':
       The server URL is 'https://172.16.6.13:8443'
       The user authentication is 'system:admin/172-16-6-13:8443'
       The current project is 'myproject'
       Successfully requested project list; has access to project(s):
         [default kube-system myproject openshift openshift-infra]
       
[Note] Running diagnostic: DiagnosticPod
       Description: Create a pod to run diagnostics from the application standpoint
       
ERROR: [DCli2012 from diagnostic DiagnosticPod@openshift/origin/pkg/diagnostics/client/run_diagnostics_pod.go:155]
       See the errors below in the output from the diagnostic pod:
       [Note] Running diagnostic: PodCheckAuth
              Description: Check that service account credentials authenticate as expected
              
       ERROR: [DP1001 from diagnostic PodCheckAuth@openshift/origin/pkg/diagnostics/pod/auth.go:53]
              could not read the service account token: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
              
       [Note] Running diagnostic: PodCheckDns
              Description: Check that DNS within a pod works as expected
              
       [Note] Summary of diagnostics execution (version v1.5.0+031cbe4):
       [Note] Errors seen: 1
       
[Note] Running diagnostic: NetworkCheck
       Description: Create a pod on all schedulable nodes and run network diagnostics from the application standpoint
       
ERROR: [DNet2001 from diagnostic NetworkCheck@openshift/origin/pkg/diagnostics/network/run_pod.go:77]
       Checking network plugin failed. Error: User "developer" cannot get clusternetworks at the cluster scope
       
[Note] Skipping diagnostic: AggregatedLogging
       Description: Check aggregated logging integration for proper configuration
       Because: No master config file was provided
       
[Note] Running diagnostic: ClusterRegistry
       Description: Check that there is a working Docker registry
       
ERROR: [DClu1006 from diagnostic ClusterRegistry@openshift/origin/pkg/diagnostics/cluster/registry.go:209]
       The "docker-registry" service exists but has no associated pods, so it
       is not available. Builds and deployments that use the registry will fail.
       
[Note] Running diagnostic: ClusterRoleBindings
       Description: Check that the default ClusterRoleBindings are present and contain the expected subjects
       
Info:  clusterrolebinding/cluster-admins has more subjects than expected.
       
       Use the `oadm policy reconcile-cluster-role-bindings` command to update the role binding to remove extra subjects.
       
Info:  clusterrolebinding/cluster-admins has extra subject {ServiceAccount default pvinstaller    }.

[Note] Running diagnostic: ClusterRoles
       Description: Check that the default ClusterRoles are present and contain the expected permissions
       
[Note] Running diagnostic: ClusterRouterName
       Description: Check there is a working router
       
ERROR: [DClu2007 from diagnostic ClusterRouter@openshift/origin/pkg/diagnostics/cluster/router.go:156]
       The "router" DeploymentConfig exists but has no running pods, so it
       is not available. Apps will not be externally accessible via the router.
       
[Note] Running diagnostic: MasterNode
       Description: Check if master is also running node (for Open vSwitch)
       
Info:  Found a node with same IP as master: 172.16.6.13

[Note] Skipping diagnostic: MetricsApiProxy
       Description: Check the integrated heapster metrics can be reached via the API proxy
       Because: The heapster service does not exist in the openshift-infra project at this time,
       so it is not available for the Horizontal Pod Autoscaler to use as a source of metrics.
       
[Note] Running diagnostic: NodeDefinitions
       Description: Check node records on master
       
[Note] Skipping diagnostic: ServiceExternalIPs
       Description: Check for existing services with ExternalIPs that are disallowed by master config
       Because: No master config file was detected
       
[Note] Summary of diagnostics execution (version v1.5.0+031cbe4):
[Note] Errors seen: 4

I have seen many people complaining about this with earlier with 1.2 and 1.3 but this is 1.5 and I would like to make sure I can rely on local cluster node before we head for real deployment.

at the beginning I have minikube installed so I thought there may be some collision regarding ~/.kube/config so I had to create a new user but ended up with same results

abdelhegazi avatar Apr 27 '17 13:04 abdelhegazi

I've run into this buy while trying to run the Administrators: Setting Up a Cluster tutorial.

I created a Fedora 25 x64 node in Digital Ocean. I installed Docker, and followed the tutorial. The tutorial app fails to deploy with the following error:

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

Version Information

~]# oc version
oc v3.6.0-alpha.1+decce00-130
kubernetes v1.5.2+43a9be4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server **REDACTED**
openshift v3.6.0-alpha.1+decce00-130
kubernetes v1.5.2+43a9be4

~]# docker --version
Docker version 1.13.1-cs3, build 95c9d22

~]# docker container ls
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
fd3529b350b5        openshift/origin    "/usr/bin/openshif..."   28 minutes ago      Up 28 minutes                           origin

~]# docker image ls
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
openshift/origin            latest              bff03461648d        2 hours ago         669 MB
openshift/origin-deployer   v3.6.0-alpha.1      367295b9d0a5        2 weeks ago         635 MB
openshift/origin-pod        v3.6.0-alpha.1      853986e79d22        2 weeks ago         1.14 MB

Hope this helps

dwiden avatar Apr 27 '17 15:04 dwiden

I think this is a dupe of #13865. WDYT @soltysh?

enj avatar Apr 27 '17 18:04 enj

@enj thanks for your reply, you seem right they both seem dupe but seems no solution and BTW, I am running LTS 16.04

abdelhegazi avatar Apr 27 '17 22:04 abdelhegazi

I have the same issue with Ubuntu 16.04.2 LTS

RobWin avatar Apr 28 '17 09:04 RobWin

Yes it is a dupe, closing in favor of #13865.

soltysh avatar Apr 28 '17 21:04 soltysh

I had the same issue on Fedora 25, Docker ce 17.05, oc v1.5.1+7b451fc Downgrading docker to 1.13.1 resolved the issue

ibidani avatar May 19 '17 01:05 ibidani