Getting Error when execute Invoke-sqlcmd for computername\instance

Hi Team,
I’m getting this error when trying execute the invoke-sqlcmd in the script console which running in the worker node .This is not happen when we execute directly from powershell in the same worker node. i guess there is the bug for octopus application.

Command from octopus


Error :
Invoke-sqlCmd : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Working fine when execute manually with powershell on the same worker node

Thanks in advance for your help.

Hi Dani,

Thank you for reporting what you’ve found. I suspect you might be right.

Can I ask a few more clarifying questions so that I can reproduce this at my end.
Are you on Octopus Cloud or Server? If you are using Octopus Server can you let me know the version.
Also, what type of worker are you running (O/S)?

I would like to request the complete log file as well just for clarity. Can you provide the raw Task Logs for the Deployment? Get the Raw Output From a Task - Octopus Deploy

Are the credentials your using, AD Credentials or SQL Server login credentials?

I will turn this ticket into a Private Message so you can provide your Logs without exposing them to the public.

Regards,

Dane