Hello guys,
I am currently working on an automation script that connects via SSH (Username & Password / no ssh key) to a server and reads from a database.
When I run the script locally on my PC, it works fine. I also ran it directly on the Dataminer server and it works there too. I receive all data of the extern database.
However, when I run it through the automation script solution, I always get a “host key not verified” error. I execute the automation script with a low code app.
Even if I open a terminal on the Dataminer server, I can connect via SSH and interact with the remote server without any problems. I also tried setting trust server to true in my code, but it still doesn’t work.
Does anyone have any ideas what could be causing this?
Thanks
Thank you for the answer.
I believe the issue was that the library versions did not match the Dataminer’s dependencies. After downgrading them, I was finally able to connect to the server.
Unfortunately, the database interaction is now broken with the older versions.
Encountered errors while executing script: (after retries) (Code: 0x80040251) Skyline.DataMiner.Net.Exceptions.DataMinerException: No Assembly found for cookie 137 error CS0009: Metadata file 'C:Skyline DataMinerProtocolScriptsDllImportmysql.data8.0.32libnet48krbcc64.dll' could not be opened — PE image doesn't contain managed metadata. error CS0009: Metadata file 'C:Skyline DataMinerProtocolScriptsDllImportmysql.data8.0.32libnet48krb5_64.dll' could not be opened — PE image doesn't contain managed metadata. error CS0009: Metadata file 'C:Skyline DataMinerProtocolScriptsDllImportmysql.data8.0.32libnet48k5sprt64.dll' could not be opened — PE image doesn't contain managed metadata. error CS0009: Metadata file 'C:Skyline DataMinerProtocolScriptsDllImportmysql.data8.0.32libnet48gssapi64.dll' could not be opened — PE image doesn't contain managed metadata. error CS0009: Metadata file 'C:Skyline DataMinerProtocolScriptsDllImportmysql.data8.0.32libnet48comerr64.dll' could not be opened — PE image doesn't contain managed metadata. (72,11): warning CS0219: The variable 'click' is assigned but its value is never used at CManagedAutomation.RunWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* pvarReturn, String scriptName) at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, tagVARIANT* pvarEntryPointResult)
My guess is that dataminer runs with 32 bit but my script use 64 bit libraries / dlls.
The root cause of this issue was incompatible libraries. VS Studio had a newer version of the library installed, and everything worked fine there.
However, the automation script was using an older version of the library, even though VS Studio displayed the latest version. The dataminer had an older version of the Bouncy Castle Crypto library, which conflicted with the newer version.
To resolve this, I rewrote my code to remove dependencies on that library and used only my SQL connector instead of MySQLData, while also switching to an older version of SSH.NET.
MySQLData caused issues because my libraries were compiled as 64-bit, but the automation script ran in 32-bit, so the library failed.
After switching to SQLConnector and the older SSH.NET library, I can now retrieve the data successfully.
The error message “host key not verified” is misleading.
Hi Ömer, even if I'm not sure what you are using in your script (assumeing openSSH) please make sure you're using the same user for the automation script that you used directly on the server. With a local connection, the key is stored in the `.ssh/known_hosts` file in the settings of the locally used user. If you're using different users in your LCA, you can try impersonating a different user. You can find an example of this in the Sagemcom SANA driver.
As an alternative you can try bypass the host key checking: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null