New Camera Stack - Server Error on system reboots

Camera model
RasPi v2

What is the problem?
When I reboot my system and it comes back online the new camera stack is not functional. Even waiting 10+ minutes it's still not working. You can go to /webcam/ and view the output and the /webcam/option and /webcam/status work but going to /webcam/snapshot, /stream, and /video result in a black screen with Server Error on it. The /WebRTC shows the little player but just spins forever.

Looking at the systemctl status of the camera-streamer-libcamera.service shows activity happening

Jun 02 09:06:47 OctoPrint sh[601]: util/http/http.c: HTTP8080/2: Request 'GET' '/snapshot' ''
Jun 02 09:06:47 OctoPrint sh[601]: device/links.c: CAMERA:capture: Stale detected. Restarting streaming...
Jun 02 09:06:47 OctoPrint sh[601]: device/buffer_list.c: CAMERA:capture: Streaming stopped... Was 2 of 2 enqueud
Jun 02 09:06:47 OctoPrint sh[601]: device/buffer_list.c: CAMERA:capture: Streaming started... Was 2 of 2 enqueud
Jun 02 09:06:49 OctoPrint sh[601]: util/http/http.c: HTTP8080/2: Client disconnected 127.0.0.1.

What did you already try to solve it?
Sometimes restarting the OctoPrint services makes it functional again, sometimes it doesn't. Restarting the camera-streamer-libcamera.service fixes the issue each time for sure though.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
System Bundle attached

octoprint-systeminfo-20230602084536.zip (39.5 KB)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint 1.9.0
OctoPi 1.0.0 fresh Up to date image with post apt update/upgrade run
RasPi 4B 2gb

I'm seeing the same behavior with OctoPrint 1.9.1 & 1.9.2 still. I ended up making a crontab job to run 5 minutes after boot to restart the camera-streamer-libcamera service.

@reboot sleep 300 && service camera-streamer-libcamera restart

the version of OctoPrint will not have any effect on this as the streaming service is part of OctoPi itself. Have you tried SSH to the pi and running sudo apt update and sudo apt upgrade yet?

I have seen this behaviour myself several times now - I know there is now an issue opened on the 'camera-streamer' repo. It's kind of out of our control, and I wasn't able to find the source of the issue to help fix it, so it will have to wait for someone smarter to look at.

I had, several times before now but nothing had fixed it. I just checked now and there was a promising set of items pulled for update. I just disabled my cron job and rebooting to see if it resolves the issue.

The following NEW packages will be installed:
camera-streamer-raspi
The following packages will be upgraded:
camera-streamer ffmpeg libavcodec58 libavdevice58 libavfilter7 libavformat58 libavresample4 libavutil56 libcamera-apps-lite libcamera0 libgstreamer-plugins-base1.0-0 libpostproc55 libssl-dev libssl1.1 libswresample3 libswscale5 libx11-6 libx11-data libx11-xcb1 openssl python3-libcamera python3-picamera2

YAY that worked. As of the two versions below it is finally stable now on my system after several months.

camera-streamer - 0.2+transitional
camera-streamer-raspi - 0.2.5~bullseye-3

wow, marking a solution that's not the actual comment that gave it to you is bad form...