Conversation
mikermcneil
commented
Mar 19, 2021
- Add workaround for browser warning when accessing Fleet
- Add workaround for docker/compose#7495 to quickstart instructions
- Add quickstart instructions for using a real-world device
| # Edit your Docker config | ||
| # • remove "credsStore": "desktop" | ||
| # • remove the preceding comma (,) to ensure well-formed JSON | ||
| nano ~/.docker/config.json | ||
|
|
There was a problem hiding this comment.
I think this should be added as a note as the error does not happen on every Docker installation. It didn't happen on a fresh Ubuntu VM and I am in the process of testing in a fresh Big Sur VM.
There was a problem hiding this comment.
Just saw it be necessary on a brand new (non VM) Catalina macOS (10.15.7) box that had never had Docker installed
Also saw it again on a non VM Big Sur (11.2.3) box after uninstalling and reinstalling Docker
There was a problem hiding this comment.
Ohhh, interesting, it reproduces when fleetctl preview is run without sudo. On my other attempts I had installed Node via other means (besides homebrew) that meant I had to do sudo fleetctl preview. Can you check if sudo fleetctl preview works on the machines you are testing? Maybe we can recommend that?
There was a problem hiding this comment.
Nice! I’ll change the config back and give it a try to verify. Some folks will no doubt prefer not to use sudo, but we can nestle alternative instructions somewhere else in the docs for when/if that comes up.
There was a problem hiding this comment.
After:
- adding back
"credsStore": "desktop" - and quitting and restarting Docker Desktop
- then running
fleetctl previewanew (withoutsudo)....
I couldn't replicate the issue. It's like it only needs credsStore to be gone the very first time you run fleetctl preview, like when it's first setting up the containerbundlethang with the simulated Linux hosts in it.
After that thing exists in Docker Desktop, whether green and online or grayed out and offline, running fleetctl preview without sudo works just fine, regardless of the credsStore config.
It's still possible Docker just isn't picking up the config change-- I didn't dig in docs to verify that. Though I did notice the ~/.docker/config.json keys were reordered after reopening Docker Desktop, so that leads me to believe it was being read.
Nevertheless, might as well get to the bottom of it while I remember all of the details.
Soooooooooooooo:
- I uninstalled Docker Desktop again. Then reinstalled it. Opened it. All good.
- As a sanity check, I then verified the contents of my
~/.docker/config.jsonfile. Just like before, uninstalling+reinstalling Docker caused that file to revert back to its default (i.e."credsStore": "desktop"is back.) - Then, I tried running the first-time
fleetctl previewwithoutsudoagain.
Sure enough, got the expected error again, at the same place as before (when attempting to start up simulated hosts for the first time with a clean Docker install):
File "docker/credentials/store.py", line 23, in __init__
docker.credentials.errors.InitializationError: docker-credential-desktop not installed or not available in PATH
But this time, rather than changing the ~/.docker/config.json file, I ran sudo fleetctl preview.
As predicted, this worked!
Epilogue
In the spirit of hopefully not having to uninstall and reinstall Docker again for a while, I went ahead and tried one more thing:
- Quit Docker Desktop.
- Started it up again. As expected,
fleet-preview-devicesandfleet-preview-serverboth still showed up as gray (EXITED (UNDEFINED)). And as expected, localhost:8412 was not accessible in the browser. - Then, just to prove I'm not crazy, I checked
~/.docker/config.jsonand saw it was indeed still the default ("credsStore":"desktop"was still there) - Last but not least, I ran
fleetctl previewwithout thesudo.
As expected, it worked!
version
In case this comes back up later: All of the above testing was done with the latest (unpublished) code from Fleet's master branch fleet@439dfbdc7a5005236e22febff8772106d2738f42 -- when I said fleetctl preview and sudo fleetctl preview, I really meant go run ./cmd/fleetctl preview and sudo go run ./cmd/fleetctl preview.
There was a problem hiding this comment.
FUTURE: Figure out why starting the simulated hosts fails the first time you do it if you don't either use sudo or remove credsStore from docker config. Probably something we could work around. Seems like something we're doing w/ docker is maybe expecting docker-credential-desktop to be in the process-executing user's path, but it's only available in the path with sudo? And presumably the reason why removing credsStore works is because it just skips whatever Docker is trying to do with docker-credential-desktop.
See #505 (comment) for more info.
