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

Help with "Error in rethrow_call" #97

Open
rempsyc opened this issue Jul 30, 2020 · 8 comments
Open

Help with "Error in rethrow_call" #97

rempsyc opened this issue Jul 30, 2020 · 8 comments

Comments

@rempsyc
Copy link

rempsyc commented Jul 30, 2020

After installing and loading:

install.packages("webshot")
webshot::install_phantomjs()
library(webshot)

I run:

example(webshot)

Or the examples in the readme.md:

webshot("https://www.r-project.org/", "r.png")

And I consistently get:

Error in rethrow_call(c_processx_exec, command, c(command, args), stdin,  : 
  Command 'C:/Users/username/Documents/R/win-library/3.6/processx/bin/x64/supervisor.exe' not found @win/processx.c:983 (processx_exec)
Type .Last.error.trace to see where the error occured

Any idea why?

@wch
Copy link
Owner

wch commented Jul 30, 2020

It sounds like your installation of processx has a problem. Try reinstalling it (in a new R session).

@rempsyc
Copy link
Author

rempsyc commented Jul 31, 2020

I reinstalled processx in a new R session, but same error. So I manually uninstalled from RStudio and reinstalled again, but same thing.

I wonder whether it could be due to my username having spaces and accents (though I cannot change it). I know it has given me some trouble with other packages in the past. Also, my last error trace:

> .Last.error.trace

 Stack trace:

 1. webshot:::webshot("https://www.r-project.org/", "r.png")
 2. webshot:::phantom_run(args)
 3. callr::process$new(phantom_bin, args = args, stdout = "|", stderr = "|",  ...
 4. .subset2(public_bind_env, "initialize")(...)
 5. processx:::process_initialize(self, private, command, args, stdin,  ...
 6. processx:::supervisor_watch_pid(self$get_pid())
 7. processx:::supervisor_ensure_running()
 8. processx:::supervisor_start()
 9. process$new(supervisor_path(), args = c("-p", Sys.getpid(), "-i",  ...
 10. .subset2(public_bind_env, "initialize")(...)
 11. processx:::process_initialize(self, private, command, args, stdin,  ...
 12. rethrow_call(c_processx_exec, command, c(command, args), stdin,  ...

 x Command 'C:/Users/username/Documents/R/win-library/3.6/processx/bin/x64/supervisor.exe' not found @win/processx.c:994 (processx_exec)

@wch
Copy link
Owner

wch commented Jul 31, 2020

If this causes the same error, then the problem is definitely with processx:

processx::process$new("echo", "hello", supervise = TRUE)

Weird characters could definitely be a problem in launching the processx supervisor. I suggest filing an issue at https://github.com/r-lib/processx/issues, and report which weird characters you have in the path.

@rempsyc
Copy link
Author

rempsyc commented Jul 31, 2020

Correct! The command does output the same error. I'll reach out to processx. Thanks.

Note: actually it isn't the same command that isn't found but pretty close so definitely something with processx.

> process$new("echo", "hello", supervise = TRUE)

Error in rethrow_call(c_processx_exec, command, c(command, args), stdin,  : 
  Command 'echo' not found @win/processx.c:994 (processx_exec)
Type .Last.error.trace to see where the error occured

@wch
Copy link
Owner

wch commented Jul 31, 2020

Oh, I forgot that windows might not have echo. Try dir instead of echo and see what message that gives.

@rempsyc
Copy link
Author

rempsyc commented Jul 31, 2020

Same (Windows 10 here).

> process$new("dir", "hello", supervise = TRUE)

Error in rethrow_call(c_processx_exec, command, c(command, args), stdin,  : 
  Command 'dir' not found @win/processx.c:994 (processx_exec)
Type .Last.error.trace to see where the error occured

> .Last.error.trace

 Stack trace:

 1. process$new("dir", "hello", supervise = TRUE)
 2. .subset2(public_bind_env, "initialize")(...)
 3. processx:::process_initialize(self, private, command, args, stdin,  ...
 4. rethrow_call(c_processx_exec, command, c(command, args), stdin,  ...

 x Command 'dir' not found @win/processx.c:994 (processx_exec) 

@gaborcsardi
Copy link

Oh, I forgot that windows might not have echo. Try dir instead of echo and see what message that gives.

FWIW dir is also not a Windows executable:

> Sys.which("dir")
dir
 ""
> Sys.which("echo")
echo
  ""
> Sys.which("cmd")
                             cmd
"C:\\Windows\\SYSTEM32\\cmd.exe"

@rempsyc
Copy link
Author

rempsyc commented Aug 5, 2020

@wch Update: problem seems fixed(!) after updating to R version 4.0.2 for:

library(webshot)
webshot("https://www.r-project.org/", "r.png")

@gaborcsardi is correct I believe as process$new("dir", "hello", supervise = TRUE) still doesn't work though.

Thanks to you all!

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

No branches or pull requests

3 participants