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

Error when debugging R functions on a remote machine #1057

Open
dapritchard opened this issue Oct 14, 2020 · 0 comments · May be fixed by #1100
Open

Error when debugging R functions on a remote machine #1057

dapritchard opened this issue Oct 14, 2020 · 0 comments · May be fixed by #1100

Comments

@dapritchard
Copy link
Contributor

Sometimes when working on a remote machine when I flag an R function for debugging (using e.g. ess-debug-flag-for-debugging) and then run the function, I get an error such as error in process filter: ess-r-package-source-dirs: Opening directory: No such file or directory, /share/projects/P0025, and the tracebug visual debugging tools don't work (although the usual R debugger is still functional). The stack trace looks like the following.

Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/share/projects/P0025")
  directory-files-and-attributes("/share/projects/P0025" t "\\`[^.]")
  ess-r-package-source-dirs()
  ess--dbg-find-buffer("/share/projects/P0025/R/analy-utils.R")
  ess--dbg-create-ref-marker("/share/projects/P0025/R/analy-utils.R" "8" nil)
  ess--dbg-goto-ref(inferior-ess-mode "/share/projects/P0025/R/analy-utils.R" "8" nil)
  apply(ess--dbg-goto-ref inferior-ess-mode ("/share/projects/P0025/R/analy-utils.R" "8" nil))
  ess--dbg-goto-last-ref-and-mark(#<buffer  *ess.dbg.R:2*> inferior-ess-mode)
  inferior-ess-tracebug-output-filter(#<process R:2> "debugging in: create_target_subgroup_nms()\ndebug at /share/projects/P0025/R/analy-utils.R#8: {\n    target_nms <- create_target_nms()\n    subgroup_nms <- c(\"full\", \"agegt75\", \"recentfrac\", \"beforeoct2015\", \n        \"afteroct2015\")\n    subgroup_regexes <- setNames(paste0(\"analybase_\", subgroup_nms), \n        subgroup_nms)\n    map(.x = subgroup_regexes, .f = grep, x = target_nms, value = TRUE)\n}\n")

I believe that this error is a result of some confusion between strings specifying remote and local paths. In ess-r-package-source-dirs, the value of pkg-root is assigned to a string providing a local path for the project root (as determined by ess-r-package-info). Then when the directory-files-and-attributes function takes this path as an input it looks for the directory on the local machine and if it doesn't exist then it throws an error.

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

Successfully merging a pull request may close this issue.

2 participants