Podman compatibility API network error #11285
Labels
In Progress
This issue is actively being worked by the assignee, please do not work on this at this time.
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.
/kind bug
Description
Error 500 when trying to create a container with pre-created network with the docker compatible API
We try to make testContainers framework works with podman, but can't get a container running with a network.
Without a network, it is working fine.
Here is how to reproduce with curl
Steps to reproduce the issue:
Start podman api : podman system service --time=0 tcp:0.0.0.0:56000 --log-level debug
Create a network
curl -X POST -H "Content-Type: application/json" -d @net.json http://localhost:56000/networks/create
With payload :
{"enableIPv6":null,"Name":"test-net","Driver":null,"IPAM":null,"Options":{},"CheckDuplicate":true,"Internal":null,"EnableIPv6":null,"Attachable":null,"Labels":{"org.testcontainers":"true","org.testcontainers.sessionId":"b073e659-2a7d-48ac-9430-26e043fb4641"}}
Response :
{"Id":"254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435","Warning":null}
curl -X POST http://localhost:56000/images/create?fromImage=registry.hub.docker.com/library/busybox
curl -X POST -H "Content-Type: application/json" -d @cont.json http://localhost:56000/containers/create
Payload :
{"name":null,"authConfig":null,"platform":null,"Hostname":null,"Domainname":null,"User":null,"AttachStdin":null,"AttachStdout":null,"AttachStderr":null,"PortSpecs":null,"Tty":null,"OpenStdin":null,"StdinOnce":null,"Env":[],"Cmd":[],"Healthcheck":null,"ArgsEscaped":null,"Entrypoint":null,"Image":"registry.hub.docker.com/library/busybox","Volumes":{},"WorkingDir":null,"MacAddress":null,"OnBuild":null,"NetworkDisabled":null,"ExposedPorts":{"61616/tcp":{}},"StopSignal":null,"StopTimeout":null,"HostConfig":{"Binds":[],"BlkioWeight":null,"BlkioWeightDevice":null,"BlkioDeviceReadBps":null,"BlkioDeviceWriteBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteIOps":null,"MemorySwappiness":null,"NanoCpus":null,"CapAdd":null,"CapDrop":null,"ContainerIDFile":null,"CpuPeriod":null,"CpuRealtimePeriod":null,"CpuRealtimeRuntime":null,"CpuShares":null,"CpuQuota":null,"CpusetCpus":null,"CpusetMems":null,"Devices":null,"DeviceCgroupRules":null,"DeviceRequests":null,"DiskQuota":null,"Dns":null,"DnsOptions":null,"DnsSearch":null,"ExtraHosts":[],"GroupAdd":null,"IpcMode":null,"Cgroup":null,"Links":[],"LogConfig":null,"LxcConf":null,"Memory":null,"MemorySwap":null,"MemoryReservation":null,"KernelMemory":null,"NetworkMode":"254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435","OomKillDisable":null,"Init":null,"AutoRemove":null,"OomScoreAdj":null,"PortBindings":{"61616/tcp":[{"HostIp":"","HostPort":""}]},"Privileged":null,"PublishAllPorts":null,"ReadonlyRootfs":null,"RestartPolicy":null,"Ulimits":null,"CpuCount":null,"CpuPercent":null,"IOMaximumIOps":null,"IOMaximumBandwidth":null,"VolumesFrom":[],"Mounts":null,"PidMode":null,"Isolation":null,"SecurityOpt":null,"StorageOpt":null,"CgroupParent":null,"VolumeDriver":null,"ShmSize":null,"PidsLimit":null,"Runtime":null,"Tmpfs":null,"UTSMode":null,"UsernsMode":null,"Sysctls":null,"ConsoleSize":null},"Labels":{"org.testcontainers":"true","org.testcontainers.sessionId":"b071e659-2a7d-48ac-9430-26e043fb4641"},"Shell":null,"NetworkingConfig":{"EndpointsConfig":{"254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435":{"IPAMConfig":null,"Links":null,"Aliases":["tc-bpZ991mD","busybox.local"],"NetworkID":null,"EndpointID":null,"Gateway":null,"IPAddress":null,"IPPrefixLen":null,"IPv6Gateway":null,"GlobalIPv6Address":null,"GlobalIPv6PrefixLen":null,"MacAddress":null}}}}
Response :
{"cause":"network not found","message":"container create: container d94b1f92a8f34cec66eb6a8db60d2a1912e50e533401fe384ee3f7b27993d5b6 has network aliases for network \"254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435\" but is not part of that network: network not found","response":500}
curl http://localhost:56000/networks/254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435
response :
{"Name":"test-net","Id":"254ddbe0ec1e5f3ed4b492876e2b6b9a051436b44c40d00ebd5e72bf7aa88435","Created":"2021-08-19T13:33:39.41-04:00","Scope":"local","Driver":"bridge","EnableIPv6":false,"IPAM":{"Driver":"default","Options":{},"Config":[{"Subnet":"10.88.2.0/24","Gateway":"10.88.2.1"}]},"Internal":false,"Attachable":false,"Ingress":false,"ConfigFrom":{"Network":""},"ConfigOnly":false,"Containers":{},"Options":{},"Labels":{"org.testcontainers":"true","org.testcontainers.sessionId":"b073e659-2a7d-48ac-9430-26e043fb4641"}}
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
No, just with 3.2.2, yes I checked troubleshooting
Additional environment details (AWS, VirtualBox, physical, etc.):
Running on WSL2 Ubuntu 20.04
The text was updated successfully, but these errors were encountered: