docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.58k stars 482 forks source link

[BUG] insufficient_scope: authorization failed only while pulling the image docker.io/library/base:latest #1611

Closed AskAlice closed 1 year ago

AskAlice commented 1 year ago

I recently was forced to factory reset docker desktop settings on windows. I ended up finding myself in this situation

  1. reset docker desktop to default settings on Windows 11
  2. git clone https://github.com/AbdBarho/stable-diffusion-webui-docker
  3. follow the instructions here https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup
  4. run $env:DOCKER_BUILDKIT=1; docker compose --profile invoke up --build

see below for build:

πŸ’–β― docker login
Authenticating with existing credentials...
Login Succeeded

Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
πŸ’–β― cat C:\Users\alice\.docker\config.json
{
        "auths": {
                "https://index.docker.io/v1/": {}
        },
        "credsStore": "wincred"
}
πŸ’–β― $env:DOCKER_BUILDKIT=1; docker compose --profile invoke up --build
[+] Building 1.8s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                    0.0s
 => => transferring dockerfile: 32B                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                         0.0s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                              0.4s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:d2d74ff22a0e47b21f4bbde337e2ac4cd0a02a2226ef79264878db3dc7e87df8                         0.0s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => [internal] load build definition from Dockerfile                                                                                                    0.0s
 => ERROR [internal] load metadata for docker.io/library/base:latest                                                                                    0.8s
 => [auth] library/base:pull token for registry-1.docker.io                                                                                             0.0s
------
 > [internal] load metadata for docker.io/library/base:latest:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = base: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
πŸ’–β― rm C:\Users\alice\.docker\config.json
πŸ’–β― $env:DOCKER_BUILDKIT=1; docker compose --profile invoke up --build
[+] Building 1.7s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                    0.0s
 => => transferring dockerfile: 32B                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                         0.0s
 => resolve image config for docker.io/docker/dockerfile:1                                                                                              0.4s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:d2d74ff22a0e47b21f4bbde337e2ac4cd0a02a2226ef79264878db3dc7e87df8                         0.0s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => [internal] load build definition from Dockerfile                                                                                                    0.0s
 => ERROR [internal] load metadata for docker.io/library/base:latest                                                                                    0.7s
 => [auth] library/base:pull token for registry-1.docker.io                                                                                             0.0s
------
 > [internal] load metadata for docker.io/library/base:latest:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = base: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

see below for docker environment information

πŸ’–β― docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.10.0)
  compose: Docker Compose (Docker Inc., v2.15.1)
  dev: Docker Dev Environments (Docker Inc., v0.0.5)
  extension: Manages Docker extensions (Docker Inc., v0.2.17)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.23.0)

Server:
 Containers: 36
  Running: 33
  Paused: 0
  Stopped: 3
 Images: 13
 Server Version: 20.10.22
 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: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.15.79.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 31.31GiB
 Name: docker-desktop
 ID: HRC3:VBBG:DH7M:6E7J:GY2V:73RE:XYB2:JJIH:BZGT:FRXY:E6CP:KCC5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

Hardware / Software

AskAlice commented 1 year ago

I think the main thing to note here is this

ERROR [internal] load metadata for docker.io/library/base:latest        

can confirm i can pull other images from docker.io

πŸ’–β― docker pull grafana/tempo
Using default tag: latest
latest: Pulling from grafana/tempo
ca7dd9ec2225: Pull complete
9c16bdc2f469: Pull complete
b8bbd33c1249: Pull complete
Digest: sha256:3fad749f59a4a30395c2eaa2ebccc4996a7a59dbc42f1115f2558517c272370d
Status: Downloaded newer image for grafana/tempo:latest
docker.io/grafana/tempo:latest
πŸ’–β― docker pull docker.io/library/base:latest
Error response from daemon: pull access denied for base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
eric-crowdskout commented 1 year ago

I'm having same exact error just started this afternoon

AskAlice commented 1 year ago

I'm having same exact error just started this afternoon

see https://github.com/docker-library/official-images/issues/14054#issuecomment-1424555444