Failed to load sqljdbc_auth.dll when running octopack nuget package from octopus server

For database deployment we are planning to use liquibase as it provides better schema and script change version.
I have two environment Development(local machine) and Test(remote machine). When i ran console application project from visual studio 2013, it is deploying script changes to both machines successfully.
Then after when i create package through octopack and upload package to octopus server, after creating release for respective environment when i try to deploy package, for Development environment (local machine) it works fine but it gives error on Test environment (remote machine), please find the attachment of error from task log.
Also when we execute any step, i believe execution will happen on target machine and it would need required components to run i mean i require java command to run then it should be available on target machine.
Please check and let me know your suggestion, where i am going wrong.

I had already below steps to resolve this issue but no success.

  1. Made sure sqljdbc_auth.dll present in C:\Windows\System32 and path should be there in environment variable.
  2. Made sure sqljdbc_auth.dll present in C:\Program Files\Java\jre\bin and path should be there in environment variable.

Sqljdbc_auth.dll_Problem.txt (1 KB)

HI,

Thanks for reaching out. Have you tried registering it the DLL from Powershell using Add-Type already?

#At the top of the PS script where you are calling your Console application
Add-Type -Path "[Path]\sqljdbc_auth.dll"

That should be enough to load the library for the context of that PS script.

Thanks,
Dalmiro

Thanks for your reply, i implemented your DLL registering step in powershell script but now getting error could not load sqljdbc_auth.dll as dependencies could not be loaded or missing required menifest file, i believe this error indicating towards installation issue however can you suggest any thing i need to check from installation point of view. recently i installed jdk 8, apart from this installed teamcity, octopus and downloaded sqljdbc driver and manually put sqljdbc_auth.dll in system32 directory. let me know in case any more information required.

For your information, now i ran the .bat file with Run a Script deployment step by selecting Run on option as Octopus server it ran successfully on remote database but failed when run on option selected as Deployment target. So definitely issue with Tentacle deployment machine, let me know your suggestion what are the things i should validate on remote machine.

Hi there,

now getting error could not load sqljdbc_auth.dll as dependencies could not be loaded or missing required menifest file

Think about Add-type as your usual Using statement in C#. If you try to use a library that has dependencies, you need to make sure to add all those dependencies first.

I ran the .bat file with Run a Script deployment step by selecting Run on option as Octopus server it ran successfully on remote database but failed when run on option selected as Deployment target

Apparently you have these dependencies already registered in the GAC in your Octopus server, which is why your script is not complaining about missing libraries. Unfortunately I don’t know much about JDK (.Net guy here!), but the first thing I’d try to do is install the exact same things (JDK, drivers) that were installed on the Octopus server, on the Tentacle.

Sorry I can’t give you a more specific guidance. Hopefully this will help you in some way.

Best regards,
Dalmiro

Thanks for your support Dalmiro, i believe there is something wrong at my tentacle machine. i need to your help in more query, substitute variable in file this option is only available through configure feature in deploy a package step , is there any way where substitute variable in file option can be integrated in Run a script step.

Let me now if you required more details related to my query.

Hi,

Instead replacing variables in your script, why don’t you just use them as plain powershell variables? For example:

  1. Create a variable called “Message” with the value “Hello world!”
  2. Add a “run a script” step with the body “Write-output $message”
  3. Create and deploy a release.

That way you don’t have to rely on any modifications, just raw powershell.

Thanks,
Dalmiro