fussybeaver / bollard

Docker daemon API in Rust
Apache License 2.0
914 stars 135 forks source link

JsonDataError { message: "unknown variant `stopped` in ContainerStateStatusEnum with podman 4.4.2 #293

Closed jiridanek closed 1 year ago

jiridanek commented 1 year ago
let final_inspect = docker.inspect_container(&*container.id, Some(InspectContainerOptions { size: false })).await.unwrap();
thread 'testcontainers::test_h2spec::test_h2spec' panicked at 'called `Result::unwrap()` on an `Err` value: JsonDataError { message: "unknown variant `stopped`, expected one of ``, `created`, `running`, `paused`, `restarting`, `removing`, `exited`, `dead` at line 1 column 192", column: 192 }', tests/testcontainers/test_h2spec.rs:359:119

It looks like there is one additional state possible in

https://github.com/fussybeaver/bollard/blob/a12c6b21b737e5ea9e6efe5f0128d02dc594f9aa/src/container.rs#L76

https://github.com/fussybeaver/bollard/blob/a12c6b21b737e5ea9e6efe5f0128d02dc594f9aa/codegen/swagger/src/models.rs#L667-L670

I am using bollard = "0.14.0" and podman version 4.4.2. I am starting podman with

systemctl --user enable --now podman.socket
export DOCKER_HOST=unix:///run/user/${UID}/podman/podman.sock
fussybeaver commented 1 year ago

Thanks for reporting.. There was a similar issue a while back: https://github.com/fussybeaver/bollard/issues/238

The thread concluded that these differences are resolved with their podman compat layer.. can you check if that works for you? Would be good to put the solution down in the README somewhere.

jiridanek commented 1 year ago

I thought I'm using the compat API when I point bollard to the podman.sock. I don't really see what else I could be using, since bollard knows nothing about the libpod versions.

Anyways, looking at

it appears that both APIs have stopped state in there.

When I look at the podman issue created for #238, there I see link to the moby API, which does not seem to have stopped in there

So, could it be that the podman compat API is not compat enough?

jiridanek commented 1 year ago

Anyways, I'm going to raise this in podman as https://github.com/containers/podman/issues/17728