WeBWorK Main Forum

Rserve no longer works after upgrade from 2.13 to 2.14

Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
Number of replies: 10
Problems requiring R no longer work after upgrading webwork and pg to version 2.14 from 2.13. Does Rserve work for others after this upgrade?

The error message is:

1. ERROR caught by Translator while processing problem file:Library/UBC/STAT/STAT305/set2/hw02_q3.pg
****************
ERRORS from evaluating PG file:
Unrecognized response type: at line 129 of [PG]/macros/RserveClient.pl
Died within Carp::croak called at line 342 of /usr/local/share/perl5/Statistics/R/IO/Rserve.pm
from within Statistics::R::IO::Rserve::_send_command called at line 234 of /usr/local/share/perl5/Statistics/R/IO/Rserve.pm
from within Statistics::R::IO::Rserve::eval called at line 129 of [PG]/macros/RserveClient.pl
from within main::rserve_start called at line 51 of (eval 2197)

In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Andras Balogh -
This particular question works for us with 2.14.
Some other examples like using pi and exporting matrices into csv files using Rserve also work.

But for example Library/UBC/STAT/STAT300/hw07/stat300_hw07_q02.pg does not work with error message
ERRORS from evaluating PG file:
Error in png("/tmp/RtmpngQVBM/file5bcd2d3abba0.png", width = , height = ) :
X11 is not available
Died within Rserve::try_eval called at line 146 of [PG]/macros/RserveClient.pl
from within main::rserve_eval called at line 175 of [PG]/macros/RserveClient.pl
from within main::rserve_start_plot called at line 68 of (eval 5056)

In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
We have R version 3.5.0 (2018-04-23) so it's possible R was updated and we did not notice the broken problems requiring Rserve.

I tried to install the latest version of Rserve. It did not cure the error. I am not completely sure I was successful with the installation. How can I check if I have the right Rserve version running?

R CMD Rserve

gives:

R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Rserv started in daemon mode.
In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Danny Glin -
From the R shell you can run
packageVersion("Rserve")

It looks like the most recent version in CRAN is 1.7.3. The version I'm running (which was installed from source) is 1.8.6.

As mentioned in the other thread I needed to install some SSL libraries to get the Rserve package to compile. In the RedHat world the package needed was openssl-devel. IIRC, there was an error buried in the middle of the Rserve installation. I think the missing file was libssl.so, so if you're not using some flavour of RedHat, you might have to find the corresponding package on your system which contains that.
In reply to Danny Glin

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
packageVersion("Rserve")
shows
[1] ‘1.8.6’

I did install openssl-devel and the compilation of Rserve seemed fine.

In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Danny Glin -
Have you restarted Rserve since the package update?
In reply to Danny Glin

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
I did

killall -INT Rserve

followed by

R CMD Rserve

followed by an apache restart.
In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Danny Glin -
Hmm... I'm running out of ideas.

Are you running Rserve as the same user with which you installed the latest version of the package? It's possible that the new version got installed for a single user and not globally.
In reply to Danny Glin

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
I am not sure. Which user should run Rserve? How can I verify?
In reply to Nandor Sieben

Re: Rserve no longer works after upgrade from 2.13 to 2.14

by Nandor Sieben -
I think I have found the solution. During the installation of the new version of Rserve, there was an unnoticed error message:

cannot create regular file ‘/usr/lib64/R/bin/Rserve’: Text file busy

This was because the previous version of Rserve was running. The solution is this:

0. sudo yum install openssl-devel
1. sudo killall -INT Rserve
2. sudo mount -o remount,exec /tmp
3. sudo R
install.packages('Rserve',,"http://rforge.net/",type="source")
4. sudo mount -o remount,noexec /tmp
5. sudo systemctl start rserve