ASCN-377: Fix for certain features not working due to SQLClient bugs #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Issue
When running in a docker container, certain features of opserver fail:
Internal connection fatal error.
inSystem.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
The solution
Switching to the not-out-of-support
Microsoft.Data.SqlClient
resolves this issue. Unfortunately that causes these side-effects:invariant fixes
Using this client, we have to switch to the chiseled extra base image to get around known issues with global invariant. Without the change the app won't connect to SQL
Certificate not trusted issue
Without adding
;TrustServerCertificate=True
the app won't connect to sql. I believe we saw this in other apps?Microsoft.IdentityModel.Protocols.OpenIdConnect
The updated
Microsoft.Data.SqlClient
uses an updated reference to this library. We have to explicitly upgrade it in the projectExceptional still uses System.Data.SqlClient
Although our code no longer uses it, Exceptional still needs this. The app won't start without it being referenced at least in the web project.
How to test
Locally:
opserversettings.json
-- uncomment the stuff on line 10-14; addTrustServerCertificate=True
to the connection stringModules
--Security: { "Provider": "EveryonesAnAdmin"},
.\cnab\invoke-CNAB.ps1 install $false DockerDesktop
-- Make sure you get a new container by looking at the pod in lens. If you don't, delete the pod so it recreates after install