k3d icon indicating copy to clipboard operation
k3d copied to clipboard

[BUG] k3d version list returns error - looking in wrong place for list of tags?

Open tgoz opened this issue 2 years ago • 0 comments

What did you do

I downloaded and installed k3d-linux-amd64 from https://github.com/k3d-io/k3d/releases/tag/v5.4.6 , then executed k3d version list k3d

What did you expect to happen

I expected to see a list of available versions of k3d (or k3s, k3d-proxy or k3d-tools with the corresponding parameter). The same error is displayed for all of these.

Screenshots or terminal output

FATA[0000] invalid character '<' looking for beginning of value

This error message is similar to the one reported in #1129 , but I believe the underlying cause is different.

I think I've traced it to a hard-coded reference to registry.hub.docker.com in cmd/root.go at line 288. If I'm following correctly, k3d is trying to access https://registry.hub.docker.com/v1/repositories/rancher/tags. Accessing this with cURL gives a 410 Gone response with an HTML body which likely is the direct cause of the error message.

I understand that the containers are now hosted on GitHub Container registry rather than Docker Hub. I'm not sure if an equivalent, unauthenticated API is even available for ghcr.io (I haven't found one yet). I'm not sure if this is easily fixable, the user will need to be prompted for credentials, or the k3d version list command just needs to go away.

I don't think much of the info below is really relevant, but since it was asked for in the bug report template, here we go....

Which OS & Architecture

  • output of k3d runtime-info
arch: x86_64
cgroupdriver: cgroupfs
cgroupversion: "1"
endpoint: /var/run/docker.sock
filesystem: extfs
name: docker
os: Ubuntu 18.04.6 LTS
ostype: linux
version: 20.10.17

Which version of k3d

  • output of k3d version
k3d version v5.4.6
k3s version v1.24.4-k3s1 (default)

Which version of docker

  • output of docker version and docker info
Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:02:56 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:01:02 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.7
  GitCommit:        0197261a30bf81f1ee8e6a4dd2dea0ef95d67ccb
 runc:
  Version:          1.1.3
  GitCommit:        v1.1.3-0-g6724737
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., v2.6.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 32
  Running: 32
  Paused: 0
  Stopped: 0
 Images: 65
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 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: 0197261a30bf81f1ee8e6a4dd2dea0ef95d67ccb
 runc version: v1.1.3-0-g6724737
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-125-generic
 Operating System: Ubuntu 18.04.6 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 31.03GiB
 Name: cube
 ID: 5DNG:V4DT:R2RE:5BZO:FGYT:JF63:AJGZ:DVVL:UOXT:Y253:CX7C:33ME
 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

tgoz avatar Sep 23 '22 06:09 tgoz