3

I've tried section (d) from this blog: https://himadritechblog.wordpress.com/2018/03/10/yet-another-sitecore-commerce-9-installation-blog-post/

And this blog: https://naveed-ahmad.com/2018/02/25/sitecore-experience-commerce-xc9-troubleshooting-your-installation/

I am using I tried changing the connection string to DESKTOP-XXXXX\MSSQLSERVER and to DESKTOP-XXXXX\SQLEXPRESS16. I've installed Sitecore 9.0.2 with $SqlAdminUser = "sc90" and $SqlAdminPassword="admin". I tried adding User Id="sc90" and Password="admin" but I still get the same error.

Please share a solution if you have one. Thanks!

I get the following error:

[-------------------------------- InitializeCommerceEngine : InstallSitecoreConfiguration ----------------------------]
Transcript started, output file is C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\CommerceEngine.Initialize.18
0802 (4).log
                                          ************************************
                                               Sitecore Install Framework
                                                     Version - 1.2.1
                                          ************************************


WorkingDirectory  : C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14
LogPath           : C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\CommerceEngine.Initialize.180802 (4).log
WhatIf            : False
Verbose           : SilentlyContinue
Configuration     : C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\Configuration\Commerce\CommerceEngine\Comm
                    erceEngine.Initialize.json
Debug             : SilentlyContinue
WarningAction     : Continue
ErrorAction       : Stop
InformationAction : Continue



Importing Module => InitializeCommerce

[----------------------------------- DisableCsrfValidation : DisableCsrfValidation -----------------------------------]

[---------------------------------------- GetIdServerToken : GetIdServerToken ----------------------------------------]
Get Token From Sitecore.IdentityServer
Install-SitecoreConfiguration : The remote server returned an error: (500) Internal Server Error.
At C:\Program
Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21
+                     & $entry.Task.Command @paramSet | Out-Default
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

[TIME] 00:00:06
Transcript stopped, output file is C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\CommerceEngine.Initialize.180802 (4).log
Install-SitecoreConfiguration : The remote server returned an error: (500) Internal Server Error.
At C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\MyDeploy-Sitecore-Commerce.ps1:80 char:2
+     Install-SitecoreConfiguration @params
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

[TIME] 00:00:11
Transcript stopped, output file is C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\Master_SingleServer.180802 (5).log
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.
At C:\Users\MJK\Desktop\deploy\SIF.Sitecore.Commerce.1.2.14\Modules\InitializeCommerce\InitializeCommerce.psm1:73
char:17
+ ... $response = Invoke-RestMethod $UrlIdentityServerGetToken -Method Post ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
2
  • Did you check the logs of the identity server?
    – Jonne Kats
    Commented Aug 3, 2018 at 7:27
  • Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.TokenEndpoint" for "/connect/token" Unhandled exception: "System.Data.SqlClient.SqlException (0x80131904): Cannot open database \"sc902.sc_Core\" requested by the login. The login failed. Login failed for user 'scuser'.
    – Minjae Kim
    Commented Aug 7, 2018 at 14:59

4 Answers 4

4

I also faced this error and below are the steps I did to fix it.

Added the ConnectionString in appsettings.json (C:\inetpub\wwwroot\SitecoreIdentityServer\wwwroot) with "User Id", "Password" and removed "Integrated Security". Make sure the user id have all the required permission on the SQL server database, if not then Grant all those permission especially the db owner. For example:

{"AppSettings":{"SitecoreMembershipOptions":{"ConnectionString":"Data Source=WIN-20IDVDM11DL\\SQLEXPRESS;Initial Catalog=sxp9u2_Core;User Id=sxp9;Password=Test12345","ApplicationName":"sitecore","UseRoleProviderSource":true} 

Note: For me the default ConnectionString to the SQL was not working so I modified it here with the one than works. Modified the app pool Identity to LocalSystem as the default CSFRuntimeUser was not working.

Look at the event viewer and logs to find out what exactly is breaking. This will help you to work on the exact fix needed

2

Answer by Amitabh didn't work initially. I went to C:\inetpub\wwwroot\SitecoreIdentityServer\wwwroot\logs to view the latest log. It said:

Unhandled exception: "System.Data.SqlClient.SqlException (0x80131904): Cannot open database \"sc902.sc_Core\" requested by the login. The login failed.

I fixed this by running the following on the SQL server management studio:

USE SC902_Core
GO
sp_changedbowner 'scuser'
GO

Then I got the same error on the terminal but a different log saying:

Unhandled exception: "System.Security.Cryptography.CryptographicException: Keyset does not exist

I double clicked on the certification that I created (.cer file) and installed it on user and local machine (yes, I did it on both. this might not be necessary).

then I followed these steps: https://blogs.msdn.microsoft.com/dsnotes/2015/08/13/service-failure-with-cryptographicexception-keyset-does-not-exist/

0

In my case, CSFRuntimeUser didnot have access to SQL. I added CSFRuntimeUser to SQL server (using Management studio).Also gave server Roles as sysadmin,serveradmin,public for CSFRuntimeUser.

enter image description here

0

I assigned the Commerce Administrator role to the Sitecore user & it's resolved.

Your Answer

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

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