Insights

Sitecore Docker Pro Tip Series: traefik-Container-xxxxxx-is_unhealthy

The Scenario & Problem

I recently worked on spinning up a Sitecore 10.2 - SXA Docker instance with XConnect and all the XDB services (xdbsearchworker, xdbautomationworker and cortexprocessingworker). Previously, I had worked on a 10.1 instance, so I just copied the compose files and took for granted that it was just a matter of changing up a few tags to point to 10.2 in the compose files . No such luck.

  1. New mssql-init service to initialize the dbs
  2. Changes to the Docker build files

So I worked my way through changing a few things (a process I will write up about soon..), spun the instance up, and got this.

ERROR: for traefik Container "xxxxxx" is unhealthy.

ERROR: Encountered errors while bringing up the project.

Anyways, after much investigating, the error message was true, but in this case the traefik container wasn't at fault, but one of the dependencies of its dependencies. Dependency tracing can be really hectic to perform, especially for a large compose file as this Sitecore xp1/xp0 topology.

It turns out that my XConnect service was failing due to a Health Check Error, which in turn caused my CM service to fail because of the dependency.

The Solution

There was a missing entry for my XConnect regarding "Processing.Engine.Tasks". Now from the error above, you'd expect that there was some database connectivity issue with the "Sitecore.Processing.Engine.Tasks" database, which led to another rabbit trail of connecting to the mssql database and checking if it existed. However, in this case, it was a simple error on my part when copying across compose files from previous docker build projects. I was missing the environment variable in the XConnect compose entry:

Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=mssql;Initial Catalog=Sitecore.Processing.Engine.Tasks;User ID=sa;Password=${SQL_SA_PASSWORD}

This effectively lets XConnect know where to find the Processing.Engine.Tasks database (so not too far from the suggested error message right? ).

Cheers!

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting