Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution from a removed working directory #457

Closed
zzhang147 opened this issue May 19, 2022 · 4 comments
Closed

Execution from a removed working directory #457

zzhang147 opened this issue May 19, 2022 · 4 comments
Labels
Milestone

Comments

@zzhang147
Copy link

Describe the bug

To Reproduce

Steps to reproduce the behavior:

$ module add vscode/1.57.1
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
ERROR: error getting working directory name: no such file or directory
      while executing
  "pwd"
      (procedure "getAbsolutePath" line 9)
      invoked from within
  "getAbsolutePath $modpath"
      (procedure "getModulePathList" line 11)
      invoked from within
  "getModulePathList exiterronundef"
      (procedure "getPathToModule" line 35)
      invoked from within
  "getPathToModule $mod {} $notfounderr"
      (procedure "cmdModuleLoad" line 24)
      invoked from within
  "cmdModuleLoad load 1 {*}$args"
      (procedure "module" line 123)
      invoked from within
  "{*}$execcmdlist"

Location and content of any modulerc or modulefile involved:

$ cat path/to/modulepath/module/version
$ cat path/to/modulepath/module/.modulerc
$ cat path/to/modulepath/.modulerc
...

Expected behavior

Error and debugging information

$ module --debug <command1> <arguments>
$ module --debug <command2> <arguments>
...

Modules version and configuration

$ module 1.57.1
$ module config --dump-state
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Modules Release 5.0.1 (2021-10-16)

- Config. name ---------.- Value (set by if default overridden) ---------------
advanced_version_spec     1
auto_handling             0
avail_indepth             1
avail_output              modulepath:alias:dirwsym:sym:tag:key
avail_terse_output        modulepath:alias:dirwsym:sym:tag
collection_pin_version    0
collection_target         <undef>
color                     auto
colors                    hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:va=93:sy=95:de=4:cm=92:aL=100:L=90;47:H=2:F=41:nF=43:S=46:sS=44
contact                   pdl.afs.app.build.lux@mailman.lmera.ericsson.se
csh_limit                 4000
editor                    vi
extended_default          1
extra_siteconfig          <undef>
home                      /app/vbuild/tools/modulestcl/5.0.1
icase                     search
ignored_dirs              CVS RCS SCCS .svn .git .SYNC .sos
implicit_default          1
implicit_requirement      0
list_output               header:idx:variant:sym:tag:key
list_terse_output         header
locked_configs            
mcookie_version_check     1
ml                        1
nearly_forbidden_days     14
pager                     
quarantine_support        0
rcfile                    <undef>
run_quarantine            <undef>
search_match              starts_with
set_shell_startup         0
shells_with_ksh_fpath     
silent_shell_debug        0
siteconfig                /app/vbuild/tools/modulestcl/5.0.1/etc/siteconfig.tcl
tag_abbrev                auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS
tag_color_name            
tcl_ext_lib               /app/vbuild/tools/modulestcl/5.0.1/lib/libtclenvmodules.so
term_background           dark
term_width                0
unload_match_order        returnlast
variant_shortcut          
verbosity                 concise
wa_277                    0

- State name -----------.- Value ----------------------------------------------
always_read_full_file     1
autoinit                  0
clock_seconds             1652942817
cmdline                   /app/vbuild/tools/modulestcl/5.0.1/libexec/modulecmd.tcl bash config --dump-state
commandname               config
domainname                sero.gic.ericsson.se
error_count               0
extra_siteconfig_loaded   0
false_rendered            0
force                     0
hiding_threshold          0
inhibit_errreport         0
inhibit_interp            0
init_error_report         1
is_stderr_tty             1
is_win                    0
kernelversion             #1 SMP Fri Sep 24 10:17:16 UTC 2021
lm_info_cached            0
machine                   x86_64
modulefile                {}
nodename                  seroiuts00954.sero.gic.ericsson.se
os                        Linux
osversion                 3.10.0-1160.45.1.el7.x86_64
paginate                  0
path_separator            :
report_format             regular
reportfd                  stderr
return_false              0
shell                     bash
shelltype                 sh
siteconfig_loaded         1
sub1_separator            &
sub2_separator            |
subcmd                    config
subcmd_args               --dump-state
tcl_ext_lib_loaded        0
tcl_version               8.6.4
term_columns              238
try_modulefile            0
usergroups                eusers rnd npeeradiosw npeeradioswtpc
username                  ehhzeza

- Env. variable --------.- Value ----------------------------------------------
LOADEDMODULES             isit_modules
MODULEPATH                /app/modules/0/modulefiles:/env/sero/modules:/home/ehhzeza/.afs/0/imodules:/env/common/modules
_LMFILES_                 /home/ehhzeza/.afs/0/imodules/isit_modules

Additional context

@zzhang147 zzhang147 added the bug label May 19, 2022
@xdelaruelle
Copy link
Collaborator

@zzhang147 More information is expected to understand what the issue is. Especially, could you provide the output of the following command:

$ module config -DD --dump-state

And also the content of all the RC files that will be mentioned by this debug report.

@zzhang147
Copy link
Author

after a few minutes this issue not seen again.

@xdelaruelle
Copy link
Collaborator

After some searches, I have found that this error is obtained when the current working directory where the module command is executed is removed:

$ mkdir test
$ cd test
$ rmdir ../test
$ module
ERROR: error getting working directory name: no such file or directory
      while executing
  "pwd"
      (procedure "getAbsolutePath" line 9)
      invoked from within
  "getAbsolutePath $fpath"
      (procedure "cmdModuleSource" line 3)
      invoked from within
  "cmdModuleSource load $rc"
      (procedure "runModulerc" line 23)
      invoked from within
  "runModulerc"
      (procedure "module" line 110)
      invoked from within
  "{*}$execcmdlist"
  Please report this issue at https://github.com/cea-hpc/modules/issues

@xdelaruelle xdelaruelle added this to the 5.1.1 milestone May 21, 2022
@xdelaruelle xdelaruelle changed the title vscode R1.57.1 Execution from a removed working directory May 21, 2022
@xdelaruelle
Copy link
Collaborator

I am updating code to make it clear this situation is not a modulecmd.tcl issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants