Skip to main content

Sitecore

Troubleshooting Docker Container Problems

Programer Codes On A Laptop Connected To Additional Screen

Several factors could cause Sitecore containers running on Docker to stop functioning or display as unhealthy containers. To troubleshoot or fix the errors, we ran into a few Docker container issues, which we have listed below. This helped us identify and comprehend the root causes of the problems, which allowed us to check and fix the Docker container issue and get our Sitecore instance up and running.

Before moving on to the errors, take the necessary precautions:

  1. If IIS is operating, make sure to stop it.
  2. Any Solr services installed on the machine should be stopped.
  3. Disconnect any VPN services if connected, as Docker might not work if a VPN is connected.
  4. Investigate the Docker or Sitecore logs to find the root cause of the issue.

Docker Logs: To see docker logs, navigate to the docker desktop dashboard and choose either active or unhealthy containers. (Not working).

Problem 1: Docker Cannot Enable Hyper -V Services

First Solution:

Using the instructions below, we can manually enable the Hyper-V services: –

  1. Choose the “Apps and Features” options by right-clicking the Windows button.
  2. Choose the “Programs and Features” option from the Related Settings tab on the right-hand side.
  3. Now choose “Turn Windows Features on or off” from the left-hand side.
  4. Choose Hyper-V, then click OK.
  5. Restart the system.

Hyperv

Second Solution:

By using the PowerShell instructions, we can also enable the Hyper-V services: –

  1. Right-click on the system’s Windows icon and choose “Windows PowerShell” (Admin Mode).
  2. Enter the following code once the PowerShell terminal has loaded. Once Windows has finished enabling Hyper-V, restart your computer.
DISM/Online/Enable-Feature/All/FeatureName:Microsoft-Hyper-V

Hyperv Powershell

Problem 2: Unlock the Sitecore User Account Using Docker

Loginissue

First Solution:

A Sitecore instance running on Docker didn’t have access to MSSQL directly. In light of this, we choose to replace the Core database MDF & LDF files with the earlier versions. The MDF and LDF files can be directly replaced if we have an earlier Core database backup, or We redownload the files from the docker MSSQL image if we don’t have a backup.

Note: If we replace the MDF and LDF files, we risk losing the most recent CORE database modifications.

In the Docker instance, the MDF & LDF files of the MSSQL database are in the data/mssql folder.

Example: YourProjectFolder/docker/data/mssql/

Second Solution:

An alternative to unlocking sitecore is available in this blog, “How to Reset the Sitecore Admin Password inside a Docker Container,” authored by David San Filippo.

Problem 3: Unable to start Traefik Container

Unable to start Traefik container OR the Traefik container “id” is unhealthy OR cannot begin to service Xconnect: The process cannot access the file as it is being used by another method.

Solution:

This error indicates that Traefik containers are currently in use. The IIS is mostly to blame. Check the IIS and shut it down.

Command to stop IIS from PowerShell: iisreset/STOP

Problem 4: Docker-compose up command cannot be loaded

Init.ps1 or Docker-compose up command cannot be loaded, because running scripts is disabled on this system

Solution:

In this scenario, we need to execute the following script, granting us permission to execute the scripts using PowerShell.

set-executionpolicy remotesigned

 

We’ll address the remaining Docker issues and their solutions in the subsequent blog post, Troubleshooting Docker Container Problems Part 2.

Hope this was useful. Enjoy your troubleshooting!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Saket Singh

Saket Singh is currently working with Perficient GDC Nagpur as a Senior Technical Consultant. He is a Sitecore developer who works on SXA and Sitecore Headless websites. He also has knowledge of ASP.NET, ASP.NET MVC, C#, Web API, MSSQL, and JavaScript. He enjoys discovering new technologies and understanding the architecture that supports them.

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram