-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
V13 RC: Installing throws an error if using SQLite as the DB #15090
Comments
Hi @warrenbuckley, Thanks for reaching out 👍 I can't really reproduce this 😕 the exact same steps work fine on my machine. No KABOOM here. I even tried RC1 and RC2 of .NET8 (definitively because I am so thorough, not at all becourse I had RC1 installed when I first ran the test 🤦). From what I can read in the attached logfile, everything runs fine until EF Core tries to run its migrations. Then... KABOOM. I wonder why that does not happen on my end. Can you reproduce this error? |
Update: @enkelmedia also ran into this (#15125). Still can't reproduce it myself. I will make sure the whole team makes an attempt at a fresh install from the templates early next week, in the hope that someone can reproduce. |
@kjac I have not been able to reproduce the error and I would check to see if @enkelmedia still can, as after a reboot of my machine it all worked fine. @KevinJump also had the same issue but prompted me to do a reboot as his issue went away and so did mine after that. Kenn, I wonder if a Windows patch or VS or .NET update was out that day as well that needed to be applied perhaps, as super odd just after a reboot it all got fixed up. |
@warrenbuckley thanks for the update. I have been wondering the same ... I just don't feel comfortable with things magically fixing themselves 🤔 on the other hand, we we can't reproduce this after rebooting - well, then we can't. I'm still going to make sure the team has a go at this. If the reboot theory sticks, they shouldn't be able to reproduce either 😝 |
I just restarted my computer and tried again - did not solve the problem.
After stopping the site and doing
SDK: 8.0.100-rc.2.23502.2 |
That is weird as myself and Kevin it just went away?!
For OS Comparison if that is of any help/use
|
FYI: I just made a clean install of 12.3.1 using SQLite and got the same error. @kjac Update here, same issue on the officially released 12.3.1 version. I have the same error both on my computer at home and at the office. Both Windows 11 Pro. Intel. @warrenbuckley I'll get back with the details. EDIT: Downgraded to 12.2.0 and installed without problems.
I'll see if an OS upgrade solve the issue. Edit2: Still no luck. Updated Visual Studio to latest versions:
And the OS:
Edit3: Might be something with the EF Core-implementation? Looks like the connection-string change makes the UmbracoDbContext dispose, next after this comes the error.
Edit4:
Still the same error during install. |
The same is happening for me on a Mac with a fresh 12.3.1 project, as well as my existing projects I updated from 12.2.0 to 12.3.1. |
Thanks @dan-hammond ... we're investigating, gotta get to the bottom of this. |
hey @enkelmedia I have been trying to reproduce this all morning to no avail, could you send me your full log files from the failed install? sge@umbraco.dk |
Hi @Migaroez I've sent you a couple of logs from just now, one with debugging on. I would say i can currently get the RC1 install to fail around 80% of the time. |
@Migaroez I've sent you logs for both Umbraco 12.3.1 and 13.0.0-rc2 where I have these issues. The last version that worked was 12.2.0. |
I appear to behing this issue as well though I am nto 100% sure if I am on SQLLite right now, reaching out to my host to confirm. For me the upgrade works fine on my local development machine, which connects to the DB on my staging environment but if I publish to staing or production those environemtns will break. Here is the erro I was able to dig up
I am not good with debuggin but I am willing to give an umbraco dev access to my github and staging environment for testing and debuging. Just heard back and I am using SQL Server 2019 as a backend DB. So not sure if this is the same problem as those reporting on SQLlite or not. |
Hey @Eaglef90, this seems to be a similar but not the same issue (i think), they both have to do with Disposed objects that shouldn't be disposed. But the objects are different and you are talking about an upgrade. They might have the same root cause though. Just to be safe, could you tell me the exact from and to version you are using in the upgrade process? |
@KevinJump Are you able to reproduce this on the release/13.0 branch? |
@Migaroez I am going from 12.2.0 to 12.3.0 |
@Eaglef90 Could you send me full log files from when the upgrade starts? |
@KevinJump Sanity check time, could you run the following powershell command in a failing test-project/bin/debug/net8.0 folder? and share the results?
|
Sure..
|
We finally tracked this one down. PR to fix it in #15410 |
With an apparent fix found and v13 set to come out in a few days do we know if this will be included in the final release or will we have to wait for a patch version? |
It will be part of 13.0.0 and is part of 12.3.4 |
Still not part of 13 :( |
Hi @marcloveUSN.. The PR is part of 13.0.0, so if you experience exactly the same issue, it must be something else underlying. And in that case, please create a new issue. Also please ensure you do not have any custom code/ packages that requests a EF Core context, before a connection string is set. |
For reference: I had no problem installing 13 on the machine where I had this issue. |
@bergmania Will open a new issue. Got a feeling this may be to do with the new ability to add a Weight to package migrations in V13. |
I'm still seeing this issue on 13.0.3.
@marcloveUSN Did you already open a new issue? |
@creativesuspects is this on a plain new project? It can definitely still happen, if you start up a EF Core context before there is a connection string, this will happen. Ensure non of you code do that when in install mode (and there do not exist a connection string). What happened in the original bug, was that OpenIddict somewhere in a constructor started a EFCore context. So when a specific service was injected into one of our constructor, a EF core context was created. Instead we now request that service when needed. (d752853#diff-66cee26fd3ce34df24f24410e528403b5b91d48d7e74f82c879dcd3a9bba5a09) |
@bergmania This was on a clean 13.0.3 install without any custom code:
I open the site and fill out the 'Install Umbraco' screen, hit the 'Install' button and then I get the same error message as the OP. When I delete the erroneous SQLite database, remove the connection string from appsettings and enable the unattended install (with the same details) the installation process completes without any issues. I don't know if it helps, but you can download the project below. The zip also contains the erroneous database and logs from immediately after the failed install and a single attempt to load the site afterwards. |
Hmm.. Seems like another bug yes. Wonder if it would solve it, if It seems again like a timing issue, that only his very few, |
Not sure if it helps, but I didn't run into this issue when installing into a SQL Server database. |
Hi, I'm running into "Connection string changed, disposing context" warnings after upgrading a project from umbraco 11.5 to 12.3.6, i don't see any errors and functionality seems to be what is was, but the warnings occur running an async task on and efCoreScopeProvider scope. The project has Hangfire running on the umbraco database, the warnings occur while running a Hangfire job Any idea if this is related, i would like to know the impact before pushing my upgrade to live (project is hosted on Umbraco Cloud) |
Sounds like your hangfire is booting too early? Please ensure it do not start, before a connection string is set. As long as you have a connectionstring in your appsettings/environment varable, there should be no risk related to this. |
I get this on 13.0.3 if using SQLite, SQL Server is fine. To reproduce I delete umbraco folder, delete connectionstrings from config and load webpage to initialise Umbraco install. |
I've also got this error now when running After that, I restart the site and get:
Here is how to reproduce the error: 15090-repo.mp4 |
Hi @enkelmedia. Thanks for the video, and nice you can reproduce in our codebase. Obviously I can't as it seems to be a timing issue. What I do not really understand is, how your code just executed |
* Attempt to fix #15090. Save connection string in private variable after setup. * Do not dispose ef core contexts when if the connectionstring changes. A Ef core context is protected from creations when no connection string is present. If it changes that single instance will continue with the connection string it was initialized with. * Clean up * Review Equals methods
* Attempt to fix #15090. Save connection string in private variable after setup. * Do not dispose ef core contexts when if the connectionstring changes. A Ef core context is protected from creations when no connection string is present. If it changes that single instance will continue with the connection string it was initialized with. * Clean up * Review Equals methods (cherry picked from commit 5146f05)
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.0.0-rc1
Bug summary
I am going through the normal installer flow running from my local machine via the command line (kestrel) running on Windows 11 and get an error after the database steps try to install.
Specifics
Error in installer flow
Logs (During install)
UmbracoTraceLog.HACKMAKEDO.20231101.json
And a subsequent run with
dotnet run
I get the following errorno such table: umbracoOpenIddictApplications
dotnet --list-sdks
Steps to reproduce
dotnet new install Umbraco.Templates::13.0.0-rc1
dotnet new umbraco -n UmbracoV13Playground
dotnet run
Expected result / actual result
No response
This item has been added to our backlog AB#35142
The text was updated successfully, but these errors were encountered: