Describe the bug
I was testing #5212 and I've noticed that image thumbnails from camera import aren't being generated. I wanted to report it there, however the error is present in current master, so there's no fault of #5212 here.
To Reproduce
-d camctl fills with entries like:33,505093 [camera_control] camera control locked for camera 0x562a6f896490
33,574022 [camera_control] failed to get a preview of IMG_0231.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574054 [camera_control] failed to get a preview of IMG_0231.JPG in folder /store_00020001/DCIM/100CANON on device
33,574070 [camera_control] failed to get a preview of IMG_0232.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574084 [camera_control] failed to get a preview of IMG_0232.JPG in folder /store_00020001/DCIM/100CANON on device
33,574098 [camera_control] failed to get a preview of IMG_0233.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574112 [camera_control] failed to get a preview of IMG_0233.JPG in folder /store_00020001/DCIM/100CANON on device
33,574126 [camera_control] failed to get a preview of IMG_0234.JPG in folder /store_00020001/DCIM/100CANON on device
33,574139 [camera_control] failed to get a preview of IMG_0235.JPG in folder /store_00020001/DCIM/100CANON on device
33,574152 [camera_control] failed to get a preview of IMG_0236.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574165 [camera_control] failed to get a preview of IMG_0236.JPG in folder /store_00020001/DCIM/100CANON on device
33,574179 [camera_control] failed to get a preview of IMG_0237.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574196 [camera_control] failed to get a preview of IMG_0237.JPG in folder /store_00020001/DCIM/100CANON on device
33,574210 [camera_control] failed to get a preview of IMG_0238.CR2 in folder /store_00020001/DCIM/100CANON on device
33,574224 [camera_control] failed to get a preview of IMG_0238.JPG in folder /store_00020001/DCIM/100CANON on device
Expected behavior
in 3.0.2 everything works correctly:
-d camctl is:5,399079 [camera_control] creating new context 0x5626dcf0cc50
5,417505 [camera_control] loaded 2601 camera drivers.
5,430689 [camera_control] loaded 5 port drivers.
5,450999 [camera_control] 0 cameras connected
5,495000 [camera_control] registering listener 0x5626dd0e2f70
22,234118 [camera_control] loaded 6 port drivers.
22,257094 [camera_control] 1 cameras connected
22,421748 [camera_control] device Canon EOS 77D on port usb:001,005 initialized
24,456527 [camera_control] registering listener 0x5626dd664f40
24,456547 [camera_control] camera control locked for camera 0x5626dd5db600
35,017045 [camera_control] camera control un-locked for camera 0x5626dd5db600
35,017117 [camera_control] unregistering listener 0x5626dd664f40
39,590400 [camera_control] unregistering listener 0x5626dd0e2f70
Screenshots
darktable 3.0.2:

darktable 3.1.0+1806~g70e3a7a78

Platform (please complete the following information):
gphoto2 2.5.20 x86_64-pc-linux-gnu-gcc, popt(m), exif, no cdk, no aa, no jpeg, readline
libgphoto2 2.5.22 all camlibs, x86_64-pc-linux-gnu-gcc, ltdl, EXIF
libgphoto2_port 0.12.0 iolibs: disk ptpip usb1 usbdiskdirect usbscsi, x86_64-pc-linux-gnu-gcc, ltdl, USB, no serial
Additional context
build.sh --enable-opencl --disable-game --install --build-type RelWithDebInfo --prefix ~/darktable_repos/dbuild/;
I had a bit of time to check so I checked.
last version before recent chanes in camera control:
3.1.0+756~g3b7fa6504 - works
3.1.0+757~g5bf1b8c2b - has problem
therefore my assumption is that bug got introduced in 5bf1b8c2bb601244e470b2d317f4e353ba09a8d4 (PR #4377)
@jenshannoschwalm - How can I help you track the issue?
Thanks for reporting. YES - there is a problem with thumbnails generating, i am already working on that. Still testing what i did on that point, probably a pr tomorrow.
Although this might be something diffetent
I have fixed a similar issue on this commit if it can helps: dd9bd9b3db625a2e1e0f53fdaad84790d7ffae3c
I have scheduled that for 3.2, hope it can make it!
Working on it ...