HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Microsoft SQL Server 2019 Developer Edition suddenly throwing Internal Connection Fatal Errors

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqlfatal2019microsoftsuddenlyinternalthrowingerrorsdeveloperserver

Problem

I have Microsoft SQL Server 2019 Developer edition installed on my computer for local development work with .NET. Everything was working well as of two months ago, when I was last working on a project that was using it. I'm finally getting back to the project, but now my program is failing with the following error: "Internal connection fatal error. Error state 15, Token: 23 (System.Data)". The program uses a SQL Server authentication account.

I get the same error with SQL Server Management Studio (SSMS) when I try to connect to the database instance. It's a saved session to localhost\MSSQL2019 which used to work. I get the error whether I use my Windows account or a SQL account.

I updated SSMS to the latest (18.12.1) and still get the error. I also confirmed the IP settings via the configuration manager.

In frustration, I uninstalled MSSQL 2019 Dev edition, rebooted and tried to reinstall it with a fresh download of the DVD ISO from Microsoft. The installation gets close to the end, but fails with the same error.

I am able to successfully install MSSQL 2016 Dev edition and connect via SSMS. However, when I try to upgrade it to 2019, the upgrade completes, but SSMS gets the error again.

I'm on Windows 10 Pro 21H2, 64-bit, with an Intel i7 processor.

I haven't had any luck with Google or Bing to find a solution to this. Any help is appreciated.

For completeness, here's the full exception.

```
===================================

Testing the registered server failed. Verify the server name,
login credentials, and database, and then click Test again.

===================================

Internal connection fatal error. Error state: 15, Token : 23 (System.Data)

------------------------------
Program Location:

at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.Tds

Solution

I ran into this issue and through a combination of efforts I managed to resolve it.

  • Run all the uninstallers through Powershell using the following commands twice.



$products = Get-CimInstance -Query "SELECT * FROM Win32_Product WHERE (Caption LIKE '%SQL Server 2022%')"
foreach ($product in $products) {
    $guid = $product.IdentifyingNumber
    Write-Host "Uninstalling $($product.Caption) with GUID $guid"
    Start-Process -Wait "msiexec.exe" -ArgumentList "/x $guid"
}


-
Running the uninstall for SQL Server from control panel made it realise it was already uninstalled and removed it from the listing.

-
Clearing the Installation paths

  • "C:\Program Files\Microsoft SQL Server"



  • "C:\Program Files (x86)\Microsoft SQL Server"



  • Clearing the registry of these keys



  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server



  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer



  • Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SQL Server



  • Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\MSSQLServer



-
Restarting

-
Running sfc /scannow & dism /online /cleanup-image /restorehealth

-
Restarting (Again)

-
Using CCleaner to clear out old registry entries

-
Uninstalling KB5011048

-
And finally Restarting

The install then proceeded normally.

Code Snippets

$products = Get-CimInstance -Query "SELECT * FROM Win32_Product WHERE (Caption LIKE '%SQL Server 2022%')"
foreach ($product in $products) {
    $guid = $product.IdentifyingNumber
    Write-Host "Uninstalling $($product.Caption) with GUID $guid"
    Start-Process -Wait "msiexec.exe" -ArgumentList "/x $guid"
}

Context

StackExchange Database Administrators Q#317116, answer score: 2

Revisions (0)

No revisions yet.