Migrated from https://gitlab.com/r3j0/incus-compose/-/issues/23
Bug
incus-compose logs (without --follow) returns correct output on the first
call but nothing on subsequent calls for running containers.
Root cause
The Incus server's GET /1.0/instances/{name}/console handler calls liblxc
with WriteToLogFile: true. This advances a write cursor in the LXC ring
buffer — each call only returns bytes written after the previous cursor
position. The first call drains all buffered output; subsequent calls return
nothing until new output arrives.
For stopped containers the server reads from the accumulated
ConsoleBufferLogPath() file, which always contains the full history — so
logs works correctly after stop.
Workaround
Use --follow to stream continuously:
incus-compose logs --follow web-1
What we cannot fix client-side
The cursor is advanced server-side. There is no reset or read-from-start
option in the current GET /console REST API.
Potential upstream fix
A reset_cursor or read_from_start query parameter on GET /console would
let clients always read from the beginning of the ring buffer, matching
docker logs semantics.
Until then, --tail (not yet implemented) could partially help by
reading from the log file for stopped instances.
Bug
incus-compose logs(without--follow) returns correct output on the firstcall but nothing on subsequent calls for running containers.
Root cause
The Incus server's
GET /1.0/instances/{name}/consolehandler calls liblxcwith
WriteToLogFile: true. This advances a write cursor in the LXC ringbuffer — each call only returns bytes written after the previous cursor
position. The first call drains all buffered output; subsequent calls return
nothing until new output arrives.
For stopped containers the server reads from the accumulated
ConsoleBufferLogPath()file, which always contains the full history — sologsworks correctly afterstop.Workaround
Use
--followto stream continuously:What we cannot fix client-side
The cursor is advanced server-side. There is no reset or read-from-start
option in the current
GET /consoleREST API.Potential upstream fix
A
reset_cursororread_from_startquery parameter onGET /consolewouldlet clients always read from the beginning of the ring buffer, matching
docker logssemantics.Until then,
--tail(not yet implemented) could partially help byreading from the log file for stopped instances.