-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A network-related or instance-specific error occurred while establishing a connection to SQL Server. On AWS Lambda #839
Comments
After a bit more investigation I think this is a Linux vs Windows thing, and doesn't have anything to do with AWS, Lambda, or the fact that the database is hosted outside AWS. |
Is the issue still Microsoft.Data.SqlClient related? If yes, can you provide us a sample repro? besides that can you share your connection string properties? |
Yes, It is definitely the library. There doesn't seem to be much to the repro it fails the instant you call Open: var con = new SqlConnection(conString);
con.Open(); The trick seems to be that it only occurs on certain platforms, and not others (Win 10 is fine, but whatever underpins the lambda runtime, Amazon Linux 2 I assume, is not). Whatever caused this was introduced in the latest release, every prior version this same code works just fine. The connection string looks like this:
|
Psychic debugging attempt. Look at the tls versions that the linux machine you're using has setup, recent docker containers on things like alpine have had known problems with not enabling the required version. |
@pnquest we did not drop support for TLS versions. our driver captures the requested TLS from user and passes that to Sql server. Saying that, if anything happens it will happen at server side not at the driver level. |
@pnquest can you test your application with the latest hotfix release of 2.1.1 to see if the issue comes up? |
@JRahnama Unfortunately, it did not solve the issue. The error remains the same. |
Could you also try with 2.1.0 preview 1 and 2 versions to help us reach change-set that causes this issue? |
@cheenamalhotra I just tried both. Preview 1 works fine, but preview 2 fails. |
I can confirm the same issue running version 2.1.1 in a docker container |
Hi @pnquest PR #874 will fix this issue it seems since you're connecting to Instance name as well. We shall release this fix in v2.1.2 patch version soon. |
@cheenamalhotra Thanks for taking care of this! I unfortunately won't be able to deploy this to our environment if it isn't on nuget. Could you release it as a preview? If not maybe @MuhKuh7 could verify? |
@cheenamalhotra is there an ETA on when package will be published? |
Hi @davesmits We're working on a few important changes also candidate for this release, it's planned to be released as soon as we're ready, but latest by mid-February. Edit: Timelines are stretched to first week of March, to include a few more important fixes like issue #659 and #926 |
@cheenamalhotra can I ask you to send artifacts link posted here one more time? |
Hi @tarasverq Sure, I'm uploading NuGet here (rebuilt) you can try: |
Microsoft.Data.SqlClient v2.1.2 is now released that contains the fix. |
Get the fix for dotnet/SqlClient#839
Get the fix for dotnet/SqlClient#839
Describe the bug
With version
2.1.0
ofMicrosoft.Data.SqlClient
attempts to connect to a SQL server database that is not hosted in AWS are met with the below exception.After failing to find any other cause for this error I rolled back to version
2.0.1
and everything worked fine. I did not see this issue on my local (windows) machine.To reproduce
Attempt to open a connection to a sql server database hosted outside aws from a lambda function.
Expected behavior
The connection should work fine, just like it does in package versions previous to this.
Further technical details
Microsoft.Data.SqlClient version: 2.1.0
.NET target: core 3.1
SQL Server version: SQL Server 2017
Operating system: AWS Lambda Runtime
The text was updated successfully, but these errors were encountered: