Sitecore Commerce 10 for Developer Workstation with Containers
Over the last couple of days, have been trying to setup Sitecore Commerce 10 on Docker (XC0 topology). First of all, I'm totally in love with this new Sitecore 10 feature of Sitecore and Docker integration. I can't stop raving about this step forward by Sitecore. The setup is so easy and the footprint is so much lesser compared to earlier installations. Forget about the pre-requisites like setting up IIS, SQL Server etc., you don't need to install Vanilla Sitecore. One docker-compose up command does the job of setting up the Commerce instance. What a master step by Sitecore!
So, with this excitement I tried to setup Sitecore Commerce 10 on Docker. The installation was fairly smooth. I then performed the necessary bootstrapping, sync, initialize etc., but hit a roadblock thereafter since I couldn't find a way to access the store front or create a store front in the content tree. I dived deeper and compared the DB sizes generated for this installation with earlier Commerce installation and I could find notable difference. Also, I couldn't find any traces of SXA installed in the Master DB for the Sitecore instance running on Docker. So, have raised a ticket and waiting for response. If someone reading this blog has been successful with Commerce installation on Docker, please add your thoughts in the comments section. From my side, will update the blog if I make any progress.
Sitecore XC10 DB instance running on Docker:
---------------------------------
For now, just blogged my approach here:
Pre-requisites:
a. Minimum 16 GB RAM: Chose a VM with 32 GB RAM
b. Windows 10 or Windows Server, 1809 or later: Chose a VM with Windows 10 Pro
A snapshot of hardware requirements:
c. Download and install Docker Desktop for windows
d. Sitecore Commerce Container SDK
Installation Steps:
1. Unzip pre-requisite d onto a folder say, c:\sitecore -
Note that the api host name is all passed through the environment variables. So, if that is set fine, the call will execute successfully.
24. Bootstrapping should be successful if all settings are fine:
25. Next execute Ensure\Sync default content paths:
Note that the response code is 200 but the status in the response body is WaitingForActivation.
26. To check if the API is successfully executed, pick up the task id, which is 1 based on above screen shot and execute Check Long Running Command Status by passing 1 in the address bar:
Understandably, the task id will change for you based on the response returned by the Ensure\Sync default content paths API. Also, you will have to be patient enough and execute the above Check Long Running Command Status API a few times to see if the Ensure\Sync content default paths API RanToCompletion!
27. Curious me, just switched over to the mssql-data folder to check if there is any change in size of Commerce DBs and yes, the SitecoreCommerce_SharedEnvironments_Primary DB has changed size due to successful bootstrapping:
28. The next step is to initialize the environment by executing the Initialize Environment API:
29. And, this time, you know what to do when the status is WaitingForActivation. Execute Check Long Running Command Status API to check the task status by passing the correct task id, which is 1 again (but understandably, the id need not be 1 every time):
Note that I had to point the address to OpsApiHost environment variable in the above case since Initialize Environment points to OpsApiHost environment variable. So, every time you check the task status of an API ensure that the host name is same and correct as the API that you are checking the status of.
30. Perform a restart of Minions, Authoring, CM and and Shop services through Docker dashboard:
31. Back in Postman, perform Full Index of Catalog Items, the API is named Run FullIndex Minion - Catalog Items:
Check status of completion using Check Long Running Command Status of Minions by passing the above task id.
32. Similarly, Run the following APIs:
a. Run FullIndex Minion - Promotions
b. Run FullIndex Minion - Price Cards
33. Next, let's invoke Catalog (Habitat), gives an assurance that Habitat catalog is present:
31. Bizfx and content editor should still load fine:
32. In the content editor, click refresh commerce cache. The option is under Caches and can be picked from My ToolBar -> Customize
33. Next, click Update Data Templates (can be picked from Customize and selecting Catalog tile)
No change in the content tree or any option to create a tenant after this. Waiting to complete!
Common Errors:
Error: .\init-setup.ps1 : File C:\sitecore10\Sitecore.Commerce.Container.SDK.1.0.214\xc0\init-setup.ps1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\init-setup.ps1 c:\license\license.xml
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Context and Solution: This happens when you open Powershell for the very first time and try to execute init-setup.ps1. Run set-executionpolicy remotesigned
Error: ERROR: for xc0_engine-authoring_1 Cannot start service engine-authoring: container d522383158ed990509363166fd4f09d5870764008f1f37b5bc8d94938d41fee1 encountered an error during hcsshim::System::Start: context deadline exceeded
ERROR: for engine-authoring Cannot start service engine-authoring: container d522383158ed990509363166fd4f09d5870764008f1f37b5bc8d94938d41fee1 encountered an error during hcsshim::System::Start: context deadline exceeded
ERROR: Encountered errors while bringing up the project.
Context and Solution: This happens when you docker-compose up. I suspect this is due to some kind of locking or a race condition. Frankly, need to understand the cause better since this can happen with any of the services. I follow this as a temporary solution:
Perform docker-compose down, ensure Docker dashboard is clear. Optionally, Delete msql-data and solr-data folders under c:\containers. Restart machine and retry docker-compose up. I do this when the concerned service has run fine in the past but didn't go through this time and I'm sure my env variable values (and, the docker compose file) are correct and unhampered.
Error: ERROR: for xc0_engine-minions_1 Cannot start service engine-minions: container c244a1cc2aaca70394a3ca68daba0f021bb9f4dea86b166560fbce54e55fd91d encountered an error during hcsshim::System::Start: context deadline exceeded
ERROR: for engine-minions Cannot start service engine-minions: container c244a1cc2aaca70394a3ca68daba0f021bb9f4dea86b166560fbce54e55fd91d encountered an error during hcsshim::System::Start: context deadline exceeded
ERROR: Encountered errors while bringing up the project.
Context and Solution: This happens when you docker-compose up. I suspect this is due to some kind of locking or a race condition. Frankly, need to understand the cause better since this can happen with any of the services. I follow this as a temporary solution:
Perform docker-compose down, ensure Docker dashboard is clear. This is how a clear dashboard looks if you had only one container running:
Optionally, delete msql-data and solr-data folders under c:\containers. Restart machine and retry docker-compose up. I do this when the concerned service has run fine in the past but didn't go through this time and I'm sure my env variable values (and, the docker compose file) are correct and unhampered.
ERROR: open \\.\pipe\docker_engine_linux: The system cannot find the file specified.
Context and Solution: Happens when you run docker-compose up -d for the first time after installing Docker for windows. Right click the whale icon in task bar and Switch to Windows containers.
ERROR: Pulling mssql (scr.sitecore.com/sxc/nonproduction/sitecore-xc0-mssql:10.0.0-ltsc2019)...
ERROR: Get https://scr.sitecore.com/v2/: x509: certificate signed by unknown authority
Context and Solution: Happens when you run docker-compose up -d for the first time after installing Docker for windows. Right click the whale icon in task bar and Switch to Windows containers.
ERROR: Unable to start Hyper-V VM: 'DockerDesktopVM' failed to start.
Context and Solution: Happens when Docker is trying to start and the whale turns red throws a fatal exception. The reason this happened was, I initially had installed the Docker desktop on 32-GB RAM VM and then switched size to 16 GB RAM VM. Somehow, Docker didn't like this and so, when i switched back to 32 GB RAM with 4 vcpus, this error didn't occur.
References:
https://github.com/MicrosoftDocs/OfficeDocs-SkypeForBusiness/issues/3094
https://www.faqforge.com/windows/windows-powershell-running-scripts-is-disabled-on-this-system/
Installation Guide: https://dev.sitecore.net/~/media/AC4B8DFC9F3D464BA23EFD553F95BF33.ashx
https://dev.sitecore.net/Downloads/Sitecore_Commerce/100/Sitecore_Experience_Commerce_100.aspx
Comments
Post a Comment