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
On startup if Umbraco cannot connect to the database, it always opens the installer #12949
Comments
Hi there @joepvtl! 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 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 🤖 🙂 |
I haven't tried this yet, does sound like a bug, but I am a bit curious as to what the use case is here? I understand your example is made for us to be able to reproduce it, but what are you actually trying to accomplish by changing the connection string? |
Its just an example to reproduce for when Umbraco can't reach your database, when your database server is offline or has a a hiccup. In earlier versions Umbraco would just show a 500 page, but now it opens up the installer which everyone can see and configure. I feel like this should never just happen when the database can't be reached. |
Yes, that is a good point, shouldn't jump to the installer if the database can't be reached, didn't think of that, thanks! We'll have a look. |
I can reproduce the behavior in v10.0.1 and also in v9.0.1 as well, so it hasn't changed in the referred commit above. |
When I tested this in v9 It does have the expected behaviour in v9.5.4
|
Hmmm, this is what I'm seeing: 12949.mp4But maybe this is specifically about SQL Server, I didn't test that. |
Yeah this scenario does exist in v9 when the connectionstring has the value localdb in it (see this line) But I guess that was intended behaviour because in the commit I referred to, the old code did check for that value and if it has that value, it sets the state to InstallMissingDatabase. But now it always does this. |
So I just tried the exact scenario from the video above in 9.5.4, but I used SQL Server this time. I stopped the site, changed the server from |
In 10.1.1 when I stop the server so that it can't be reached any more, while the site is running, I get the expected error, and that is also what you were expecting to see
|
Yeah the issue is only on boot, not when the site is already running. |
I can confirm this is still happening in v10.1.0 and v10.2.0 |
For the team at HQ, I'll summarize the problem here:
This is not correct, Umbraco does have a configured connection string and therefore should simply give the error that no connection can be made to the database. We've added it to our backlog to look at in the next few weeks and will keep this issue updated. |
@nul800sebastiaan @joepvtl @JoseMarcenaro I saw a separate open issue with this same problem yesterday and didn't realize it was a duplicate. I've already made the fix and created a pull request. I accidentally added this issue's link to the wrong pull request... so ignore the mention of the X-XSS-Protection pull request :p I was able to replicate the issue with any bad connection, Azure firewall or not, and after making the changes in the pull request I get a error page with details of the error instead of the install screen. |
@nul800sebastiaan to clarify the issue further if it helps, for 10.2.0, I could only replicate if I stopped and started the app pool. If I didn't restart the app pool, due to the nature of Umbraco's Backoffice, restricting the database's firewall didn't immediately cause any issues or for the installer to trigger |
In my case (Azure with slots) the issue happens when swapping the slots, if for some reason the DB is out of reach (i.e. misconfigured network firewall) |
This should "fix" that problem for you... it will show you an error pge that the DB is out of reach, but it won't prompt you to re-install. |
Thank @gilbertaoe . Reaching the Install page is really bad, because once you did, you are stuck there even after you have restored the DB connectivity. |
Whoops this one was fixed in #13118 🙈 |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.1.0
Bug summary
When Umbraco can't connect to the database, the installer page opens even if the Umbraco environment was already configured.
Specifics
Using the Provider: Microsoft.Data.SqlClient
I think this bug got introduced in this commit: 8e6e262#diff-6ac9a3ad41721ad6c1743713a759eef7e43bd731f3ce6294023d2af3b7e7dd0eL146
Steps to reproduce
Expected result / actual result
Expected
I expect to see a 500 page with the message: "A connection string is configured but Umbraco could not connect to the database." like in Umbraco 9.
Actual
Actual result is a installer page that everyone can see.
This item has been added to our backlog AB#22604
The text was updated successfully, but these errors were encountered: