1

When running docker compose up -d, the cd container shows as unhealthy. It was functioning properly yesterday.

I am seeing these errors when the CD container is starting up, and I can see the site shutting down and starting back up in a continuous loop:

[LOGMONITOR] ERROR: Error in log file monitor. Failed to query file information. File: \\?\c:\inetpub\wwwroot\App_Data\logs\log.20230614.143115.txt. Error: 50

[LOGMONITOR] ERROR: Error in log file monitor. Failed to query file ID. File: \\?\c:\inetpub\wwwroot\App_Data\logs\log.20230614.143115.txt. Error: 50

2023-06-14 15:01:29 2800 15:01:19 INFO  **************************************************
2023-06-14 15:01:29 2800 15:01:19 WARN  Sitecore shutting down
2023-06-14 15:01:29 2800 15:01:19 WARN  Shutdown message: Initialization Error
2023-06-14 15:01:29 HostingEnvironment initiated shutdown
2023-06-14 15:01:52 [2023-06-14T21:01:52.000Z][LOGMONITOR] ERROR: Error in log file monitor. Failed to query file information. File: \\?\c:\inetpub\wwwroot\App_Data\logs\log.20230614.150152.txt. Error: 50
2023-06-14 15:01:52 [2023-06-14T21:01:52.000Z][LOGMONITOR] ERROR: Error in log file monitor. Failed to query file ID. File: \\?\c:\inetpub\wwwroot\App_Data\logs\log.20230614.150152.txt. Error: 50
2023-06-14 15:02:19 2023-06-14 21:01:09 ::1 GET /healthz/ready - 80 - ::1 Mozilla/5.0+(Windows+NT;+Windows+NT+10.0;+en-US)+WindowsPowerShell/5.1.17763.3770 - 500 0 0 18197

Due to this issue, I am unable to access any of the sites.

I tried:

  • Restarting Docker client
  • Cleaning out the docker/data/cd folder
  • Running docker system prune
  • Rebuilding the containers via docker compose up --build

The only (inconclusive) references I could find related to this error are:

EDIT - Solution

Using the information provided by others on this post, I was able to drill down and location the issue: my Web/Master/Core databases were missing from the mssql container entirely (despite them being present in the \docker\data\mssql directory), which was resulting in the error:

Exception Details: System.Data.SqlClient.SqlException: Cannot open database Sitecore.Web;requested by the login. The login failed. Login failed for user 'sa'

Not sure how this happened, but good to know that such database issues can cause endless restarts of CD.

3
  • 1
    You might find more useful info in the event logs. Try increasing interval in the health check (on docker compose file), in order to delay it restarting. Then use technique here to view event logs stackoverflow.com/questions/41215471/… Jun 14, 2023 at 21:40
  • 1
    @DeanOBrien The answer provided by Gaurav is an easier way to get to the true error message, but the method you mentioned definitely works as well! Jun 15, 2023 at 16:30
  • Ok no problem, glad you got it sorted. Jun 15, 2023 at 17:35

1 Answer 1

3

From your laptop, open Powershell and run "docker container ls". Find the container listed with an unhealthy status.

Open Docker Desktop and select the container that is unhealthy (In your case it is CD container). Note: An unhealthy container may not appear unhealthy within the Docker desktop which is why the previous "ls" command is so critical.

Check the logs. It will most likely be running the health check periodically and it will write the attempt to the logs. Here is an example of a failing CM health check:

GET /healthz/ready - 80 - ::1 Mozilla/5.0+(Windows+NT;+Windows+NT+10.0;+en-US)+WindowsPowerShell/5.1.17763.2268 - 500 0 0 35126

Notice that the health check is trying to visit /healthz/ready and is receiving a 500 status code. This means our application is experiencing a YSOD but we cannot see it in the Sitecore logs (because Sitecore cannot even start).

Next, issue this command in the shell to view the raw output:

curl http://127.0.0.1/healthz/ready

This very quickly showed me that we had a bad reference pushed and we cleaned it up.

A similar approach can be utilized on all container types. Each container may have a slightly different health check, but this approach gets directly to the root of the problem.

2
  • 1
    Thank you Gaurav. This is an easy and effective method to get to the root of the problem. Jun 15, 2023 at 16:32
  • Glad you were able to get the issue. Jun 16, 2023 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.