Closed ftrianakast closed 10 years ago
Try to enable debug mode and check your Rserve configuration about remote and authentication options.
Can you provide any snippet using rio?
Hi Alberto!
I am using a simple call now and fails with SIGPIPE
again. My Rserve configuration looks like this:
remote enable
auth disable
fileio enable
maxinbuf 5000000
I am trying from node-rio using this snippet:
Rio.evaluate("pi / 2 * 2", {
host: 'my_host',
port: 6311
})
The call arrives to Rserve but SIGPIPE signal is launched.
I also put on DEBUG mode Rserve
Enable debug on client side.
rio.enableDebug(true);
rio.evaluate...
Anyway, firstly I would try with RSclient package.
For instance,
library(RSclient)
c <- RSconnect(host = "my_host", port 6311)
RSeval(c, "2+2")
Using RSclient has not problem. The Rserve responds well, without SIGPIPE. Just in case i also use this node_module https://www.npmjs.org/package/rserve-client, and it also works. Setting Rio on debug mode, the console prints this:
Connected to Rserve
Supported capabilities --------------
Sending command to Rserve
00000000: 0300 0000 1000 0000 0000 0000 0000 0000 ................
00000010: 040c 0000 7069 202f 2032 202a 2032 0001 ....pi./.2.*.2..
Disconnected from Rserve
Closed from Rserve
I believe that this that i will say is important: I am using a Linux container (LXC) to mount Rserve. For that purpose I am using docker project https://www.docker.io/. The problem is solved if i do not use a LXC. Just is curious for me that Rserve on LXC works with other libraries and not with node-rio. If you want to reproduce the error, just for curiosity, you can use this Dockerfile
https://gist.github.com/ftrianakast/10272777
Run the docker container using this:
docker run -p 6311:6311 --name Rserve image_name
Thanks a lot for the details.
I need to investigate further.
Due to race conditions (and my poor workflow), maybe the socket is closed too early. https://github.com/albertosantini/node-rio/blob/master/lib/rio.js#L319
Try to comment out that line and repeat the test with LXC, please.
Yes Alberto is that. I comment the line and all work perfectly
Thanks a lot
Great. Thanks for the try.
I will fix it in the next hours.
(Te molestare de nuevo cuando he terminado de arregrarlo :)
Published release 1.2.1. Thanks for your time.
Hi!
I am trying to communicate with a remote Rserve. Locally the nodejs app and Rserve work fine together. However when i use a remote server, Rserve simply says:
I figured that is an error on client because
SIGPIPE
will be generated when a process writes to a pipe which has been closed by the reader (nodejs app). Probably rio needs to keep alive the connections. When I debug node-rioconnect
,disconnect
andclose
events are emitted one after another immediately. I think that something is missing in Rio (probably something related with socket management). Correct me otherwise, but i am trying it 2 days ago i can not solve it.