简体   繁体   中英

OpenCPU - Failed to set rlimit. ENOSYS

I already installed OpenCPU on a Ubuntu Server - Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64) - and everything worked perfectly without any problems. Here I want to say that I really like this API and I am very thankful for all the effort from the people (I think mostly Jeroen Ooms) working on it. Now I installed it again, but on another Server hosted at another provider. It is also a Ubuntu Server - Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-042stab093.4 x86_64) - and therefore I expected it to work as smoothly as before. But now I have a problem. After the installation and starting the service, I wanted to check through my browser if everything is OK. So I just opened http://xxx.xxx.xxx.xxx/ocpu like it worked on my other server. This time my browser doesn't show the OpenCPU API Explorer, but the following message:

Failed to set rlimit. ENOSYS

In call:
rlimit_wrapper("rlimit_as", hardlim, softlim, pid, verbose)

The server only has 1GB of physical memory, so I thought changing the "rlimit.as" to 1e9 instead of the standrd 2e9 would fix the problem (I also tried 750000000 and 500000000), but nothing helped (of course I restarted the service opencpu again after each change). I also think that this is not the problem, because I guess the server would use virtual memory when an operation uses more than one GB. I think the problem has to do with RAppArmor. So I tried to disable it and restart opencpu, but the problem didn't vanish:

$ sudo aa-disable usr.bin.r Disabling /etc/apparmor.d/usr.bin.r. Traceback (most recent call last): File "/usr/sbin/aa-disable", line 30, in tool.cmd_disable() File "/usr/lib/python3/dist-packages/apparmor/tools.py", line 148, in cmd_disable raise apparmor.AppArmorException(cmd_info[1]) apparmor.common.AppArmorException: 'Warning: unable to find a suitable fs in /proc/mounts, is it mounted?\\nUse --subdomainfs to override.\\n'

So does anyone know what the problem here could be or has any suggestions where to look for a solution (I tried to google already, but didn't find anything helpful)?

I don't think anything of the following is the cause of the problem, but since I'm not sure, I add these warnings anyways:

The only strange thing I encountered during the OpenCPU installation was this message (which appeared 4 times):

iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

But afterwards it said:

 * Reloading nginx configuration nginx          [ OK ]
OK
Setting up opencpu (1.4.4-trusty15) ...

Also when I tried to install RAppArmor separately, I got the following warning:

perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = (unset) are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Selecting previously unselected package r-cran-rapparmor.

And also this one:

Warning: unable to find a suitable fs in /proc/mounts, is it mounted?\\nUse --subdomainfs to override.\\n

Thanks in advance!

It looks like your new hosting provider uses some sort of virtualization system that has a shared kernel which limits all kind of linux functionality, including rlimit, iptables and probably apparmor. Is an actual cloud host, or something you setup yourself?

It would be helpful to debug this in R (outside of opencpu). On your server, start R in the console and type:

library(RAppArmor, lib="/usr/lib/opencpu/library")
rlimit_as(1e9)
rlimit_fsize(1e9)
rlimit_cpu(1e5)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM