octoprint-docker icon indicating copy to clipboard operation
octoprint-docker copied to clipboard

[BUG] Read-only container output (logs) flooded with init_VideoIn failed

Open adelton opened this issue 8 months ago • 3 comments

Describe the bug

Running

podman run --rm -p 8080:80 --name octoprint docker.io/octoprint/octoprint:latest

works without problems. When I add --read-only to the command, I get

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...s6-chown: fatal: unable to chown /var/run/s6/etc/cont-init.d/v3-dir-structure-check: Read-only file system
[...]
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise haproxy: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise octoprint: warning: unable to spawn ./run - waiting 10 seconds
[services.d] done.

That is expected with s6 and my understanding is that S6_READ_ONLY_ROOT=1 environment variable should fix that.

Indeed,

podman run --rm -p 8080:80 --name octoprint --read-only -e S6_READ_ONLY_ROOT=1 docker.io/octoprint/octoprint:latest

gives me a working OctoPrint UI on host's 'http://localhost:8080/' URL ... except the output of the container now shows a stream of

MJPG Streamer Version.: 2.0
 i: Using V4L2 device.: (null)
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: init_VideoIn failed

messages.

I even tried to add an explicit -e ENABLE_MJPG_STREAMER=false but that does not help either.

Container Details

please run `docker inspect --format '{{ index .Config.Labels "org.opencontainers.image.created"}}' octoprint/octoprint:<tag_you_are_using>' and list the date returned.

2024-11-05T09:21:10.037Z

To Reproduce Steps to reproduce the behavior:

  1. Run podman run --rm -p 8080:80 --name octoprint --read-only -e S6_READ_ONLY_ROOT=1 docker.io/octoprint/octoprint:latest
  2. Observe the output showing
MJPG Streamer Version.: 2.0
 i: Using V4L2 device.: (null)
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: init_VideoIn failed

every second

Expected behavior

No messages about MJPG Streamer or init_VideoIn failed.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

adelton avatar Apr 21 '25 10:04 adelton

I observe the same behaviour with docker.io/octoprint/octoprint:bleeding of 2025-03-11T14:38:55.082Z as well.

adelton avatar Apr 21 '25 10:04 adelton

/etc/cont-init.d/01-mjpg-streamer-config seems to contain this (in version 2025-04-22T09:34:09.568Z):

#!/usr/bin/with-contenv bash

: "${ENABLE_MJPG_STREAMER:=false}"

# disable mjpg-streamer service if not enabled
if ! $ENABLE_MJPG_STREAMER; then
  rm -rf /etc/services.d/mjpg-streamer
fi

That should delete the mjpg-streamer service.

dromie avatar Apr 24 '25 17:04 dromie

This does not seem to address the issue as observed.

Even if I make the /etc/services.d writable

$ podman run --rm -p 8080:80 --name octoprint --read-only -e S6_READ_ONLY_ROOT=1 --tmpfs /etc/services.d -e ENABLE_MJPG_STREAMER=false docker.io/octoprint/octoprint:latest

and I check from other terminal that the /etc/services.d/mjpg-streamer directory is not present

$ podman exec -ti octoprint find /etc/services.d
/etc/services.d
/etc/services.d/haproxy
/etc/services.d/haproxy/run
/etc/services.d/octoprint
/etc/services.d/octoprint/run
$

the flood of the

MJPG Streamer Version.: 2.0
 i: Using V4L2 device.: (null)
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: init_VideoIn failed

messages in the container output is still present.

adelton avatar May 29 '25 08:05 adelton