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

REST API Method Not Allowed with Podman 2.0.5 and Grype #7950

Closed
fatherlinux opened this issue Oct 7, 2020 · 3 comments · Fixed by #7966
Closed

REST API Method Not Allowed with Podman 2.0.5 and Grype #7950

fatherlinux opened this issue Oct 7, 2020 · 3 comments · Fixed by #7966
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@fatherlinux
Copy link
Contributor

/kind bug

Description

Using Grype (https://toolbox.anchore.io/) with CentOS Stream 8 and Podman 2.0.5, the Docker Compatible REST endpoint returns a Method not Found error.

Steps to reproduce the issue:

1.grype registry.access.redhat.com/ubi8/ubi

Or

  1. grype centos

Describe the results you received:

From terminal:

[root@centos-stream ~]# grype centos
 ✔ Vulnerability DB     [no update available]
 ✔ Pulled image         
 ⠋ Loading image        ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [requesting image from docker]
[0018] ERROR failed to catalog: could not fetch image 'centos': unable to save image tar: Error response from daemon: Method Not Allowed

From debug log:

INFO[0071] Failed Request: (405:Method Not Allowed) for GET:'/v1.40/images/get?names=centos'

Describe the results you expected:

Results similar to video here: https://toolbox.anchore.io/

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

Output of podman version:

Version:      2.0.5
API Version:  1
Go Version:   go1.14.7
Built:        Thu Sep 24 13:58:13 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.15.1
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.20-2.module_el8.3.0+475+c50ce30b.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.20, commit: 1019ecdeda3936be22162bb1cca308192145de53'
  cpus: 1
  distribution:
    distribution: '"centos"'
    version: "8"
  eventLogger: file
  hostname: centos-stream.dc2.crunchtools.com
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-236.el8.x86_64
  linkmode: dynamic
  memFree: 347070464
  memTotal: 1905127424
  ociRuntime:
    name: runc
    package: runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.2-dev'
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  rootless: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 2147479552
  swapTotal: 2147479552
  uptime: 17m 22.1s
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 2
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 1
  Built: 1600970293
  BuiltTime: Thu Sep 24 13:58:13 2020
  GitCommit: ""
  GoVersion: go1.14.7
  OsArch: linux/amd64
  Version: 2.0.5

Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

No

Additional environment details (AWS, VirtualBox, physical, etc.):
Virtual machine with CentOS 8 Stream. I suspect that this could be as simple as accepting 1.40 as the version number?

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 7, 2020
@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2020

Any chance you could try this against the main branch. I believe we have load support now?
@jwhonce @baude PTAL

@baude baude added In Progress This issue is actively being worked by the assignee, please do not work on this at this time. and removed In Progress This issue is actively being worked by the assignee, please do not work on this at this time. labels Oct 7, 2020
@baude
Copy link
Member

baude commented Oct 7, 2020

Ok, dug into this a little. The problem is that they are hitting an endpoint that doesnt exist because we were not able to save/load multiple images in a single tarball. I think @vrothberg worked on this recently. @vrothberg lets talk about this one, coach me up if we can do this.

@vrothberg
Copy link
Member

The loading part is working transparently (https://github.com/containers/podman/blob/master/libpod/runtime_img.go#L279) as we are trying a couple of formats in a specific order.

The saving part, however, needs to know whether we are creating a multi-image archive or a single-image archive with additional tags. On the CLI, we added the --multi-image-archive, -m flag to podman save. To create such a multi-image archive, we need to call libpod's func (ir *Runtime) SaveImages(ctx context.Context, namesOrIDs []string, format string, outputFile string, quiet bool) (finalErr error). I guess that's what the compat endpoint may need to do.

baude added a commit to baude/podman that referenced this issue Oct 8, 2020
with the recent inclusion of dealing with multiple images in a tar archive, we can now add a compatibility endpoint that was missing images/get?names=one,two.

Fixes: containers#7950

Signed-off-by: baude <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants