10

I am getting the following error when I attempt to install Sitecore 9.1 (initial release) with SIF (v2.0.0). (Note this IS after some failed installs, but I believe I have removed everything to do with those attempts).

Error Code: ERROR_EXECUTING_METHOD More Information: Could not deploy package. Warning SQL72023: The database containment option has been changed to None. This may result in deployment failure if the state of the database is not compliant with this containment level. Error SQL72014: .Net SqlClient Data Provider: Msg 12809, Level 16, State 1, Line 5 You must remove all users with password before setting the containment property to NONE.

I found this post suggesting to remove everything from previously failed attempts (which I believe I have...there are no Sitecore 9 DBs or users hanging around).... and I even tried a new install with a brand new prefix, and a new SQL user/password..... but am still getting the same thing.

The contained database authentication setting is correctly set to 1 before the installation, and the DBs it DOES get to install are correctly set to Partially contained databases. Does anyone have any other suggestions for what I can do to get this fixed?

Thanks.

4
  • Can you see in the logs at which database it fails? I had the same yesterday, but removing the databases solved the issue as you wrote. Dec 16, 2018 at 9:37
  • Can you share the install.ps1 file here? and what SIF commands is actually failing here? Dec 16, 2018 at 17:28
  • I'm not running an install.ps1 script. I actually think this was from some custom script that may have produced the issue. (and it seems like there WAS duplicate databases in there. More to come.... Dec 17, 2018 at 11:05
  • Which SQL Server version are you using ? Make sure you are using SQL Server SP1 and not SQL Server 2016. (According to the Sitecore compatibility table, Sitecore 9.1 initial release needs at least SQL Server 2016 SP1) Dec 2, 2019 at 18:15

3 Answers 3

13

It sounds like you still have a database or maybe a user left over.

How did you remove the failed installs? If you are running from the example script in the download comment out and in the Install-SitecoreConfiguration and Uninstall-SitecoreConfiguration lines and use that to run the uninstall. That should remove everything for you.

2
  • It looks like a custom script that had a bug where it was re-installing xConnect-xp0 a second time throughout the script.... meaning that even though I initially had no databases.... after the first xConnect install they'd exist...and it was the second run that was failing. My bad. It definitely IS a case of the database already existing.... Dec 17, 2018 at 11:10
  • Ran into this issue with the Habitat install-xp0.ps1 script for XP 9.1.0
    – Joost
    Apr 19, 2019 at 11:15
3

Run Below Script in power shell, This will remove sitecore databases and users

import-module sqlps 
$DBListQuery = "select * from sys.databases where Name like '" + $Prefix + "_%';"
$DBList = invoke-sqlcmd -ServerInstance "**SERVERNAME**" -U "sa" -P "**PASSWORD**" -Query $DBListQuery 
ForEach($DB in $DBList) {
    Write-host -foregroundcolor Green "Deleting Database " $DB.Name 
    $AlterQuery = "ALTER DATABASE [" + $DB.Name + "] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;"
    $DropQuery = "DROP DATABASE [" + $DB.Name + "];"
    invoke-sqlcmd -ServerInstance "**SERVERNAME**" -U "sa" -P "**PASSWORD**" -Query $AlterQuery
    invoke-sqlcmd -ServerInstance "**SERVERNAME**" -U "sa" -P "**PASSWORD**" -Query $DropQuery
}
3
  • Don't forget to replace Database server name, User name if other than sa, and password Feb 20, 2020 at 9:15
  • Will it delete sa user too?
    – Imad
    Dec 29, 2021 at 1:34
  • This is pointing out the obvious, but if you're using this in your uninstall script, make sure it is able to connect to the instance and runs the queries. Depending on how you have your uninstall script setup, it's easy to miss the associated error messages. Aug 25, 2022 at 15:28
1

What fixed it for me was a manual delete of all the relevant databases in SSMS and then rerunning the install. This was required despite my uninstall script including the PS script suggested by Chetan.

Possible causes:

  1. I had previously installed the databases with other install tools / scripts
  2. I had other databases with the same prefix but different capitalization (production backups) which may have interfered with the scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.