Intermittent connection from Node.js to IRIS
I'm using a customised IRIS Community Edition Docker Container: Node.js has been added and the Native API for Node.js directory moved to a node_modules folder in /home/irisowner. I've changed the _SYSTEM password using the Management Portal (which connects to IRIS just fine)
If I shell into the running container and try to connect with a JS script file containing this:
const IRISNative = require('intersystems-iris-native');
let connectionInfo = {
host: 'localhost',
port: 1972,
ns: 'USER',
user: '_SYSTEM',
pwd: 'secret',
sharedmemory: true,
timeout: 5,
logfile: './mylogfile.log'
};
const conn = IRISNative.createConnection(connectionInfo);
...then sometimes it will connect OK, but many times it will give me an ERROR_SERVER_TIMEOUT error
Anyone know what the problem might be? Why would I get such an intermittent network connection to IRIS?
Comments
Have you tried to change the timeout? The documentation says that timeout is defined in milliseconds, maybe you are waiting just 5 milliseconds.
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
That was exactly the problem! I'd not checked the timeout units. I increased to 50 and now it's stable. Many thanks!