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

Cannot connect to SQL Server during install #14272

Closed
idseefeld opened this issue May 20, 2023 · 11 comments
Closed

Cannot connect to SQL Server during install #14272

idseefeld opened this issue May 20, 2023 · 11 comments

Comments

@idseefeld
Copy link
Contributor

idseefeld commented May 20, 2023

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

v12 rc

Bug summary

In the install step "Configure your database" I cannot connect to SQL Server 2019 database neither with integrated authentication nor database user account. I use a a named instance "SQL2019":

configure-your-database-install-step

I have verified with SQL Server Management Studio, that connection with this settings is working and user has owner permissions.
The project works fine with SQLite.

Specifics

No response

Steps to reproduce

Create a fresh v12 Umbraco project. Run and choose SQL Server instead of SQLite database.

Expected result / actual result

No response


This item has been added to our backlog AB#29662

@github-actions
Copy link

Hi there @idseefeld!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@idseefeld idseefeld changed the title Cannot connect to SQL SERVER during install Cannot connect to SQL Server during install May 20, 2023
@idseefeld
Copy link
Contributor Author

I tried Paul Seals "Package Script Writer" and got an error message in the terminal window:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - Die Zertifikatkette wurde von einer nicht vertrauenswürdigen Zertifizierungsstelle ausgestellt.)

So I think the issue is caused by an issue on my machine.

@abjerner
Copy link
Contributor

abjerner commented May 20, 2023

I'm getting the same issue, so might still be worth looking into.

When googling the error, it could seem that this might be due to a version of SQL server that is no longer supported by the SQL driver that ships with Umbraco 12. In my case, I'm using SQL Express, and can't remember the last time that I updated it, so there could be some truth to that. But I haven't had the time to look into this yet.

@idseefeld
Copy link
Contributor Author

idseefeld commented May 20, 2023

I'm using a fairly recent SQL Server 2019 developer edition.
And I have tried the same database with an Umbraco version 10.5.1 without any issues.
So, I guess this need to be investigated.

@idseefeld idseefeld reopened this May 20, 2023
@abjerner
Copy link
Contributor

I can see I'm not 12.0.2569.0, which should be SQL Server 2014. So I'm a bit more behind 😮

The release candidate blog post doesn't seem to list any changes in supported versions of SQL Server, but I can see that the NPoco dependency was updated.

@idseefeld
Copy link
Contributor Author

Looks like it is caused by an dependency update of Microsoft.Data.SqlClient to version 5.0.1.
I found a nice article which also gives a solution:
https://weblog.west-wind.com/posts/2021/Dec/07/Connection-Failures-with-MicrosoftDataSqlClient-4-and-later

The short clue is to add the following setting to the connection string: ;Encrypt=False

Currently you can do this only with the CLI or unattended settings. I have tried Paul Seals Package Script Writer and it worked.

@idseefeld
Copy link
Contributor Author

@prjseal told me:
;TrustServerCertificate=true; instead of ;Encrypt=false; would be the preferred way to handle this.
I have tried this too and it works.

Btw. there is a quite long discussion about this at dotnet/SqlClient#1402.

Microsoft documentation of TrustServerCertificate can be read here: https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnectionstringbuilder.trustservercertificate?view=dotnet-plat-ext-7.0
and in more details at: https://learn.microsoft.com/en-us/sql/relational-databases/native-client/features/using-encryption-without-validation?view=sql-server-ver16.

My understanding is:
You can use either ;TrustServerCertificate=true; or ;Encrypt=false; in development environments, but in production you should configure the SQL server with a valid certificate.

For the installer UI I think there should be a checkbox for this additional parameter and documentation should mention this issue or new requirement.

@prjseal
Copy link
Contributor

prjseal commented May 21, 2023

I’ll add this to package script writer next week so it works with SQL Server

@kjac
Copy link
Contributor

kjac commented May 21, 2023

Hi everyone 👋

Thank you all very much for digging into this. I do agree, we need to address this in the V12 installer somehow. I will bring it to the team Monday morning for an internal discussion.

How lucky we are to have people like you folk running the RC's through the paces! ❤️

@kjac kjac added state/needs-investigation This requires input from HQ or community to proceed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks area/frontend area/backend affected/v12 status/regression labels May 21, 2023
@prjseal
Copy link
Contributor

prjseal commented Jun 8, 2023

This has been added to Package Script Writer now.
Example Here

@Zeegaan
Copy link
Member

Zeegaan commented Jun 29, 2023

This has been fixed in #14361, sorry for the late update 🚀

@Zeegaan Zeegaan added release/12.0.0 and removed state/needs-investigation This requires input from HQ or community to proceed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks labels Jun 29, 2023
@Zeegaan Zeegaan closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants