At a customer lately I had an issue that my ConfigMgr 2012 R2 installation failed after the database has been configured during the setup process. After looking at the ConfigMgrSetup.log I noticed that the ConfigMgrSQLCert_PS1.cer file could not be saved to the location where the Configuration Manager Database was created.
The situation was as follows, I installed SQL with a default database path F:\DB\ and pre-created the Configuration Manager 2012 R2 database based on Kent Agerlund his Database sizing Excelsheet. During the setup you see the backslash at the end of the path like shown in the figure below, normally you would think that this shouldn’t be an issue and that the backslash will be stripped.
Like mentioned the installation failed with an error that the ConfigMgrSQLCert_PS1.cer file could not be saved to the location where the Configuration Manager Database was created. The following errors were logged in the ConfigMgrSetup.log.
*** [42000][15240][Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot write into file ‘F:\DB\\ConfigMgrSQLCert_PS1.cer’. Verify that you have write permissions, that the file path is valid, and that the file does not already exist.
ERROR: SQL Server error: [42000][15240][Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot write into file ‘F:\DB\\ConfigMgrSQLCert_PS1.cer’. Verify that you have write permissions, that the file path is valid, and that the file does not already exist.
Create_BackupSQLCert : Failed to execute spCreateAnConfigMgrDBackupSQLCert
CSiteControlSetup::SetupCertificateForSSB : Failed to create/backup SQL SSB certificate.
ERROR: Failed to set up SQL Server certificate for service broker “cm01.configmgrlab.com”
ERROR: Failed to initialize the site control data.
When looking at the first error you see the double backslash after F:\DB. Accessing such a path will indeed result in an error. The Configuration Manager 2012 R2 Setup is using the default database and log path settings configured in the SQL Server, but for some reason the setup does not strip the backslash that is already there or not leaving out the extra backslash while referring to the database path. So that was something to fix. Deleting the backslash in the Setup Wizard in the screen shown above will don’t do the work, for some reason this change is not used in the setup process.
Another way you should be able to fix this is in the Server Properties in the SQL Server Management Studio, like shown in the next figure. But for some reason changing also this setting, would not result in the fact that the Configuration Manager 2012 R2 setup could proceed the installation. .
So for some reason the Configuration Manager 2012 R2 setup is not using this setting either. So finally another location for storing this setting would be the registry and indeed the DefaultData key in HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQLSerer was still referring to F:\DB\ instead of F:\DB. After removing the backslash the setup went okay.
Hope this blog is useful when you ever come across something like this. Added this also as a potential bug on Connect, if you come across a bug always file it at connect.microsoft.com or call Microsoft PSS.