Skip to content
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

Misleading error message for docker secret ls #4890

Closed
alexvorndran opened this issue Feb 21, 2024 · 5 comments · Fixed by #4926
Closed

Misleading error message for docker secret ls #4890

alexvorndran opened this issue Feb 21, 2024 · 5 comments · Fixed by #4926

Comments

@alexvorndran
Copy link

Description

When I execute docker secret ls instead of sudo docker secret ls (user not in dockergroup) on a freshly set up Ubuntu 22.04 server, I get the following error message:

"secret list" requires API version 1.25, but the Docker daemon API version is 1.24

All other error messages caused by missing sudo usually start with permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:. So I'm wondering, why that's not the case here.

For completeness, the error message with sudo docker secret ls is more telling:

Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.

Based on the error message I guess docker secret ls also tries to connect to the daemon, but fails.

Reproduce

  1. docker secret ls
  2. sudo docker secret ls

Expected behavior

Consistent error message with other Docker commands?

docker version

Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:09 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:13:09 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 13
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: nvidia runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-94-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 62.47GiB
 Name: himalia
 ID: 58869a29-9625-4cbb-84b7-b91f5b92bbbd
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

lsb_release -a

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

groups

XXXXXXX adm cdrom sudo dip plugdev lxd
@thaJeztah
Copy link
Member

Thanks for reporting! This looks to be a regression that was introduced in moby/moby#46463. I opened a pull request with a fix;

@neersighted
Copy link
Member

Closing as the fix has landed in moby/moby; it will be backported and make its way to releases over the coming weeks.

@thaJeztah
Copy link
Member

We need to vendor it into the cli for this to be addressed

@neersighted
Copy link
Member

neersighted commented Feb 29, 2024

Oh! I seem to have missed it was on the client side; good point.

@thaJeztah
Copy link
Member

fixed in master through #4926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants