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

Compat API: creating containers with "NetworkMode": "default" started failing with #10447 #10569

Closed
riyad opened this issue Jun 4, 2021 · 2 comments · Fixed by #10591
Closed
Assignees
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

@riyad
Copy link
Contributor

riyad commented Jun 4, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Trying to find regressions by exercising the Compat API trough docker-py's test suite (see #5386) I came across a regression that reduced the number of passing tests by ~40 and affects another ~20 tests.

Creating containers with "NetworkMode": "default" started failing with #10447 (which is suspiciously network-related 🤨 ).

Steps to reproduce the issue:

curl -sS --unix-socket /var/run/user/1000/podman/podman.sock -XPOST 'http://localhost/v1.40/containers/create'  -H "Content-Type: application/tar" -d '{"Tty": false, "OpenStdin": false, "StdinOnce": false, "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Cmd": ["sleep", "300"], "Image": "alpine", "NetworkDisabled": false, "HostConfig": {"NetworkMode": "default"}}' 

Describe the results you received:

Running the command above returns:

500 Internal Server Error
{"cause":"network not found","message":"container create: unable to find network configuration for default: network not found","response":500}

Describe the results you expected:

Creating containers with "NetworkMode": "default" should work again.

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

FWIW changing "NetworkMode" to "podman" (the only network listed with podman network ls) results in:

201 Created
{"Id":"240bd40f9f68344ad9f680f2a1ba5b3e29cc7fafb33a95453ca0b0cdf78ec23e","Warnings":[]}
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 4, 2021
@mheon
Copy link
Member

mheon commented Jun 6, 2021

Damn. I broke it, I'll take this one.

@mheon mheon self-assigned this Jun 6, 2021
mheon added a commit to mheon/libpod that referenced this issue Jun 7, 2021
The rework of namespace handling for rootless CNI broke this, as
CNI networks were being computed incorrectly. Fix handling of
CNI networks for the Compat Create REST API for containers, and
add a test so we don't regress again.

Fixes containers#10569

Signed-off-by: Matthew Heon <[email protected]>
@mheon
Copy link
Member

mheon commented Jun 7, 2021

#10591 to fix

@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.

2 participants