Categories
Sitecore

Docker: Fixing Sitecore docker-compose error

First thanks to Sitecore Slack Chat #docker channel in helping to find solution to issues that I faced in my very first days of learning and playing with Docker and Sitecore with Docker.

Here I’m trying to document the solution that might help others who face the same issue as me.

To begin with, first I started to learn about Docker and then about Sitecore with Docker. I had watched some videos on YouTube and Pluralsight course on Docker and read GitHub Gists from fellow Sitecore community Devs before starting with anything and then started with installing and playing with Docker shortly and followed this course as per my understanding of everything so far.

Getting Started with Docker with Sitecore

Steps:

  1. Install Docker for Windows
  2. Clone Docker for Sitecore repository
  3. Executed below commands, trying to get the vanilla Sitecore up and running in docker.
> Open powershell window in administrator mode

> CD into directory where you cloned the repository in my case it was 'C:\Projects\docker-images\'

> .\Build.ps1 -SitecoreUsername SITECORE_DEV_EMAIL -SitecorePassword SITECORE_DEV_PASSWORD -SitecoreVersion 9.3.0 -Topology xp -WindowsVersion 1803 -IncludeSpe

# I had edited Build.ps1 to allow '1803' windows version here because it matched with my windows OS version at that point

> .\Set-LicenseEnvironmentVariable.ps1 -Path C:\license\license.xml

> docker image ls

> cd .\windows\tests\9.3.x

> docker-compose -f .\docker-compose.xp.yml up

Got stuck on this Docker error

At this point, I got stuck with error message as below:

Pulling sql (sitecore-xp-sqldev:9.3.0-windowsservercore-ltsc2019)…
 ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
 Continue with the new image? [yN]<strong>y</strong>
 Pulling sql (sitecore-xp-sqldev:9.3.0-windowsservercore-ltsc2019)…
 ERROR: pull access denied for sitecore-xp-sqldev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

First Fix: Windows Update

As I checked in the #docker channel in the Sitecore Slack and learned that I had to update my Windows OS to at-least 1903 version so I spent next day or two waiting for system updates to complete. Please note: The time taken depends on your machine and internet speed.

If you are thinking how to check Windows OS version?

Check this out. Press Windows Key + I and then click on System tile then click on About from left navigation and it should show your system version as below –

Windows OS version.

This is noteworthy – After system update I tried Build.ps1 with new version i.e. 1903 (earlier it was 1803) as below, it started doing more than what was done in last time so that was good sign:

.\Build.ps1 -SitecoreUsername SITECORE_DEV_EMAIL -SitecorePassword SITECORE_DEV_PASSWORD -SitecoreVersion 9.3.0 -Topology xp -WindowsVersion 1903 -IncludeSpe

This time Build.ps1 took around 2-3 hours to complete and once it completed I tried docker-compose -f .\docker-compose.xp.yml up command again and still had the same error at this point.

Final Fix: Update environment file

Another quick chat in slack and I found the final fix. Update .env file under /windows/tests/9.3.x/ folder as below:

Updated Docker .env file.

I had to update WINDOWSSERVERCORE_VERSION from ltsc2019 to 1909 and NANOSERVER_VERSION from 1803 to 1909. I think these values got messed up when I was first trying to get it to work.

Quick note: Here I’m trying to setup Sitecore XP0 (XP standalone) for version 9.3.0 that is why I’m using ‘9.3.x’ folder so this folder can be different for you based what version you are targeting.

Finally, I re-ran the docker-compose -f .\docker-compose.xp.yml up command again and there it started composing without the error.

That is all to resolve the said error with docker-compose.

Finally, I was able to see my vanilla Sitecore instance from browser at http://localhost:44001/ locally. Please note that the port number here depends on the configuration as I kept the default values that came from https://github.com/Sitecore/docker-images it is port 44001 here.

Also, It is advised to use docker-compose with flag -d which will cut down the verbose logging seen in console and from what I’m hearing it’s called Detached mode.

Start following #docker channel in Sitecore Slack for more fun stuff.

Thanks to Michael West, Aaron Bickle, and Dylan Young for all the help…

Happy Sitecoring!

Categories
Sitecore

Sitecore SXA – ‘Open in Overlay’ checkbox missing?

If any of you have faced this issue that Sitecore SXA’s feature Open in Overlay is missing then this might help you.

Fix:

The root cause of the issue was that the rich text editor was not using the customized HyperlinkManager and was using the default Telerik HyperlinkManager, to fix this please do the following:
  • Open the \**Website Root**\sitecore\shell\Controls\Rich Text Editor\EditorPage.aspx file
  • Add the following attribute to the <telerik:radeditor ID="Editor" inside of the EditorPage.aspx file
    • ExternalDialogsPath="~/sitecore/shell/controls/rich text editor/Dialogs/"
  • Clear browser cache

Sitecore Support reference for this fix is # 228508

Note that I was using Sitecore SXA version 1.8.1 when I got this issue.

Categories
Sitecore

Sitecore SXA – Fix for missing items in VariantSection template

Here is a quick post about a known issue in Sitecore SXA version 1.8.1 with Sitecore 9.0

Issue is the VariantSection template in Rendering Variant is missing some items on the IsLink field that is Droplink just on VariantSection template.

Sitecore Support has provided the package that installs the missing items. If anyone needs, I have shared the link at the end of this post.

Screenshot showing the issue is as below:Sitecore SXA - VariantSection IsLink Field

After applying the fix it should look as below:Fixed VariantSection template IsLink Field

Just in case if you need Sitecore public reference number for this issue is 326111

Download Sitecore Support Package (326111-items.zip)

Categories
.NET ASP.NET Sitecore Utility

Code Generation using Sitecore Rocks and Visual Studio

Index Points

  1. Introduction
  2. Assumptions
  3. Code Generation Steps using Sitecore Rocks
  4. Image Guided Steps for Code Generation using Sitecore Rocks
  5. Conclusion
  6. Reference Links

 

Introduction

This post will guide you on how to work with code generation using Sitecore Rocks.

Assumptions

Code Generation Steps using Sitecore Rocks

For Code generation using Sitecore Rocks the steps are:

  1. Setup the Sitecore site using .exe installer or Siteroot zip – available from Sitecore SDN.
  2. Setup Sitecore site in Visual studio solution – Creating .sln file.
  3. Install Sitecore Rocks (if not already installed).
  4. Connect the Visual studio solution with Sitecore site using Hard Rock web service exposed by Sitecore.
  5. Create new StronglyTypedItems file in Sitecore visual studio solution, extension will be .scx, with appropriate name – for example “CodeGenerationFile.scx”.
  6. Right-click on created file “CodeGenerationFile.scx” and execute the command ‘Run Custom Tool’ for code generation.

Note: Check YouTube video series linked in assumption section for information on how to install and setup Sitecore Rocks and Sitecore Visual studio solution.

Image Guided Steps for Code Generation using Sitecore Rocks

The visual steps for Sitecore Rocks code generation are as below:

sitecore codegen - create strongly typed items file
Create new file for Code generation
Right click on project > Add > New Item > Visual C# > Sitecore > Code Generation > select Strongly Typed Items > click Add

sitecore codegen - run custom tool
Run custom tool command to execute and generate code files

sitecore codegen - code generated in designer file
Verify the Code generated in CodeGenerationFile.Designer.cs file (File name may differ as per added file)

Conclusion

Code generation with Sitecore Rocks is very easy to follow. After generating code using Sitecore Rocks, developers may move the classes to relatively named class files by themselves or using command ‘Move class to file’ using ReSharper tool.

Reference Links

Do comment if you like this post or have any opinions.