Docker Community Forums
Share and learn in the Docker community.
- Primary Action
- Another Action
Panic: assignment to entry in nil map
When doing docker login in the command prompt / powershell, I the error posted below. Though when doing this, docker desktop gets logged in just fine.
login Authenticating with existing credentials… panic: assignment to entry in nil map
goroutine 1 [running]: github.com/docker/cli/cli/config/credentials.(*fileStore).Store (0xc0004d32c0, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x149b9b7, …}, …})
Although powershell is available for Linux and macOS as well, I assume you installed Docker Desktop on Windows, right?
I thing so because I have the same problem and I certainly installed on Windows… Do you have a solution? QVQ
I believe I’m experiencing the same issue - new laptop, new docker desktop for windows install. can’t login via command line:
goroutine 1 [running]: github.com/docker/cli/cli/config/credentials.(*fileStore).Store (0xc0004d4600, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc00003c420, …}, …}) /go/src/github.com/docker/cli/cli/config/credentials/file_store.go:55 +0x49
I’m experiencing the same issue with my new windows laptop with fresh installation of docker.
Sorry, shortly after posting, I came to think about this very important info. You are of course absolutely correct. This is on a freshly installed Windows 11, latest docker-desktop.
I could try, if wanted. To do a fresh install on a Linux box and see if I experience the same issue there?
I have the same issue, works for me when I use WT and ubuntu, but not from cmd, git bash or powershell
If it is not a problem for you, that coud help to find out if it is only a Windows issue, but since so many of you had the same issue on the same day, it is very likely to be a bug. Can you share this issue on GitHub?
I tried it on my Windows even though I don’t use Docker Desktop on Windows only when I try to help someone, and it worked for me but it doesn’t mean that it’s not a bug.
If you report the bug on GitHub and share the link here, everyone can join the conversation there too.
In the meantime everyone could try to rename the .docker folder in the \Users\USERNAME folder and try the docke rlogin command again. If the error was something in that folder, that can fix it, but even if it is the case, it shouldn’t have happened.
you cloud try to run docker logout and then docker login ,it works for me .
That’s a good idea too.
I can verify that this did help on my PC too. I have created en issue here:
Hi all, a fix for this will be tracked on the docker/cli issue tracker: Nil pointer dereference on loading the config file · Issue #4414 · docker/cli · GitHub
I was using “az acr login” to do an azure registry docker login and getting this error, but I followed your advice and did a “docker logout” and that cleaned up my issue.
worked for my on my box (latest docker - Docker version 24.0.2, build cb74dfc) on W11. thx for solution.
its work for me. Recommend!
This solution works for me
“docker logout” works for me. Thank you!
Logout worked here too!
Related topics
Example error:
This panic occurs when you fail to initialize a map properly.
Initial Steps Overview
- Check the declaration of the map
Detailed Steps
1) check the declaration of the map.
If necessary, use the error information to locate the map causing the issue, then find where this map is first declared, which may be as below:
The block of code above specifies the kind of map we want ( string: int ), but doesn’t actually create a map for us to use. This will cause a panic when we try to assign values to the map. Instead you should use the make keyword as outlined in Solution A . If you are trying to create a series of nested maps (a map similar to a JSON structure, for example), see Solution B .
Solutions List
A) use ‘make’ to initialize the map.
B) Nested maps
Solutions Detail
Instead, we can use make to initialize a map of the specified type. We’re then free to set and retrieve key:value pairs in the map as usual.
B) Nested Maps
If you are trying to use a map within another map, for example when building JSON-like data, things can become more complicated, but the same principles remain in that make is required to initialize a map.
For a more convenient way to work with this kind of nested structure see Further Step 1 . It may also be worth considering using Go structs or the Go JSON package .
Further Steps
- Use composite literals to create map in-line
1) Use composite literals to create map in-line
Using a composite literal we can skip having to use the make keyword and reduce the required number of lines of code.
Further Information
https://yourbasic.org/golang/gotcha-assignment-entry-nil-map/ https://stackoverflow.com/questions/35379378/go-assignment-to-entry-in-nil-map https://stackoverflow.com/questions/27267900/runtime-error-assignment-to-entry-in-nil-map
Navigation Menu
Search code, repositories, users, issues, pull requests..., provide feedback.
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly.
To see all available qualifiers, see our documentation .
- Notifications You must be signed in to change notification settings
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
panic: assignment to entry in nil map #803
adamreese commented Jun 8, 2016
No branches or pull requests
Lxd init - panic: assignment to entry in nil map
FWIW I’ve been getting this since LXD 3.0 final for Ubuntu 18.04 with zfs, btrfs and dir storage options…
Will investigate tomorrow.
IMAGES
VIDEO
COMMENTS
Hi. I believe I'm experiencing the same issue - new laptop, new docker desktop for windows install. can't login via command line: goroutine 1 [running]:
A nil map behaves like an empty map when reading, but attempts to write to a nil map will cause a runtime panic; don't do that. Share. Improve this answer. Follow edited Aug 18, 2023 at 10:45. Telemachus. 19.7k 7 7 ... panic: assignment to entry in nil map on single simple map. 0. assignment to entry in nil map. 1. Parsing YAML in Go : map in ...
The initial capacity does not bound its size: maps grow to accommodate the number of items stored in them, with the exception of nil maps. A nil map is equivalent to an empty map except that no elements may be added. You write: var countedData map[string][]ChartElement Instead, to initialize the map, write, countedData := make(map[string ...
Client: Version: 24.0.2 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.11. Path: C: \P rogram Files \D ocker \c li-plugins \d ocker-buildx.exe compose: Docker Compose (Docker Inc.) Version: v2.19.1 Path: C: \P rogram Files \D ocker \c li-plugins \d ocker-compose.exe dev: Docker Dev Environments ...
$ go run main.go panic: assignment to entry in nil map This panic occurs when you fail to initialize a map properly. Initial Steps Overview. Check the declaration of the map; Detailed Steps 1) Check the declaration of the map
assignment to entry in nil map. and correlate with the information about how to use maps in, for example, the tour.
package main import ( "fmt" ) type Plan struct { BufferMeasures map[string]*ItemSiteMeasure } type ItemSiteMeasure struct { itemtest string } func main() { fmt ...
droid[matchId][droidId] = Match{1, 100} <-- this is line trown the Panic: assignment to entry in nil map. return invalid} The above code is being called from main. radovskyb (Benjamin Radovsky) September 2, 2016, 2:53pm 5. frayela: droid[matchId][droidId] = Match{1, 100} <- this is line trown the Panic: assignment to entry in nil map ...
% tiller Using default namespace "helm" Tiller is running on :44134 Tiller probes server is running on :44135 panic: assignment to entry in nil map goroutine 11 [running]: panic(0x1113500, 0xc8204d...
FWIW I've been getting this since LXD 3.0 final for Ubuntu 18.04 with zfs, btrfs and dir storage options… + lxd init --auto --network-address 192.168..2 --network-port 8443 --storage-backend zfs --storage-create-loop 25 --storage-pool lxd-pool --trust-password ffcbOsz4HTcGD2WZ panic: assignment to entry in nil map goroutine 1 [running]: main.(*cmdInit).RunAuto(0xc4202a7730, 0xc4202c2500 ...