Closed milon27 closed 1 year ago
solved by: reinstalling docker desktop version 4.12.0
Uninstalling and reinstalling didn't work for me. Also tried removing & installing Hyper-V and WSL which also didn't work.
Have exactly the same problem, when trying to launch a project with docker-compose, trigger the message:
docker endpoint for "default" not found
Reinstalling docker desktop version 4.13.0 and still not working.
I am having the same issue after installing docker desktop 4.13.0 on windows
solved by: reinstalling docker desktop version 4.12.0
docker context ls
returns:
invalid character '\x00' looking for beginning of value
Traced it up to ~/.docker/contexts/meta/(some sha256)/meta.json
. meta.json
was just full of NUL
s. Deleted it, restarted Docker, and Docker 4.13.0 started working again. meta.json
now has JSON.
Can build again.
So, a workaround, but bug wasn't exactly solved.
Using @nelsonjchen workaround as a guide to my own solution.
On my Windows 10 machine machine, 'docker context ls' returns: 'too many redirects'.
the ~/ .docker/contexts directory is non-existent.
I renamed the ~/.docker directory to something elsse (i.e. ~/.docker-old) and restarted docker.
Everything works.
I should clarify that the paths I mentioned are in WSL2's environment. They symlink to the "C:
" or /mnt/c
pathes.
My ~/.docker/contexts/meta/(some sha256)/meta.json
was also full of nulls. Deleted it, and restarted the docker service only. I was able to docker compose without issue.
My
~/.docker/contexts/meta/(some sha256)/meta.json
was also full of nulls. Deleted it, and restarted the docker service only.
Missing the punchline. Did it work?
Yes, updated comment.
@nelsonjchen your workaround is a lifesaver. Thanks!
Thanks for the reports - this looks like an issue in Docker Desktop itself (Compose does not handle management of contexts), so I'm closing in favor of docker/for-win#12561.
@nelsonjchen thank you for help
Just started using Docker and where what how do I find the .docker/contexts files?
Just started using Docker and where what how do I find the .docker/contexts files?
%userprofile%\.docker\contexts
Solved by adding this to "~/.docker/contexts/meta/(some sha256)/meta.json" {"Name":"desktop-linux","Metadata":{},"Endpoints":{"docker":{"Host":"npipe:////./pipe/dockerDesktopLinuxEngine","SkipTLSVerify":false}}}
docker context ls
This worked for me!
docker context ls
returns:
invalid character '\x00' looking for beginning of value
Traced it up to
~/.docker/contexts/meta/(some sha256)/meta.json
.meta.json
was just full ofNUL
s. Deleted it, restarted Docker, and Docker 4.13.0 started working again.meta.json
now has JSON.Can build again.
So, a workaround, but bug wasn't exactly solved.
Thanks. This worked for me as well
For Windows Users
.docker
directory. Which exists on PATH C:\Users\your-username\.docker
For Windows Users
- Delete
.docker
directory. Which exists on PATHC:\Users\your-username\.docker
- Restart docker.
Thanks man, it's works to me!
I've tried deleting the .docker directory and restart docker, however it doesn't work and hasn't worked since last year sometime. I should clarify that I'm using this in the context of Visual Studio 2022. I'm running the following:
docker desktop: 4.16.2 (95914) windows 10 Pro: 22H2
Since I didn't want to remove the whole ~/.docker
folder, I removed only ~/.docker/contexts/meta/(some sha256)/meta.json
. Solved the issue.
Since I didn't want to remove the whole
~/.docker
folder, I removed only~/.docker/contexts/meta/(some sha256)/meta.json
. Solved the issue.
@maks-rafalko Solution worked for me. Thanks
Since I didn't want to remove the whole
~/.docker
folder, I removed only~/.docker/contexts/meta/(some sha256)/meta.json
. Solved the issue.
Thank for you solution. It's worked.
still not fixed! Docker Desktop 4.16.2 (95914) Windows 11 22H2
up
Hi @milon27, Your post's title attracts attention, but the discussion seems to get longer over time. I suggest you add a TLDR at the top of your first post. You may compose your own or use this:
"""
TL;DR:
It turns out this error is caused by one or more broken docker "contexts" after an update, which is tracked in another issue.
A quick solution is to remove these broken contexts that reside in %userprofile%\.docker\contexts
.
be careful as this includes "deleting" things from your computer.
"""
disable Docker Compose V2that worked for me and run docker-compose ["whatever"]
Confirmed for me too - had a very old file in %USERPROFILE%.docker\context\docker buildx ls
shows now builders!
here is my info: (snipped some stuff at the end)
c:\> docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
...
Ran into ERROR: docker endpoint for "default" not found
, solved based on the following https://github.com/docker/compose/issues/9956#issuecomment-1399070673
Since I didn't want to remove the whole
~/.docker
folder, I removed only~/.docker/contexts/meta/(some sha256)/meta.json
. Solved the issue.
running on Win11:
> docker buildx ls
ERROR: docker endpoint for "default" not found
> rm -r -force ~\.docker\contexts\meta\
> docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker
default default running 20.10.22 linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
> docker --version
Docker version 20.10.22, build 3a2c30b
> docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
rm -r -force ~\.docker\contexts\meta\
Thank you! Your solution works! I ran this command and then restart Docker Desktop! docker desktop: 4.16.3 windows 10 Pro: 22H2
For Windows Users
- Delete
.docker
directory. Which exists on PATHC:\Users\your-username\.docker
- Restart docker.
thanks,It worked for me !
People will, someday, learn to use that emoji button to tell us it works without telling us it works.
I got this situation multiple times in a row. It looks like that the meta.json 0KB issue is only a secondary error and is produced when docker can't start fully up.
I believe one of the images got corrupted and simply made a break/timeout in multiple internal docker-host components
after clearing the full image store twice it works gain.
disable Docker Compose V2that worked for me and run docker-compose ["whatever"]
This worked for me (version 4.16.3), thanks @ufedev
We are aware this is affecting a lot of Compose + Docker Desktop users so are reopening this issue for tracking and visibility.
Internally, we are working on this and will provide an update with the resolution once available. Thanks for your continued patience!
Thanks to everyone who has posted workarounds so far. If one is working for you, please use the GitHub 👍 reaction on the comment to leave a signal for others.
Docker Desktop 4.16.3 (96739)
Each time when I want to build app in Linux env I have to rm -rf ~\.docker\contexts\meta\
because
$ docker context ls
unexpected end of JSON input
docker endpoint for "default" not found
was resolved by deleting ~/.docker/contexts/meta/(some sha256)/meta.json
as @nelsonjchen suggested
is it possible to lock the thread, tell people to read workaround solutions given countless times, and emphasize to "open a new report only if none of them works"?
or else, there will be thousands of "thanks, it works" messages in no time.
Technically, none of them works for me because it is a pain to do it every 5 minutes
@QuAzI
"it is a pain to do it every 5 minutes".
Hold on there! You are the first one using this narrow interval among the posts I have seen. If you are not kidding around to fetch attention, your story can help identify the problem faster. Why don't you give it a try and spend some time:
Almost each time when I change something in app and want to test it in Linux env I have to remove meta as it is empty. So, my each build looks like
> docker-compose up --build
docker endpoint for "default" not found
> wsl
> rm -rf ~/.docker/contexts/meta/
> exit
> docker-compose up --build
Windows 10 Pro 21H2 [Version 10.0.19044.2364] WSL with Ubuntu 22.04.1 LTS (kernel 5.15.79.1-microsoft-standard-WSL2)
>docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:36:18 2022
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.16.3 (96739)
Engine:
Version: 20.10.22
API version: 1.41 (minimum version 1.12)
Go version: go1.18.9
Git commit: 42c8b31
Built: Thu Dec 15 22:26:14 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.14
GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Even for simple new dotnet app with react with multistage build docker-files.zip
It is also big pain to reinstall different versions as I have a lot of windows containers (stopped while I use Linux env) and rebuild of them can spend a lot of time as docker for win10 doesn't support isolation=process
.
$ ls -l ~/.docker/contexts/meta/fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e/meta.json
-rwxrwxrwx 1 quazi quazi 0 Feb 8 19:42 /home/quazi/.docker/contexts/meta/fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e/meta.json
$ docker context ls
unexpected end of JSON input
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
615c37f018ea bridge bridge local
e9d223c049ad host host local
76287cca2804 none null local
Looks like docker endpoint for "default" not found
means no default network can be created
When docker started fine, I see new network
015517dde602 newwordsdictionary_default bridge local
Minimal config for dotnet new webapp
which also throws problem
dotnet new webapp.zip
Ok, hold on again but this time for a misunderstanding. Your details have a few extras to look for such as using both Windows and Linux containers, and Ubuntu 22.04.
But before going on, the folder you should be removing is C:\Users\<yourusername>\.docker\contexts\meta\etc..
, not the one inside the WSL. Can you check, with this correction, if you will get the problem this frequently?
Interesting... After I removed %USERPROFILE%\.docker\contexts\meta
my last minimal test with webapp works fine. But previous test creates empty meta.json again
problematic docker-files.zip
I'm curious what the output here is. To be honest, I'm no Windows driver developer but this does seem interesting.
@nelsonjchen
C:\WINDOWS\system32>fltmc filters
Filter Name Num Instances Altitude Frame
------------------------------ ------------- ------------ -----
bindflt 1 409800 0
FsDepends 11 407000 0
DwProt 11 323610 0
SpiderG3 11 323600 0
storqosflt 2 244000 0
wcifs 3 189900 0
CldFlt 6 180451 0
FileCrypt 0 141100 0
luafv 1 135000 0
npsvctrig 1 46000 0
Wof 8 40700 0
FileInfo 11 40500 0
C:\WINDOWS\system32>fltmc volumes
Dos Name Volume Name FileSystem Status
------------------------------ --------------------------------------- ---------- --------
\Device\Mup Remote
D: \Device\HarddiskVolume7 NTFS
C: \Device\HarddiskVolume5 NTFS
\Device\NamedPipe NamedPipe
\Device\Mailslot Mailslot
\Device\HarddiskVolume3 FAT
E: \Device\HarddiskVolume2 NTFS
\Device\HarddiskVolume6 NTFS
C:\ProgramData\Microsoft\Windows\Containers\BaseImages\2fd8febc-ccab-468c-a514-3c07da17377e\BaseLayer \Device\HarddiskVolume10 NTFS
K: \Device\HarddiskVolume33 FAT
\Device\HarddiskVolumeShadowCopy3 NTFS
\Device\HarddiskVolumeShadowCopy4 NTFS
\Device\HarddiskVolumeShadowCopy5 NTFS
@QuAzI , I tested against having a multi-layer in the build file. I modified it for a sample ASP.NET application. both the build file and compose files worked fine for me. That suggests something else in your system (docker service?) retains that empty meta file and rewrites it back into contexts. try "down" first then "up" again containers created with compose, clearing older images possibly created during your struggles, and restarting the host machine.
PS: not related to the problem at hand, your app is not scalable because of the custom name and single port. keep an eye when deploying ;)
Description
when building Dockefile with docker compose
got this error docker endpoint for "default" not found but if i try to build with a remote docker image compose works fine.
github repo: https://github.com/milon27/hello-docker.git
Steps To Reproduce
docker compose up
os: windows 10 docker desktop version: 4.13.0
note: it was fine when I update the docker desktop to the latest version this problem started.
Compose Version
Docker Environment
Anything else?
Error screenshot