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

ASCN-377: Fix for certain features not working due to SQLClient bugs #16

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

stephen-vakil
Copy link

@stephen-vakil stephen-vakil commented Nov 1, 2024

The Issue

When running in a docker container, certain features of opserver fail:

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 project

Exceptional 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:

  • Set your opserversettings.json -- uncomment the stuff on line 10-14; add TrustServerCertificate=True to the connection string
  • Add a section before Modules -- Security: { "Provider": "EveryonesAnAdmin"},
  • Run within VS - make sure everything works
  • Run .\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

@WouterDeKort WouterDeKort self-requested a review November 4, 2024 09:09
Copy link

@WouterDeKort WouterDeKort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Tested locally in Docker desktop and this does fix the issue.

There are some other small things that I was working on in another PR so I'll merge this one and then get my follow up PR going.

@WouterDeKort WouterDeKort marked this pull request as ready for review November 4, 2024 09:14
@WouterDeKort WouterDeKort merged commit d21fd3b into main Nov 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants