RESOLVED: getcwd cannot access parent directories after file server rebuild

Issues related to configuring your network
lhouk
Posts: 15
Joined: 2014/03/20 14:46:52

RESOLVED: getcwd cannot access parent directories after file server rebuild

Postby lhouk » 2017/09/13 19:40:02

Long story short: our file server died, and we fixed it by taking the drives out of the dead machine and putting them into a good machine, which became our new file server. We had to change the MAC addresses in the network interface files, but after that it seemed to work. The only problem now is that we are getting odd error messages about "getcwd". For instance, when we open a new xterm we get the errors

Code: Select all

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Also, the same problem appears when we try to run a shell, but only on automounted directories:

Code: Select all

/home/jdoe$ /bin/ls -l
total 120
drwxr-xr-x. 2 jdoe users  4096 Sep  5 10:37 bin
drwxr-xr-x. 2 jdoe users  4096 Sep 13 09:36 etc
drwxr-xr-x. 2 jdoe users  4096 Sep 13 10:18 logs
...

/home/jdoe$ /bin/sh -c "/bin/ls -l"
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
total 120
drwxr-xr-x. 2 jdoe users  4096 Sep  5 10:37 bin
drwxr-xr-x. 2 jdoe users  4096 Sep 13 09:36 etc
drwxr-xr-x. 2 jdoe users  4096 Sep 13 10:18 logs
...

/home/jdoe$ cd /

/$ /bin/ls -l
total 113
dr-xr-xr-x.   2 root root  4096 Aug 25 03:12 bin
dr-xr-xr-x.   5 root root  4096 Sep 13 04:04 boot
drwxr-xr-x.  19 root root  3880 Sep  5 08:53 dev
...

/$ /bin/sh -c "/bin/ls -l"
total 113
dr-xr-xr-x.   2 root root  4096 Aug 25 03:12 bin
dr-xr-xr-x.   5 root root  4096 Sep 13 04:04 boot
drwxr-xr-x.  19 root root  3880 Sep  5 08:53 dev

As another example, when we run a shell script that connects to another system with ssh, we see "job-working-directory: error retrieving..."

Does anyone have any idea what might have caused this? When I searched for that error message online, all the responses referred to a directory no longer existing, which isn't the case here. If it matters, we're running OpenLDAP for our automap mount points. Thanks in advance for all responses.
Last edited by lhouk on 2017/09/18 21:36:23, edited 1 time in total.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: getcwd cannot access parent directories after file server rebuild

Postby gerald_clark » 2017/09/14 01:45:21

Your passwd file is pointing to non-existent directories.

lhouk
Posts: 15
Joined: 2014/03/20 14:46:52

Re: getcwd cannot access parent directories after file server rebuild

Postby lhouk » 2017/09/14 14:21:48

gerald_clark wrote:Your passwd file is pointing to non-existent directories.
Gerald,

Thanks for your response, but the paths in /etc/password on both the server and the workstation are all valid. They are even all local; none are automounted. Do you have any other ideas?

lightman47
Posts: 527
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: getcwd cannot access parent directories after file server rebuild

Postby lightman47 » 2017/09/15 15:51:26

just a thought - it complains about Parent directories - any chance the files (that are there) were copied out of parent directories, withOUT copying the parent directories themselves.

I guess what I am thinking is that the passwd specs may be relative references, not absolute.

? don't know
:)

lhouk
Posts: 15
Joined: 2014/03/20 14:46:52

Re: getcwd cannot access parent directories after file server rebuild

Postby lhouk » 2017/09/18 21:35:59

We resolved the problem. It was stale NFS file handles on the workstations, apparently left when the server first crashed. We cleared the NFS cache on the server, then did "umount -l" on the workstations and rebooted them. When the workstations came back up, no more error. :D

Thanks to lightman47 and gerald_clarke for their suggestions.