Starting a service fails with error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
book
Article ID: 315235
calendar_today
Updated On:
Products
VMware vCenter Server
Issue/Introduction
Avoid the below error when trying to start any service : getcwd: cannot access parent directories: No such file or directory
Symptoms: You are trying to start one of the services but you get the below error :
INFO:root:Service: vmware-stsd, Action: start Service: vmware-stsd, Action: start 2019-03-22T16:40:21.571Z Running command: ['/sbin/chkconfig', u'vmware-stsd'] 2019-03-22T16:40:21.623Z Done running command 2019-03-22T16:40:21.623Z Running command: ['/sbin/service', u'vmware-stsd', 'status'] 2019-03-22T16:40:21.667Z Done running command 2019-03-22T16:40:21.668Z Running command: ['/sbin/chkconfig', '--force', u'vmware-stsd', 'on'] 2019-03-22T16:40:21.719Z Done running command 2019-03-22T16:40:21.719Z Running command: ['/sbin/service', u'vmware-stsd', 'start'] 2019-03-22T16:42:22.626Z Done running command 2019-03-22T16:42:22.627Z Invoked command: ['/sbin/service', u'vmware-stsd', 'start'] 2019-03-22T16:42:22.628Z RC = 7 Stdout = ensure environment variables are set Starting vmware-stsd ....................................................................................................... Service container did not start in 120 seconds. Assuming failure. Stderr = shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Environment
VMware vCenter Server Appliance 6.7.x VMware vCenter Server Appliance 6.5.x VMware vCenter Server Appliance 6.0.x
Cause
This usually occurs when your current directory does not exist anymore. Most likely, from another terminal you removed that directory .
Resolution
=> Change directory to root directory or any other existing directory then attempt restarting the service again . cd /