moby: Command 'docker login' does not work


BUG REPORT INFORMATION

Description

Docker crashes after command docker login

Steps to reproduce the issue:

  1. Run docker login

Describe the results you received:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x55a136904406]

goroutine 1 [running]:
github.com/docker/cli/cli/command.ConfigureAuth(0x55a138346e00, 0xc00034a1a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55a1382b6201, 0xc00005af80, 0xc00041b968)
        /go/src/github.com/docker/cli/cli/command/registry.go:128 +0x46
github.com/docker/cli/cli/command/registry.runLogin(0x55a138346e00, 0xc00034a1a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/docker/cli/cli/command/registry/login.go:123 +0x223
github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc000244840, 0x55a1393515c8, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/cli/cli/command/registry/login.go:45 +0xcc
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc000244840, 0xc000252f30, 0x0, 0x0, 0xc000244840, 0xc000252f30)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x462
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000573080, 0xc000252f30, 0x1, 0x1)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x34b
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895
main.runDocker(0xc00034a1a0, 0x55a1382b8f40, 0xc0000ce010)
        /go/src/github.com/docker/cli/cmd/docker/docker.go:287 +0x1d3
main.main()
        /go/src/github.com/docker/cli/cmd/docker/docker.go:298 +0xf3

Describe the results you expected: I should be able to login 😃

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client: Docker Engine - Community
 Version:           20.10.0
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        7287ab3
 Built:             Tue Dec  8 18:59:49 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:57:58 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.4.2-docker)

Server:
 Containers: 3
  Running: 3
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 20.10.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.19.0-13-amd64
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 11.73GiB
 Name: v2202011133880133864
 ID: M3MB:RTMT:TGLN:CJSU:6PKI:XSGP:AADE:SNDO:I5LB:KQRQ:2FIL:6EOG
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.): Physical root Server. (Fresh install)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

I had the same issue till now, I created the file /root/.docker/config.json with the following content:

{
        "auths": {
                "https://index.docker.io/v1/": {}
        }
}

I had a similar issue and docker login and docker logout showed the following errors: system config: Ubuntu 18.04.5 LTS

docker --version Docker version 20.10.3, build 48d30b5

Problem: sudo docker login error: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x563267da7f56]

goroutine 1 [running]: github.com/docker/cli/cli/command.ConfigureAuth(0x5632699e8c60, 0xc00056dad0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x563269958001, 0xc000659140, 0xc0003a1968) /go/src/github.com/docker/cli/cli/command/registry.go:128 +0x46 github.com/docker/cli/cli/command/registry.runLogin(0x5632699e8c60, 0xc00056dad0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, …) /go/src/github.com/docker/cli/cli/command/registry/login.go:123 +0x223 github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc00064c840, 0x56326a9f3448, 0x0, 0x0, 0x0, 0x0) /go/src/github.com/docker/cli/cli/command/registry/login.go:45 +0xcc github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc00064c840, 0xc000658f30, 0x0, 0x0, 0xc00064c840, 0xc000658f30) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x462 github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0002198c0, 0xc000658f30, 0x1, 0x1) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x34b github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(…) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895 main.runDocker(0xc00056dad0, 0x56326995ada0, 0xc000010020) /go/src/github.com/docker/cli/cmd/docker/docker.go:287 +0x1d3 main.main() /go/src/github.com/docker/cli/cmd/docker/docker.go:298 +0xf3

sudo docker logout error: Removing login credentials for https://index.docker.io/v1/ WARNING: could not erase credentials: https://index.docker.io/v1/: error erasing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

Solution: The following helped to solve my above issues. sudo apt -V install pass gnupg2

final comments: The above packages should be part of the docker dependencies package list.

this works for me: sudo apt -V install pass gnupg2

Remove rm ~/.docker/config.json file resolved issue!

I had a similar issue and docker login and docker logout showed the following errors: system config: Ubuntu 18.04.5 LTS

docker --version Docker version 20.10.3, build 48d30b5

Problem: sudo docker login error: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x563267da7f56]

goroutine 1 [running]: github.com/docker/cli/cli/command.ConfigureAuth(0x5632699e8c60, 0xc00056dad0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x563269958001, 0xc000659140, 0xc0003a1968) /go/src/github.com/docker/cli/cli/command/registry.go:128 +0x46 github.com/docker/cli/cli/command/registry.runLogin(0x5632699e8c60, 0xc00056dad0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, …) /go/src/github.com/docker/cli/cli/command/registry/login.go:123 +0x223 github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc00064c840, 0x56326a9f3448, 0x0, 0x0, 0x0, 0x0) /go/src/github.com/docker/cli/cli/command/registry/login.go:45 +0xcc github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc00064c840, 0xc000658f30, 0x0, 0x0, 0xc00064c840, 0xc000658f30) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x462 github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0002198c0, 0xc000658f30, 0x1, 0x1) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x34b github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(…) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895 main.runDocker(0xc00056dad0, 0x56326995ada0, 0xc000010020) /go/src/github.com/docker/cli/cmd/docker/docker.go:287 +0x1d3 main.main() /go/src/github.com/docker/cli/cmd/docker/docker.go:298 +0xf3

sudo docker logout error: Removing login credentials for https://index.docker.io/v1/ WARNING: could not erase credentials: https://index.docker.io/v1/: error erasing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

Solution: The following helped to solve my above issues. sudo apt -V install pass gnupg2

final comments: The above packages should be part of the docker dependencies package list.

Hi. I’m running docker 20.10.3 on Debian 10 but docker login error occurred. `root@debian:~# docker version Client: Docker Engine - Community Version: 20.10.3 API version: 1.41 Go version: go1.13.15 Git commit: 48d30b5 Built: Fri Jan 29 14:33:25 2021 OS/Arch: linux/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.3 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 46229ca Built: Fri Jan 29 14:31:38 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.3 GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b runc: Version: 1.0.0-rc92 GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff docker-init: Version: 0.19.0 GitCommit: de40ad0 root@debian:~# docker login registry.example.com panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5579263644d6]

goroutine 1 [running]: github.com/docker/cli/cli/command.ConfigureAuth(0x557927da7480, 0xc000536ea0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x557927d16800, 0xc0002773a0, 0xc00062f968) /go/src/github.com/docker/cli/cli/command/registry.go:128 +0x46 github.com/docker/cli/cli/command/registry.runLogin(0x557927da7480, 0xc000536ea0, 0x7fff99106e32, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, …) /go/src/github.com/docker/cli/cli/command/registry/login.go:123 +0x223 github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc00015e840, 0xc0002767d0, 0x1, 0x1, 0x0, 0x0) /go/src/github.com/docker/cli/cli/command/registry/login.go:45 +0xcc github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc00015e840, 0xc000203610, 0x1, 0x1, 0xc00015e840, 0xc000203610) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x462 github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000519b80, 0xc000203600, 0x2, 0x2) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x34b github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(…) /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895 main.runDocker(0xc000536ea0, 0x557927d19540, 0xc000010028) /go/src/github.com/docker/cli/cmd/docker/docker.go:287 +0x1d3 main.main() /go/src/github.com/docker/cli/cmd/docker/docker.go:298 +0xf3 `

This should be fixed by https://github.com/docker/cli/pull/2918 on master (and will be in an upcoming 20.10.x patch release)

I found the likely reason for the panic; fix is in https://github.com/docker/cli/pull/2918 (not merged yet)