RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2232127 - Podman's `/build` Docker compatibility API endpoint does not accept "1" as a valid pull parameter.
Summary: Podman's `/build` Docker compatibility API endpoint does not accept "1" as a ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: Alex Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-15 13:35 UTC by Matej Vašek
Modified: 2023-11-14 16:39 UTC (History)
10 users (show)

Fixed In Version: podman-4.6.1-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-14 15:30:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers podman pull 19633 0 None Merged [v4.6.1-rhel] fix: pull param parsing for the /build compat ep 2023-08-16 07:57:44 UTC
Red Hat Issue Tracker RHELPLAN-165841 0 None None None 2023-08-15 13:45:11 UTC
Red Hat Issue Tracker SRVOCF-550 0 None None None 2023-08-15 13:41:23 UTC
Red Hat Product Errata RHSA-2023:6939 0 None None None 2023-11-14 15:30:59 UTC

Description Matej Vašek 2023-08-15 13:35:40 UTC
Description of problem:
The `/build` Docker compatibility API endpoint does not accept "1" as a valid pull parameter.

How reproducible:
Always.
Use standard Docker CLI or Golang client against podman implementation of Docker API.

Steps to Reproduce:
```
podman system service unix:///tmp/docker.sock --log-level=debug --time 0 &
export DOCKER_HOST="unix:///tmp/docker.sock"
echo "FROM alpine" >> Dockerfile
docker build . -t my-alpine --pull
```

Actual results:
```
Error response from daemon: failed to parse query parameter 'pull': "1": invalid pull policy: "1"
```

Expected results:
Build proceeds without error.


Additional info:
This affects versions podman 4.6.x
Related issue: https://issues.redhat.com/browse/SRVOCF-550

FIX:
https://github.com/containers/podman/pull/19631/commits/888a52ded8c1ef9ed32b9525b95ee879add411ea

Comment 2 Paul Holzinger 2023-08-15 16:39:27 UTC
https://github.com/containers/podman/pull/19633 is merged, assigning to Jindrich for packaging work

Comment 8 Matej Vašek 2023-08-31 10:42:23 UTC
"curl" reproducer:
tar -cf - Dockerfile | curl -XPOST --unix-socket /tmp/docker.sock -H 'Content-Type: application/x-tar' "http://localhost/v1.41/build?pull=1" --data-binary @-

Where Docker file is some simple docker file e.g. `FROM alpine`, and /tmp/docker.sock is a unix socket served by podman.

Comment 9 Alex Jia 2023-08-31 11:07:47 UTC
(In reply to Matej Vašek from comment #8)
> "curl" reproducer:
> tar -cf - Dockerfile | curl -XPOST --unix-socket /tmp/docker.sock -H
> 'Content-Type: application/x-tar' "http://localhost/v1.41/build?pull=1"
> --data-binary @-
> 
> Where Docker file is some simple docker file e.g. `FROM alpine`, and
> /tmp/docker.sock is a unix socket served by podman.

Thank you Matej!

I can reproduce this bug on podman-4.6.1-1.module+el8.9.0+19648+0d5ae0ec.

[testuser@kvm-03-guest12 ~]$ tar -cf - Dockerfile | curl -XPOST --unix-socket /home/testuser/docker.sock -H 'Content-Type: application/x-tar' "http://localhost/v1.41/build?pull=1" --data-binary @-
{"cause":"invalid pull policy: \"1\"","message":"failed to parse query parameter 'pull': \"1\": invalid pull policy: \"1\"","response":400}

And verified on podman-4.6.1-4.module+el8.9.0+19761+326da906.

[testuser@kvm-03-guest12 ~]$ tar -cf - Dockerfile | curl -XPOST --unix-socket /home/testuser/docker.sock -H 'Content-Type: application/x-tar' "http://localhost/v1.41/build?pull=1" --data-binary @-
{"stream":"STEP 1/1: FROM quay.io/libpod/alpine:latest\n"}
{"stream":"Trying to pull quay.io/libpod/alpine:latest...\n"}
{"stream":"Getting image source signatures\n"}
{"stream":"Copying blob sha256:9d16cba9fb961d1aafec9542f2bf7cb64acfc55245f9e4eb5abecd4cdc38d749\n"}
{"stream":"Copying config sha256:961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4\n"}
{"stream":"Writing manifest to image destination\n"}
{"stream":"COMMIT\n"}
{"stream":"--\u003e 961769676411\n"}
{"stream":"961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4\n"}
{"aux":{"ID":"sha256:961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4"}}
{"stream":"Successfully built 961769676411\n"}

Comment 11 errata-xmlrpc 2023-11-14 15:30:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6939


Note You need to log in before you can comment on or make changes to this bug.