compose icon indicating copy to clipboard operation
compose copied to clipboard

[BUG] failed to fetch anonymous token 400 Bad request

Open diegosiao opened this issue 1 year ago • 4 comments

Description

Executing docker-compose up fails to download Oracle Cloud registry images.

failed to solve: iad.ocir.io/compartment/repo/imagename:mytag: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://iad.ocir.io/20180419/docker/token?scope=%3A%3A&scope=repository%3Acompartment%2Fk1%2Fimagename%3Apull&service=iad.ocir.io: 400 Bad Request

Notice the URL has 'scope' parameter twice when put this on browser removing 'scope=%3A%3A&' the token is returned.

Steps To Reproduce

No response

Compose Version

Docker Compose version v2.22.0

Docker Environment

[Working with podman]

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.1.2, commit: '
  cpus: 24
  distribution:
    codename: focal
    distribution: ubuntu
    version: "20.04"
  eventLogger: journald
  hostname: diegodesktop
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.15.90.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 22055792640
  memTotal: 33535012864
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: ea1fe3938eefa14eb707f1d22adff4db670645d6
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 8589934592
  swapTotal: 8589934592
  uptime: 14h 43m 36.88s (Approximately 0.58 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/diego/.config/containers/storage.conf
  containerStore:
    number: 47
    paused: 0
    running: 0
    stopped: 47
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/diego/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 174
  runRoot: /run/user/1000/containers
  volumePath: /home/diego/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.2
  Built: 0
  BuiltTime: Wed Dec 31 21:00:00 1969
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 3.4.2

Anything else?

No response

diegosiao avatar Oct 12 '23 03:10 diegosiao

Can you please confirm docker pull on same image reference works as expected ?

ndeloof avatar Oct 12 '23 20:10 ndeloof

Note that I am using podman.

And, podman pull works just fine.

Trying to pull iad.ocir.io/idptftutffev/repo/imagename:tag...
Getting image source signatures
Copying blob 898e72ab52ca skipped: already exists
Copying blob 898e72ab52ca skipped: already exists
Copying blob 898e72ab52ca skipped: already exists
Copying blob 898e72ab52ca skipped: already exists
Copying blob 420fab7e4cce skipped: already exists
Copying blob 898e72ab52ca skipped: already exists
Copying blob 420fab7e4cce skipped: already exists
Copying blob 898e72ab52ca skipped: already exists
Copying blob 420fab7e4cce skipped: already exists
Copying blob 383ae62e0c6f skipped: already exists
Copying blob 87982e55af1e skipped: already exists
Copying blob cc04031fb1a5 skipped: already exists
Copying blob b3c05a1f8192 skipped: already exists
Copying blob 990585e138f4 skipped: already exists
Copying blob 304c78ba490d skipped: already exists
Copying blob 4f4fb700ef54 skipped: already exists
Copying blob 0f6d6ada1205 skipped: already exists
Copying blob a0daf25d0fd4 skipped: already exists
Copying blob 75b6ce040c3c skipped: already exists
Copying blob 1c174bf2404f skipped: already exists
Copying blob 6284241c6f6a skipped: already exists
Copying blob 95c3bbb64d00 skipped: already exists
Copying blob b1971bbed6ce skipped: already exists
Copying blob 8cebc9e54233 skipped: already exists
Copying blob c9bdff9d504e skipped: already exists
Copying blob 16aec641dbcc skipped: already exists
Copying blob c863e6e65a41 skipped: already exists
Copying blob 68a400db6b00 skipped: already exists
Copying blob 95c39c795822 skipped: already exists
Copying blob c7d543256cd8 skipped: already exists
Copying blob 6faf31a867b8 skipped: already exists
Copying blob 930b29c65fbc skipped: already exists
Copying blob 6e06292b2556 skipped: already exists
Copying blob f4ddeee66e92 skipped: already exists
Copying blob f4ddeee66e92 skipped: already exists
Copying blob 824b15f81d65 skipped: already exists
Copying config 46e165a0c3 done
Writing manifest to image destination
Storing signatures
46e165a0c3aa952ede8221f549b0964d4488bc9c072cae43926b297c4cfa46e0

diegosiao avatar Oct 12 '23 22:10 diegosiao

I can't tell about podman, would need to know if docker pull is fine with such an image, as docker compose relies on docker codebase for this purpose, not podman

ndeloof avatar Oct 13 '23 07:10 ndeloof

Using docker pull works just fine (obviously after docker login). The same way podman pull is working as shown above.

One thing to add, is that on Windows side I was able to disable BuildKit and the same command worked (DOCKER_BUILDKIT=0), on Ubuntu the same configuration seems to be ignored.

diegosiao avatar Oct 13 '23 13:10 diegosiao

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 28 '24 00:07 github-actions[bot]