Tuesday, May 15, 2007

How to fix "cannot access parent directories" shell error. (Also with Ganga,DQ2 on Grid)

If you are working in a shell and you get an error like this:

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

probably you are working in a directory you have deleted from within another shell. I.e. you are in shell A and you are working within /home/Joe/test/ folder. After a while you open a new shell B and you work there. After completed your work you delete the folder /home/Joe/test/ folder and close the shell B. After a while you come back to shell A and start to work there...and you get the Mistery error message, because actually you are working in a deleted directory! ;-)

Try this at the prompt [trust me, it's ugly but safe! :-) ] :

ls $(pwd) && ls /etc/
cd /

first you get an error like "No such file or directory", because the working folder has been previously deleted and doesn't exist anymore. But then, if you move to an existing directory, the problem is fixed! :-)

P.S. You can get this error also working with Ganga and DQ2. If you are working in a .../Local/jobid directory (e.g. in order to read the 'stdout' file) of a Job that you have deleted from withing Ganga CLIP (Command Line IPython Interpreter) with the command jobs[jobid].remove() and try to use dq2_get in order to retrieve an output from the Grid, you get exactly the same error above. Try the same solution.

Good work! :-)

0 commenti: