Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

Friday, June 25, 2021

Sitecore 10 - Error response from daemon: Unrecognised volume spec: file '\\.\pipe\docker_engine'

Recently, I was trying to set up a new test environment, I downloaded the package from the Sitecore Site, I did the init and while doing the docker-compose up -d, I got this error 

Error - Error response from daemon: Unrecognised volume spec: file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform


Starting searching for the solution - the first one was to remove the back slash

https://github.com/nicholasdille/docker/issues/1


didn't help me, below is the exact location where I can see it's complaining.


I found this is a common issue because one person has recently posted on stackoverflow-

https://stackoverflow.com/questions/68010612/error-response-from-daemon-unrecognised-volume-spec-file-pipe-docker-engi



Now, It's getting very interesting for me :) 

I removed all containers and tried to set up a new lighthouse repository and found new issues

services.smtp.scale must be a integer


I think I have noticed that I have the latest version of PowerShell on my machine, I have uninstalled and restarted it, but after the restart, init and compose-up, I got a new error, interesting day today!!



Now, I made one change here 


I think must be an issue with the Docker, or PowerShell etc, I checked the docker and tried to run one sample application (Not the Sitecore one).

docker run -d -p 80:80 docker/getting-started


Error Details - 

PS C:\WINDOWS\system32> docker run -d -p 80:80 docker/getting-started

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (windows/amd64) and no specific platform was requested

38f2bb488cc23aa18b3aa3d4ec5fa865a2fd3e1dac19945304e15fcf07fe765b

docker: Error response from daemon: failed to create endpoint unruffled_goodall on network nat: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20).

I have changed the container to Linux and not got below warning

Digest: sha256:10555bb0c50e13fc4dd965ddb5f00e948ffa53c13ff15dcdc85b7ab65e1f240b

Status: Downloaded newer image for docker/getting-started:latest

a1d910768708a5221a179f05fdabf163b5625efe3ec9e59fd8e803ff1162bcb6

docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

 

I removed everything inside the docker using the below command

docker system prune

Ran the sample application and ran it successfully, I ran the Sitecore but it didn't work because of the Linux container 

no matching manifest for linux/amd64 in the manifest list entries

(Which is a common understanding because they have mentioned in the document that the container should be a window one)

Another issue -
time="2021-06-25T10:52:44+10:00" level=warning msg="network demo: network.external.name is deprecated in favor of network.name"

Found that external.name is deprecated but it's in use in the lighthouse demo here -



Reference URL: 

  1. https://docs.docker.com/compose/compose-file/compose-file-v2/
  2. https://github.com/docker/docker.github.io/issues/6453

 Uninstalled and installed Docker - and tried to run the sample application, Got below error 

docker: no matching manifest for windows/amd64 10.0.19042 in the manifest list entries.See 'docker run --help'.



The above issue got resolve when I updated the experimental mode =true, Now got one more issue


PS C:\Projects\Demo> docker run -d -p 80:80 docker/getting-started
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (windows/amd64) and no specific platform was requested
0df026cfa1bf9150741def5a9dbb252911bb7d4a68424db0574a49f543fd9156
docker: Error response from daemon: failed to create endpoint distracted_banach on network nat: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20).





I did a complete new machine setup, and followed the steps mentioned in the installation document, downloaded the package from here - https://github.com/Sitecore/docker-examples
Ran the ini and docker-compose up command, got below error now


PS C:\sitecore\docker-examples\getting-started> docker-compose up -d

Pulling mssql (scr.sitecore.com/sxp/sitecore-xp0-mssql:10.1.0-ltsc2019)...

ERROR: Get https://scr.sitecore.com/v2/: x509: certificate signed by unknown authority

PS C:\sitecore\docker-examples\getting-started>

Continusly getting the below error already turned off the firewall

x509: certificate signed by unknown authority

Continusly getting the below error already turned off the firewall.

Got the answere here - https://sitecore.namics.com/failed-to-pull-sitecore-image-on-aks/

normally means that your Docker is running in Linux container mode

Now, I got one more error 

ERROR: failed to register layer: rename C:\ProgramData\Docker\image\windowsfilter\layerdb\tmp\write-set-043761389 C:\ProgramData\Docker\image\windowsfilter\layerdb\sha256\a7ba3db29ebb3a32e6a9c912d6ab5941bd981a0c39a420e6786c70a66babb80b: Access is denied.

PS C:\sitecore\getting-started> I provided all access and removed the read only access, but still it didn't work. Finally found that could be related to Antivirous.

https://stackoverflow.com/questions/41104410/pull-image-with-docker-on-windows-10-failed-to-register-layer-denied-acce



Removing the complete antivisous just to make sure if that's the reason.



Removing the antiviroush has resolved my issue.



I can see an image file here -C:\ProgramData\Docker\image\windowsfilter\layerdb\sha256


Thursday, March 4, 2021

Sitecore 10 - ASP.NET Core Rendering with Docker and Sitecore 10 - Common issues and fixes.

Recently, I did two presentations on this topic, and during the local environment setup, I got a few errors. This blog post will mention those common issues and how I fixed them to make them work.


This error comes when we have the diff controller name (JSS rendering) the name should be the same and consistant,



Recreating the container resolve this issue - 

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

kill all running containers with docker kill $(docker ps -q)


Same as above, recreating the container.

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

kill all running containers with docker kill $(docker ps -q)


Same as above, recreating the container.

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

kill all running containers with docker kill $(docker ps -q)

Issue due to the naming inconsistency. After updating the JSS rendering name, the case got the fix.

Here is the link to my latest presentation - 

A few useful command - https://www.slideshare.net/JitendraSoni6/sitecore-10-aspnet-core-rendering-with-docker-and-sitecore-10

Docker
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker system prune
docker image prune
docker container prune
kill all running containers with docker kill $(docker ps -q)
delete all stopped containers with docker rm $(docker ps -a -q)
delete all images with docker rmi $(docker images -q)
update and stop a container that is in a crash-loop with docker update --restart=no && docker stop
Get docker container disk utilization: docker system df




Wednesday, March 3, 2021

Sitecore (Docker) - Fix for error response from daemon: conflict: unable to delete 77e0b9227773 (must be forced) - image is referenced in multiple repositories



Recently, I got the below error -

Error response from daemon: conflict: unable to delete 77e0b9227773 (must be forced) - image is referenced in multiple repositories

Error response from daemon: conflict: unable to delete 77e0b9227773 (must be forced) - image is referenced in multiple repositories

I checked that continer is already stopped and tried below command but that didn't resolve the issue

docker container prune

docker network prune

docker system prune

docker volume prune

docker builder prune

Finally, I tried the below command that help me to resolve the issue. I attempted to pass the -f parameter (I didn't find that details during the search)

docker image rm 77e0b9227773 --f

77e0b9227773  - this is the Id of the image.

I hope that will help to others.