bestlong / node-red-contrib-mssql-plus

A Node-RED node to read and write to Microsoft MS SQL Databases
MIT License
31 stars 18 forks source link

Tarn: opt max. must be an Integer > 0 #28

Closed pedrossag closed 4 years ago

pedrossag commented 4 years ago

Hi I am running NodeRed 1.0.3 together with node-red-contrib-mssql-plus 0.4.0. When executing queries on the server, I get the error message: 'Tarn: opt max. must be an Integer > 0' right below the node. Tried to google it but did not find anything useful. DB is SQL Server Standard 2017. 25 03

Thanks for your help! klib

pedrossag commented 4 years ago

After hacking around I've hardcoded Polsize max to 5 regardless of the node config. Restarted nodered and the problem was gone. Reset the js code to default and it is still working after restarting nodered.

Can anyone explain this behaviour? And what is Tarn and opt??

Steve-Mcl commented 4 years ago

Hi, could you provide more info please?

What did you hack? Where did you set max to 5?

Let us know & I'll get it look at.

Thanks.

pedrossag commented 4 years ago

Hi, thank you for the reply. I've modified mssql.js and changed the pool object s.t. it ignores the max from node red: pool: { max: 5, //was: parseInt(config.pool), min: 0, idleTimeoutMillis: 3000, //log: (message, logLevel) => console.log(POOL: [${logLevel}] ${message}) } As I mentioned in the original post, I was not able to reproduce the error even after resetting the code to default. It looks like there was kind of a misconfiguration that got resolved somehow. Because of that I was curoius about the error messages meaning.

Steve-Mcl commented 4 years ago

So, I suspect config.pool - did you perhaps import a flow or upgrade from another MSSQL node?

If so, then pool may not have been present in the flow.

That explains why once you set it & deployed, your flow got a value for pool (and therefore the error disappeared.

I will handle this issue and others to improve the importing of flows without certain properties.

Will update REPO and NPM today & feedback.

pedrossag commented 4 years ago

Hmm.. I've updated NodeRed as well as the MSSQL Node. So this might have caused the issue.

Thanks for your support and your commitment to this project!

klib