andrelange91
andrelange91

Reputation: 1148

Cannot connect to database during umbraco install

I have a clean project, which i am trying to get started. I have also created a clean database.

Both are running locally on my pc.

I can connect to my database with linqpad, with no issues. But when i try to "customize" and set a microsoft SQL server, it says

Could not connect to database

And in console, i get a 500 internal server error, on :

:62164/install/api/PostValidateDatabaseConnection

What can i do ?

Edit when trying to use a custom connection string, i get this :

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)
 2017-09-12 09:16:22,389 [P1996/D2/T11] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Step completed (took 32ms)
 2017-09-12 09:16:22,390 [P1996/D2/T11] ERROR Umbraco.Web.Install.Controllers.InstallApiController - An error occurred during installation step DatabaseConfigure
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Umbraco.Core.DatabaseContext.SaveConnectionString(String connectionString, String providerName)
   at Umbraco.Core.DatabaseContext.ConfigureDatabaseConnection(String connectionString)
   at Umbraco.Web.Install.InstallSteps.DatabaseConfigureStep.ConfigureConnection(DatabaseModel database)
   at Umbraco.Web.Install.InstallSteps.DatabaseConfigureStep.Execute(DatabaseModel database)
   --- End of inner exception stack trace ---

Upvotes: 0

Views: 581

Answers (1)

Eyescream
Eyescream

Reputation: 901

If, even with a custom connection string, you still get a 500 error I think that you have a botched installation and you should try to reinstall Umbraco from scratch

Upvotes: 1

Related Questions