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

ggplot exception causes the server-side R session to halt #50

Open
wliao229 opened this issue May 28, 2019 · 13 comments
Open

ggplot exception causes the server-side R session to halt #50

wliao229 opened this issue May 28, 2019 · 13 comments

Comments

@wliao229
Copy link

I am using a ssh tunnel to connect to the server.

ssh -4 <server addr> -L 55556:127.0.0.1:55555 'Rscript -e "remoter::server(port=55555)"'

I notice whenever there is an exception using ggplot, the server R process will halt. For example, I receive such error message from the server's log:

Calls: <Anonymous> ... f -> scales_add_defaults -> lapply -> FUN -> paste0
Execution halted

This error is related to a wrong variable specified for ggplot. It seems like the exception is not handled by the server.

@snoweye
Copy link
Member

snoweye commented Jun 14, 2019

Please check if the PR #52 fixes the problem or not. Thanks.

Note that the server R process is dead not halt, but the client R process halts. Ctrl-c can escape the client.

@wliao229
Copy link
Author

Thank you. I got this error when install it.

> devtools::install_github('snoweye/remoter')
Downloading GitHub repo snoweye/remoter@master
pdflatex not found! Not building PDF manual.
   Warning: unknown option ‘--no-staged-install’
✔  checking for file ‘/tmp/Rtmp8K605u/remotes45bc61fefc55/snoweye-remoter-aef7d8b/DESCRIPTION’ ...
─  preparing ‘remoter’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
         -----------------------------------
─  installing *source* package ‘remoter’ ...
   ** using staged installation
   ** R
   ** inst
   ** byte-compile and prepare package for lazy loading
   ** help
   *** installing help indices
   ** building package indices
   ** installing vignettes
   ** testing if installed package can be loaded from temporary location
   ** testing if installed package can be loaded from final location
   ** testing if installed package keeps a record of temporary installation path
   ERROR: hard-coded installation path: please report to the package maintainer and use ‘--no-staged-install’
─  removing ‘/tmp/Rtmp5dWHDT/Rinst480946e73cef/remoter’
         -----------------------------------
   ERROR: package installation failed
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
  System command error

@snoweye
Copy link
Member

snoweye commented Jun 14, 2019

Please try the newest update again. Thanks.

  • You may need a newer R (maybe > 3.7) to have --no-staged-install.
  • There is no src/ in remoter, so I have no idea where hard-coded installation path comes from.

@howff
Copy link

howff commented Feb 5, 2021

I have tried this but I still get a crash when I use ggplot and mistype a variable name

[2021-02-05 19:14:33]: client connected
Error in FUN(X[[i]], ...) : object 'Sepal.Widths' not found
Calls: <Anonymous> ... <Anonymous> -> f -> scales_add_defaults -> lapply -> FUN
Execution halted

Bonus question: when this gets fixed will it be possible to get a new version pushed to CRAN ?

@snoweye
Copy link
Member

snoweye commented Feb 15, 2021

Try if this update fixes the problems. @howff

@howff
Copy link

howff commented Feb 21, 2021

The change from if (ret$visible && is.gg.ggplot(ret$value) && is.rpng.open())
to if (ret$visible && is.gg.ggplot(ret$value)) seems to be the correct fix for my problem, thank you very much.

@snoweye
Copy link
Member

snoweye commented Feb 21, 2021

Thanks. @wrathematics may send this to CRAN when he has time.

@wrathematics
Copy link
Member

There are some strange things going on with one of the windows cran machines (which affect remoter) that I'm keeping an eye on. Will submit an update soon.

@snoweye
Copy link
Member

snoweye commented Feb 23, 2021

0.4-0 on R release and 0.4-1 on R release look both fine to me. Just send to R winbuilder for three R versions which you will receive the report.

@wrathematics
Copy link
Member

Referring to this.

@snoweye
Copy link
Member

snoweye commented Feb 23, 2021

Yes, I saw that and test for released R on windows. Did you get the same message from CRAN? If so, I need the log file to fix. If not, then you should be fine. I think it is related to tests/batch.R. If the server did not receive shutdown() from CRAN. It will hang forever because it is a system() call in background. I will add an automatic kill in 5 mins for windows if that is possible. Let me try.

@snoweye
Copy link
Member

snoweye commented Feb 24, 2021

I add a file check to make sure server is running in the tests/batch.R. Connect check would not work because zmq_connect return 0 when addr = localhost.

@snoweye
Copy link
Member

snoweye commented Feb 27, 2021

I add all socket options to pbdZMQ. The CONNECT_TIMEOUT with SNDTIMEO and RCVTIMEO may help on this, but it needs to rewrite a lot of server() and client() ... This is somehow related to this, too. @wrathematics

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

4 participants