remoter icon indicating copy to clipboard operation
remoter copied to clipboard

ggplot exception causes the server-side R session to halt

Open wliao229 opened this issue 6 years ago • 13 comments

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.

wliao229 avatar May 28 '19 01:05 wliao229

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.

snoweye avatar Jun 14 '19 02:06 snoweye

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

wliao229 avatar Jun 14 '19 02:06 wliao229

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.

snoweye avatar Jun 14 '19 20:06 snoweye

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 ?

howff avatar Feb 05 '21 19:02 howff

Try if this update fixes the problems. @howff

snoweye avatar Feb 15 '21 06:02 snoweye

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.

howff avatar Feb 21 '21 18:02 howff

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

snoweye avatar Feb 21 '21 20:02 snoweye

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.

wrathematics avatar Feb 22 '21 13:02 wrathematics

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.

snoweye avatar Feb 23 '21 01:02 snoweye

Referring to this.

wrathematics avatar Feb 23 '21 16:02 wrathematics

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 avatar Feb 23 '21 23:02 snoweye

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 avatar Feb 24 '21 06:02 snoweye

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

snoweye avatar Feb 27 '21 21:02 snoweye