Motion_watchdog: pthread_cancel failed. Killing threads!

Creating a bug report/issue

I have searched the existing open and closed issues

Hi,

Migrated dietpi from VM to Rpi 3B with pi-hole, unbound , tailsacle & X installed. To make the Rpi Camera V2.1 as CCTV, I installed MotionEye. Everything was working fine.

  1. Then I use Win10 diskimage32 to backup the SD to “rpi-dietpi-2026-0516.img”
  2. Run dietpi-update, then I went through “kernel fallback” —> Legacy Pi-Camera-Support broken with latest v10.4.2 - #6 by ai268
  3. After the kernel fallback, the Motioneye still worked without porblems.
  4. Then I installed Nextcloud by dietpi-software and add USB thumb drive by ditepi-disk_manager.
  5. Then I found that Motioneye did not work any more with the following error messages.
2026-05-28T11:54:31.717429-04:00 DietPi motion: [0:motion] [ERR] [ALL] motion_watchdog: Watchdog did not restart. Calling pthread_cancel.
2026-05-28T11:54:42.719575-04:00 DietPi motion: [0:motion] [ERR] [ALL] motion_watchdog: pthread_cancel failed.  Killing threads!!!
2026-05-28T11:54:42.720401-04:00 DietPi motion: [0:motion] [ERR] [ALL] motion_watchdog: Memory leaks will occur!!!
2026-05-28T11:54:42.720955-04:00 DietPi motion: [0:motion] [ERR] [ALL] motion_watchdog: Fix the cause of camera/system locking and restart Motioney
  1. Then I restore "“rpi-dietpi-2026-0516.img” to SD by Win32diskiamge. Reboot without USB pen drive. Thought this should fallback to the begining working version. But to my surprise, it got the same “motion_watchdog: pthread_cancel failed” problem.
  2. Why? I think I miss something, but can not figure out. Is it hardware problem?
  3. Linux DietPi 6.12.75+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2026-03-11) aarch64 GNU/Linux

Unfortunately, you haven’t filled out the troubleshooting template or provided any kind of log. So, unfortunately, no one can help you.

Enter by mistake. Detail reposted.

I don’t have a solution for your problem, but I also run a camera (CM3) on a RPi 3B and I switched to mediaMTX since motion and motioneye have no native libcamera integration.

Some months ago I got it running with libcamerify but it’s such a fiddling, mediaMTX just works out of the box.

It’s also possible to send the video stream then to motion to get motion detection.
If you want a more modern approach, you can use Frigate (probably doesn’t run so well on a RPi 3B), or OpenCV.
If you want a fancy webpanel, you can also consider Shinobi

just as reference on how to switch to modern camera stack and libcamerify Upgrading from 10.3 to 10.4 breaks MotionEye cameras · Issue #8168 · MichaIng/DietPi · GitHub

Thanks for the response. Actually I also tried mediaMTX, after the Motioneye Watchdog problem. But What I got was a “blank/gray” screen. I tried the Googel AI suggestions without luck.

What I do NOT understand is that why I still got the watch_dog problems after I booted from SD card which restored from the standalone backup image, which worked before during the step 1.

Did I break Rpi3B H/W ? I double checked the camera cable connections.

what is the kernel version on your RPi3B now? 6.12 or 6.18?

Linux DietPi 6.12.75+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.75-1+rpt1 (2026-03-11) aarch64 GNU/Linux

Maybe it make sense to open an issue on the Motion Github repository.