Skip to content
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

Connection Error 17830 logged to extended events when connecting to servers with multiple IPs #158

Closed
abairmj opened this issue Oct 13, 2023 · 0 comments · Fixed by #159
Closed
Assignees
Labels
Area - connections Issues affecting connection security or strings

Comments

@abairmj
Copy link

abairmj commented Oct 13, 2023

Describe the bug
A clear and concise description of what the bug is.

When using the library to connect to a VM with multiple IPs, SQL Server logs error 17830. This may lead people to falsely believe there are network issues with the SQL instance.

The 17830 error is logged due to a "fire and forget" pattern in the client library rather than network issues.

This go-mssqldb library defaults to a behavior that is similar to libraries where "multisubnetfailover" set to true. The library attempts to connect to all registered IPs simultaneously but when the first successful connection is made, the library abruptly closes other connections without doing any work.

SQL Server detects that as a "fire and forget pattern" and reports it as a 17830 error severity 20 state 11. From the database engine's perspective it seems that something attempted a connection but it failed.

You can reproduce via telnet by connecting on the appropriate port and disconnecting. The error will log in extended events.

Network error code 0x2746 occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration

To Reproduce
Include a complete code listing that we can run to reproduce the issue.
Configure a SQL Instance that listens on multiple registered IPs. Connect and observe extended events.

Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.

Expected behavior
A clear and concise description of what you expected to happen.
Client gives an option to disable the multisubnetfailover like behavior to avoid false errors.

Further technical details

SQL Server version: tested on SQL 2019
Operating system: (e.g. Windows 2019, Ubuntu 18.04, macOS 10.13, Docker container): tested on windows
Table schema: Schema is irrelevant

Additional context

abairmj added a commit to abairmj/go-mssqldb that referenced this issue Oct 13, 2023
abairmj added a commit to abairmj/go-mssqldb that referenced this issue Oct 16, 2023
@dlevy-msft dlevy-msft added the Area - connections Issues affecting connection security or strings label Oct 19, 2023
shueybubbles pushed a commit that referenced this issue Oct 19, 2023
…158 (#159)

* fix: Added multisubnetfailover option that can be set to false to prevent issue #158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - connections Issues affecting connection security or strings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants