Problems calling package after restart

79 views
Skip to first unread message

reiche...@gmail.com

unread,
May 8, 2017, 9:31:26 AM5/8/17
to opencpu
I am using OpenCPU to call a custom R-package developed by a co-worker. I installed the package on a brand new server (hosted on AWS) that has been configured with OpenCPU. I can logon to the server and call the package using curl

Once I reboot the server the call through OpenCPU stops working. I get a mix of error messages (see below). I can call the package directly from an R session on the server after a reboot with no problems. There is plenty of memory available on the server - over 5GB. I can see the requests in the apache2 /var/log/apache2/access.log file, but no errors in the error.log.

Any guidance to help diagnose this problem would be appreciated.



Here is the curl command I use to test the package through OpenCPU:

curl --data "param1=1&param2=2&param3=3" https://myserver.com/ocpu/library/mypackage/R/myfunction/json?datafram=columns



Here are some of the error messages that come back:

Example error 1:

promise already under evaluation: recursive default argument reference or earlier problems?

In call:
doWithOneRestart(return(expr), restart)


Example error 2:

curl: (56) GnuTLS recv error (-110): The TLS connection was non-properly terminated.


Example error 3:

unable to allocate memory (in GEregister)

In call:
pdf(tempfile(), width = 11.69, height = 8.27, paper = "A4r")

Jeroen Ooms

unread,
May 8, 2017, 9:34:55 AM5/8/17
to ope...@googlegroups.com
Which version of opencpu are you running? Try restarting the server
after a reboot:

service opencpu restart

This week opencpu 2.0 which resolves all the init problems.
> --
> You received this message because you are subscribed to the Google Groups "opencpu" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opencpu+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

reiche...@gmail.com

unread,
May 8, 2017, 11:15:55 AM5/8/17
to opencpu, reiche...@gmail.com
According to dpkg:

ii opencpu-lib 1.6.7-xenial amd64 Package containing the platform s
ii opencpu-server 1.6.7-xenial all The OpenCPU cloud server based on


OpenCPU package info reports an error:
$ curl https://analytics.sandbox.forecast.one/ocpu/library/opencpu/info
lazy-load database '/usr/lib/R/library/base/R/base.rdb' is corrupt


I tried restarting the open cpu service as you suggested. I get a different error message now when calling my package:
cannot allocate vector of size 63 Kb


Any links to documentation of the "init problems" you mentioned would be helpful.

Thanks!

John

Jeroen Ooms

unread,
May 8, 2017, 11:17:11 AM5/8/17
to ope...@googlegroups.com, reiche...@gmail.com
On Mon, May 8, 2017 at 4:31 PM, <reiche...@gmail.com> wrote:
> I tried restarting the open cpu service as you suggested. I get a different error message now when calling my package:
> cannot allocate vector of size 63 Kb

That suggests that your system is out of memory. Which AWS instance
type did you get? R requires quite a bit of memory

reiche...@gmail.com

unread,
May 8, 2017, 12:09:55 PM5/8/17
to opencpu, reiche...@gmail.com
I'm definitely not out of memory. I ran this on a T2 large, which has 8GB of RAM. free reports over 5GB of free:

$ free
total used free shared buff/cache available
Mem: 8173768 1791180 5156884 9016 1225704 6111548


Also, I can call the package/function directly from an R session on the server.

Jeroen Ooms

unread,
May 8, 2017, 12:20:43 PM5/8/17
to ope...@googlegroups.com, reiche...@gmail.com
That's very strange. Do you get the "cannot allocate" error just for
the info page? Or when calling your package procedure? Perhaps there's
a hint in the log files:

sudo tail -n100 /var/log/kern.log

If your package uses a lot of memory, you can try raising "rlimit.as"
inside /etc/opencpu/server.conf. But I doubt that's the problem here.

You may also want to try the beta release of the 2.0 version, it's
basically done and fixes a bunch of issues on recent linux systems.
Installation is the same:

sudo add-apt-repository -y ppa:opencpu/opencpu-2.0
sudo apt-get update
sudo apt-get upgrade
Reply all
Reply to author
Forward
0 new messages