Open jjzxcd opened 2 months ago
Most likely caused by https://github.com/containers/podman/pull/22691/commits/c46884aa93e62bb39fd084433d840db4543b7792. We need to wait until we get either a successful event or error first before setting the status code so the fix is valid IMO. So in order to fix this here we would need to have a way that tell us explicitly that events is ready to send events an no error after this will be reported in which case we can set the status code to 200 without having to send an event
A friendly reminder that this issue had no activity for 30 days.
PR https://github.com/containers/podman/pull/24406 if you would like to test that
Issue Description
It seems that the Podman compat API does not immediately return an HTTP response when querying
/events
or/containers/${id}/logs?follow=true&stdout=true&stderr=true
if no events or logs are produced yet. In this case, the client cannot determine whether the request was successful until some data is received. For example, I use Vector, which in turn uses the Bollard library to interact with the Docker API, to collect logs from Docker and Podman. When Vector starts fetching system events and container logs using the Podman 5.2.1 compat API via the socketunix:///run/podman/podman.sock
, the requests fail with errorRequestTimeoutError
after a 2 minute timeout if no response is received from Podman, causing Vector to stop monitoring the container. At the same time, everything works fine with Docker.Vector logs:
Steps to reproduce the issue
id=$(podman run -d --rm alpine sleep infinity)
curl -v --unix-socket /run/podman/podman.sock "http://d/events" -o -
curl -v --unix-socket /run/podman/podman.sock "http://d/containers/${id}/logs?follow=true&stdout=true&stderr=true" -o -
Describe the results you received
There is no HTTP response if no events or logs are produced:
Describe the results you expected
For events endpoint
Receive the HTTP response even if there are no logs or events.
Like with Podman 5.0.3:
Like with Docker:
For container logs endpoint
Recevice the HTTP response even if there are no logs or events.
Like with Docker:
podman info output
Podman in a container
Yes
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting