desktop-linux
desktop-linux copied to clipboard
unexpected end of JSON input

- [yes] I have tried with the latest version of Docker Desktop
- [already disabled] I have tried disabling enabled experimental features
- [no] I have uploaded Diagnostics
Expected behavior
when open docker desktop supposed to open smoothly
Actual behavior
while using docker command line interface or docker desktop i got error "unexpected end of JSON input"
Information
- Linux distro: ubuntu
- Distro version: 20.04.4
- Docker Desktop Version: 4.11.0
I found that there is a file in path ~/.docker/contexts/meta/fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e/meta.json and it was empty json file, after writing empty json object i got another error so i searched about this file and i copied a dump from documentation example and now it works.
I don't know how this file got cleared and what supposed to contain based on my env

@mohamed-foly , would you be willing to share the link to the doc you found?
Thanks so much for posting this! I got my contexting listing again by putting this in:
{
"Name": "default",
"Metadata": {
"StackOrchestrator": "swarm"
},
"Endpoints": {
"docker": {
"Host": "unix:///var/run/docker.sock",
"SkipTLSVerify": false
}
},
"TLSMaterial": {}
}
@mohamed-foly , would you be willing to share the link to the doc you found?
@src-r-r https://docs.docker.com/engine/context/working-with-contexts/#the-anatomy-of-a-context
Also experienced this issue - the meta.json file described above had become blank, meaning that all docker commands (e.g. docker ps, docker compose) didn't work; and replacing the content of the file as above restores functionality.
Seeing this as well. Seen it empty or no file present. Use a laptop and network frequently changes.
Same issue with the windows docker desktop: https://github.com/docker/for-win/issues/13180
How does can I update default context ? I try to find the file path, but unsucessful. SO: Linux Mint
I got the same issue. Here is what I walk-around it. FYI.
- Use
docker context create dummyto create a new context calleddummy - Copy the meta.json content to overwrite the broken one in the context folder
- Change the name in that meta.json
- Then
docker context listwill show up all the contexts available - Use
docker context rm dummyto remove the dummy one, and it's done.
There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 30 days.
Prevent issues from auto-closing with a /lifecycle frozen comment.
/lifecycle stale