I'm having trouble getting a basic xp0 environment set up on my local development machine. When I run docker-compose up it times out on the xconnect healthcheck because of a SQL login error to the Sitecore.Xdb.Collection.ShardMapManager database. When I connect to the SQL server with SQL Server Management Studio from my host (localhost,14433), I see that that database is not installed (its mdf/ldf files are not in the mssql-data folder, either).

Any ideas why that database wouldn't be included?

Error messages

Creating network "sitecore-xp0_default" with the default driver
Creating sitecore-xp0_mssql_1 ... done
Creating sitecore-xp0_solr_1  ... done
Creating sitecore-xp0_xconnect_1 ... done
Creating sitecore-xp0_id_1       ... done
Creating sitecore-xp0_cm_1       ... done
ERROR: for xdbsearchworker  Container "2cecc38acde2" is unhealthy.
ERROR: for xdbautomationworker  Container "2cecc38acde2" is unhealthy.
ERROR: for cortexprocessingworker  Container "2cecc38acde2" is unhealthy.
ERROR: for traefik  Container "692fab8efdaa" is unhealthy.
ERROR: Encountered errors while bringing up the project.

Things I've tried

  1. Cleaning and retrying (docker-compose down; .\clean.ps1; docker-compose up -d)
  2. Completely redownloading all images (docker-compose down; .\clean.ps1; docker image prune -a; docker-compose up -d)

Environment details

  • I'm using the ltsc-2019 getting-started examples from the Docker Examples Sitecore repo
  • I'm using the defaults for everything in the .env file and init.ps1

Quick fix

This turned out to be a permissions issue that prevented the ShardMapManager database (and accompanying shard databases) from being installed. To fix it, I needed to give the NETWORK SERVICE account access to the mssql-data folder on my host.

More info on troubleshooting

Run docker-compose logs mssql to see the logs for the SQL server. In my case, it showed the following error:

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\data\Sitecore.Xdb.Collection.ShardMapManager.mdf'.

Since it was trying to create the database in a volume mapped to the host (and volume permissions are shared between host and container), I discovered I needed to adjust the permissions of that directory. I ran the following commands to see what account I needed to grant access to:

docker exec -it <container_id> powershell
Get-Process -IncludeUserName | ft -auto

enter image description here

These commands showed me that the sqlserver process was running as NT AUTHORITY\NETWORK SERVICE, which did not have access to the mssql-data folder. Granting access resolved the issue.


I faced this issue too during installation. Try the below steps:

  1. Run docker-compose stop on Powershell.
  2. Run docker-compose down on Powershell.
  3. Now run iisreset /stop on Powershell to make sure that the required ports are free.
  4. Now run docker-compose up -d on Powershell.

Hoping this solves your issue.

  • Hi Vinay, this worked for me after not knowing how I ended up breaking stuff. Jul 13 '21 at 15:07
  • Glad that it worked for you Chris. Jul 14 '21 at 17:22
  • This worked for me, thought it was a port issue as VS was also not connecting to TFS when docker was running
    – Sean T
    Sep 13 '21 at 11:22

In addition to the correct answer: It is worth noting that running a clean on the host directory can help, especially after granting NETWORK SERVICE full access to the MSSQL directory as the databases will need to re-established at run time.

The clean.ps1 can be found here: https://github.com/Sitecore/docker-examples/blob/develop/getting-started/clean.ps1

Apologise for not adding this as a comment - I don't have enough reputational points to add comments apparently.


I also faced this issue during installation. So I tried this.

Run docker-compose up -d in powershell for 2 3 times and it works.

  • Run it a few times is not a solution
    – Sean T
    Sep 14 '21 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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