Upgrade Octopus Linux Container, can't connect to SQL Server

I’m experiencing the same issues as mentioned here: Upgrade Linux Container - #3 by jeremy.miller

After upgrading the docker-compose file from 2020.6.5449 to 2021.1.7149 I can’t connect to the database anymore. Exactly as described in the other ticket.

My setup:

  • Docker compose (v3)
  • On premise SQL Server 2019 (but not in Docker) using a named instance
  • Octopus Deploy running as a Linux Container
  • A Nginx proxy for serving with a SSL certificate

I’ve tried the following steps:

  • Add “TrustServerCertificate=Yes” to the connectionstring
  • Telnet to my database, didn’t work (but I can’t telnet from version 2020.6.5449 either)
  • Completely disable the firewall on the database server
  • Updating to 2021.2.7590 didn’t help

There seems to be no logging in SQL Server whatsoever about connection failures or incorrect passwords.

Perhaps the issue is related to this one: https://github.com/dotnet/SqlClient/issues/839

I’ve checked and the version of Microsoft.Data.SqlClient in your latest docker image is as follows:
File version: 2.0.20168.4
Product version: 2.1.1+f8c274…

I think I can confirm that it is indeed that bug. If I change my connectionstring from:
Data Source=dev-db01\TOOLING
to
Data Source=dev-db01,49942
So we connect to the instance port directly, everything runs fine. This is of course a temporary workaround, but it seems that updating the SqlClient library to at least 2.1.2 should fix this issue permanently.

See this comment on GitHub: https://github.com/dotnet/SqlClient/issues/868#issuecomment-756320779

1 Like

Hi @infra,

Thanks a lot for reaching out; welcome to the forum, and apologies we couldn’t get back to you sooner.
It’s good to see you’ve identified the issue, and you have a workaround!

If someone else is experiencing the same issue that you were, they will hopefully find this post and be able to get unblocked, so thanks a lot for that!

I’ve reached out to our developers to see about bumping up the SqlClient version on the docker image.

If there’s anything else we can do to help with this, please let us know, and we’ll do our best to be of assistance.

Kind Regards,
Adam

Hi Adam,

I like to find the needle in the haystack, so I was happy that I could find the bug and glad to share it.

Have you heard anything from your developers yet? Since the current solution does work, but isn’t optimal at all, I would like to implement the version with the actual fix as soon as possible.

Kind regards,

Jan

Hi @infra,

I just got word back this morning that the developers have had a look at this.

They agreed that bumping the version up was best, you can see the progress on the issue here: GitHub Issue

It looks like there has been a fix pushed out that should be available in future versions.
Thanks once again for the suggestion and for reporting the issue + workaround.

Kind Regards,
Adam

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.