-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.5.1(74721)
: docker context ls
gives invalid character '\x00' looking for beginning of value
`
#12561
Comments
I had tried creating new contexts and also installed all versions back to 4.3.2. I thought one of them would be viable since I had another update during that time. Yet the problem persisted. Thinking it would solve, I have also created new contexts. Again, the problem persisted. I have then found out that this update has broken one of my context files; to be specific, it emptied the content of a I did not create any specific contexts manually before. So this file should be one of the "default" contexts from previous updates. The folder this file resides in has a creation timestamp of "12 Dec 2021", and the file itself has the same creation but a modified timestamp of "15 Feb 2022", the time I have updated the program. Deleting this file/folder fixes this issue, but the truth that this file got broken remains. Please check the update/install process and fix this issue as it can easily happen again anytime. And also it would be a better idea to give a "context file is broken" message if this error happens. PS: I now removed my |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
We have to remove just |
Only if there is no specially made context in it. Else one needs to dig in, find corrupted context(s), remove only those that are not important, and replace others if there is a backup of them. corrupted context files have all content replaced by null bytes: "hello" becomes "\x00\x00\x00\x00\x00" hence the "\x00" error. A hex viewer will help to see this binary content. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Reopening, as we've gotten recent reports of Compose users hitting this - see docker/compose#9956. |
I have the same issue too. I thought that would be an issue related with VS Code. So I opened up an issue over there. I didn't use Compose but Dockerfile only. |
Hi @milas, does this problem come up only on Windows, or have you met it on other OSs? It seems to occur during updates but does not follow a strict occurrence pattern. I believe the docker setup does not create any contexts, and it is the docker executable/service that is responsible to create them when it first starts and just tries to use them afterward. Then this should be a problem of tracing when/how it closes the file handler to these context files when it goes down (version update or machine restart). |
I am facing this issue trying to build docker containers via compose on WSL. I arrived here via this link docker/compose#9956
I get this error
|
@stoooops , please try to read the solving comments and "TLDR" sections (when present) before adding up to the pile of complaints. |
I had read everything thank you very much for assuming I can't read. The issue persists. Please let me know what debug information you are looking for. I gave you the exact file and command. It works after reboot. |
please do not fight. obviously, you do not read as attentively as you think.
|
Hi again @milas, I was doing some thinkering with contexts and found out that I created a new context and tried to place
In the error I reported here, each and every character of the However, I could generate Of course, both situations means at least one context is broken (and removal of them fixes the problem), but I believe it is not fair to just redirect other bug discussions of this second type here. (also some users report the second case reanimates itself after a reboot) I suggest opening a new discussion to follow them together as they both are related to docker contexts, but also summarize these little details. for example, whatever the reason is, if someone with a broken context tries to run PS: @stoooops, I am sorry if you are confused and offended by my previous message. with this, you can see there many error messages coming up when the context is broken, and also many answers leading to the removal of context folder. just do not forget to be extra careful since you are deleting things from your computer. |
Write to a tempfile then move, so that if the process dies mid-write it doesn't corrupt the store. Also improve error messaging so that if a file does get corrupted, the user has some hope of figuring out which file is broken. For background, see: docker/for-win#13180 docker/for-win#12561 For a repro case, see: https://github.com/nicks/contextstore-sandbox Signed-off-by: Nick Santos <[email protected]>
Write to a tempfile then move, so that if the process dies mid-write it doesn't corrupt the store. Also improve error messaging so that if a file does get corrupted, the user has some hope of figuring out which file is broken. For background, see: docker/for-win#13180 docker/for-win#12561 For a repro case, see: https://github.com/nicks/contextstore-sandbox Signed-off-by: Nick Santos <[email protected]>
Write to a tempfile then move, so that if the process dies mid-write it doesn't corrupt the store. Also improve error messaging so that if a file does get corrupted, the user has some hope of figuring out which file is broken. For background, see: docker/for-win#13180 docker/for-win#12561 For a repro case, see: https://github.com/nicks/contextstore-sandbox Signed-off-by: Nick Santos <[email protected]>
Closing this issue because a fix has been released in Docker Desktop |
Hi @chaizeg, This is something great to hear. There is a small typo I should note: That release notes page shows the release date for version 4.17.0 as "2022-02-27". A small date typo. For a moment, I thought I was reading some old page :) |
Thank you @yilmazdurmaz, should be rectified now! |
Write to a tempfile then move, so that if the process dies mid-write it doesn't corrupt the store. Also improve error messaging so that if a file does get corrupted, the user has some hope of figuring out which file is broken. For background, see: docker/for-win#13180 docker/for-win#12561 For a repro case, see: https://github.com/nicks/contextstore-sandbox Signed-off-by: Nick Santos <[email protected]> (cherry picked from commit c2487c2) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
Write to a tempfile then move, so that if the process dies mid-write it doesn't corrupt the store. Also improve error messaging so that if a file does get corrupted, the user has some hope of figuring out which file is broken. For background, see: docker/for-win#13180 docker/for-win#12561 For a repro case, see: https://github.com/nicks/contextstore-sandbox Signed-off-by: Nick Santos <[email protected]>
TLDR: I have found out that some contexts' "meta.json" files under "~/.docker/contexts/*" were broken (all zeros inside) after the update for a reason. I don't know why it happens so can't say if it is avoidable. Removing these broken context files/folders seems to fix it, but since it involves deleting things do it cautiously.
Actual behavior
I use VSCode to work within containers. I got 2 updates recently; the previous one seemingly had no problem on me with WSL2, but I decided to update to the latest, 74721, because your update notes were telling me there were problems with that.
Now after the update, my containers are running but trying to get the list in VSCode docker extension, it fails to connect to docker. From the error I got, I tried
docker context ls
on a separate terminal and got this response:invalid character '\x00' looking for beginning of value
Expected behavior
Information
I don't know if this can be reproducible, but the problem is new, at least for me. And yes problem started with this latest update, also I don't use any experimental features. I have stopped both WSL2's LxssManager ad let docker restart it, and also shutdown docker and restarted it. None solved the problem.
Output of
& "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
Steps to reproduce the behavior
I don't know how to reproduce this. All I can say is this:
The text was updated successfully, but these errors were encountered: