Hello all. I have an issue I have been trying to track down off and on for a couple days. Recently upgraded from 13.2.1 to 13.2.2. Running vanilla Umbraco; no code modifications, use SQL Server back end. I can run it locally pointing at a SQL server at my web host company and it works fine. When I do a web deploy, I get the message:
Unhandled exception. System.InvalidOperationException: The factory has not been configured with a proper connection string.
at Umbraco.Cms.Infrastructure.Persistence.UmbracoDatabaseFactory.Initialize()...
I can connect directly to the SQL server using the exact same connection string info as well, so I know the connection string is correct. I've obfuscated the connecting string below, but here it is. Again, when I run the code locally on my machine, it works fine connecting to this server.
"umbracoDbDSN": "Data Source=tcp:s23.winhost.com;Initial Catalog=########;User ID=#######r;Password=#######;Integrated Security=False;TrustServerCertificate=true;",
What am I missing? Is something cached on the web host's server? I have completely deleted everything off the server (via FTP) and redeployed, but the same error persists.
I appreciate any and every bit of help anyone can provide.
s
Sebastiaan
04/10/2024, 7:16 AM
I believe this usually means:
1. the connection string is empty (but that should probably give you the install screen instead of an error) - check your appSettings.Release.json to make sure it is set there (assuming you did build in release mode)
2. Some custom code is running before Umbraco is initialized, having no access to the database (yet?) - but it works locally so I'm not convinced that's it
3. the target machine (your web host's server) doesn't have access to the database - you said you can connect to it but is that from your local machine, or from the host's machine?
I think #1 is most likely, I assume you deployed your 13.2.1 site once, installed Umbraco on the host and everything was fine and dandy because Umbraco saved the connection string in the appsettings file. Now that you've deleted everything, you've also deleted the setting in the appsettings file.