Unable to download or extract debugger in Sitecore containers

Pranay
Feb 05, 2022  ยท  383 views

You might face this error while trying to debug code running in docker container of your Sitecore instance using Visual Studio

Here is the Siteore documentation on how to debug a Sitecore application/code running inside docker containers. However I have faced the following error even after following the same steps.

To understand more, connect to the container which you want to debug through Visual Studio code and attach shell. In the command run the following command and see if it is resolving.

curl https://aka.ms

If it is not resolving the, it means the container is not able to connect to internet to download a debugger.

To resolve this, follow the steps below.

  1. Run the following command to get the network adapter details and their priorities

     Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending
    
  2. Make sure your primary internet-connected network adapter has a least InterfaceMetric value. Here in my case I am using Wi-Fi, hence I set a least InterfaceMetric value to Wi-Fi. If you are also using Wi-FI and the InterfaceMetric is not the least value when compared to other networks, then update it to some minimum value using the following command.

     Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 3
    

    Network adapter

Restart your computer and try again. It should attach the debugger this time. Also, the curl or ping should work as expected inside the container.

curl aka.ms

Note: If you connect to a different internet network then you might see the issue again. For example, if you resolved the issue using the above steps for a Wi-Fi network and later you connected to another Wi-Fi network, you would see the issue again.

Hope this helps you.

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.