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

Issue with persistent login credentials #34

Closed gcnovak closed 3 years ago

gcnovak commented 3 years ago

I am receiving this error message: 17 Aug 08:29:22 - [info] [MSSQL-CN:SQLSExpress2019] Error connecting to server : localhost\SQLEXPRESS, database : NodeRedTest, port : 1433, user : ConnectionError: Login failed for user ''.

The MSSQL-CN doesn't appear to be saving or rather reading the login credentials once deployed. Before I deploy, if I check the credentials they are there, but after deploying they are gone. I see an encrypted value in the flows__cred.json file.

I have this working on my work machine just fine (windows 10), but for some reason on my home dev box (windows 10) is not reading the info back in and thus not passing the login upon running the flow.

I've done the following so far:

Obviously, it is something on my home development machine, but any suggestions would be helpful.
Thank you, Greg

gcnovak commented 3 years ago

One thing I do notice different between my two dev machines. The flows_computername_cred.json file where it is working has an encryption char = 128 vs my dev machine not working of only 36 chars. Maybe the credentials are not being written to the cred file?

Also, it does save other settings fine, only the username, password, and domain fields are not being saved. It appears. Thanks

Steve-Mcl commented 3 years ago

Hi Greg,

The flows_computername_cred.json file where it is working has an encryption char = 128 vs my dev machine not working of only 36 chars

is the cred file on the dev machine being updated (check the timestamp) - perhaps its a permissions issue (you may have installed or ran NR as an admin & now the files permissions are too tight?)

PS, I have tried the latest version 0.5.0 from NPM also (as opposed to running from the source code version that I published yesterday) and it works ok for me.

EDIT... What happens if you add say an MQTT config - are those credentials retained?

gcnovak commented 3 years ago

@Steve-Mcl Yes, the file was being updated and when I deleted it, it would be recreated without issue. I tried copying the cred encryption string from my work computer and loaded NR. When I did that it flagged it as an invalid encryption (probably machine based encryption). It forced me to delete the cred file and re-enter the credentials. Then it worked. Rather odd.

As a Node developer, I tried everything I could think of before contacting you.

Thank you for the quick response though.