Troubleshooting unhealthy Sitecore containers on Docker

Pranay
Jul 29, 2022  ยท  1005 views

Here is a list of reasons for which your Sitecore containers on docker might be down. This could be for a first time setup or for an existence Sitecore docker setup

The Sitecore containers on Docker might go down for many reasons. Here is a list of some probable reasons why they might go down and also some troubleshoot techniques through which you can find the root cause behind the unhealthy containers.

Running Sitecore on containers

  1. Make sure your docker is running on Windows containers. To check this, right click on the Docker icon in the system tray and check if you are seeing 'Switch to Linux containers' option. If yes, then the Docker is already running for Windows containers .

    sitecore docker troubleshooting

  2. Make sure 'Use Docker Compose V2' is unchecked.

    Sitecore docker compose version 2

  3. Run the following commands and see if that works

     docker-compose stop
     docker-compose down
     iisreset /stop
     docker-compose up -d
    
  4. 404 page not found error: If you are seeing this error when browsing the CM/CD site then this might be the cause. Connect to the containers either from Visual Studio or from Visual Studio Code and run the following command to browse the site from inside the containers. This will show the actual error on the site and accordingly it can be resolved.

     curl http://localhost/
    

    containers from vs code

    curl localhost from vs code

  5. Error due to the docker-compose is running on v2 version. Run this command to check the same

    docker componse version 2

    If it is running in v2, then uncheck 'Use Docker Compose V2' in Docker -> settings. Sometimes you might see that it shows v2 even though the 'Use Docker Compose V2' is unchecked. In that case disable the V2 using the following command

     docker-compose disable-v2
    
  6. mem_limit error: This error is also caused due the reason that your docker is running on V2. SO make sure it is not running on v2.

  7. ERROR: for xxxxxx Cannot start service xxxxxx: hcsshim: :CreateComputeSystem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. The requested resource is in use.. You may see this error when trying to bring up the containers as shown below.

    The solution is to restart the service "Hyper-V Host Compute Service" and try again.

  8. Stop IIS and also disconnect from any VPN service if you are connected. The docker might not work if your VPN is active.

  9. Check the Sitecore logs and Docker logs.

    • Sitecore logs folder path depends on to which path it is mapped.
    • Docker logs can be checked by clicking on the running container in Docker desktop.
  10. Run the clean.ps1 script to remove the Solr an SQL Server files and try again.

Will keep this post updated with all the latest troubleshoot issues. Hope this helps.

AUTHOR

Pranay

A Software Engineer by profession, a part time blogger and an enthusiast programmer. You can find more about me here.


Post a comment




Thank you! You are now subscribed.

Sign up for our newsletter

Subscribe to receive updates on our latest posts.

Thank you! You are now subscribed.