Getting "could not make fd from handle" error

Using Windows client to a Nextcloud instance on FreeBSD and trying to sync a large folder full of backups. There is sufficient space on the server, and several thousands of files have already been synced, but now I’m getting the above error on the client trying to sync more.

Relevant portion of the log:

2023-06-17 17:44:20:995 [ debug nextcloud.sync.database C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\common\syncjournaldb.cpp:2439 ]	[ OCC::SyncJournalDb::commitInternal ]:	Transaction commit "Upload info" and starting new transaction
2023-06-17 17:44:20:995 [ debug nextcloud.sync.database.sql C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\common/ownsql.h:151 ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 "Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m9hbpdSJIX1qhy6c9o1_400.gif"
2023-06-17 17:44:20:995 [ debug nextcloud.sync.database.sql C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\common\ownsql.cpp:295 ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT baseFileId, baseModtime, baseEtag, basePath FROM conflicts WHERE path=?1;"
2023-06-17 17:44:20:995 [ info nextcloud.sync.propagator.bulkupload C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:177 ]:	"/Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m9hbpdSJIX1qhy6c9o1_400.gif" transmission checksum "96cbf1cb56de8d012513832d664d0902" "C:/Users/anaer/Nextcloud/Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m9hbpdSJIX1qhy6c9o1_400.gif"
2023-06-17 17:44:21:995 [ warning nextcloud.sync.propagator.bulkupload C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:197 ]:	Could not prepare upload device:  "could not make fd from handle"
2023-06-17 17:44:21:995 [ info nextcloud.sync.propagator.bulkupload C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:488 ]:	Item completed "Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m8w1gg6JA21rtmqhco1_500.png" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW "could not make fd from handle"
2023-06-17 17:44:21:995 [ debug nextcloud.sync.propagator C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\owncloudpropagator.cpp:882 ]	[ OCC::OwncloudPropagator::addToBulkUploadBlackList ]:	black list for bulk upload "Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m8w1gg6JA21rtmqhco1_500.png"
2023-06-17 17:44:21:995 [ warning nextcloud.sync.propagator C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:666 ]:	Could not complete propagation of "Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m8w1gg6JA21rtmqhco1_500.png" by OCC::BulkPropagatorJob(0x234ec737c40) with status OCC::SyncFileItem::NormalError and error: "could not make fd from handle"
2023-06-17 17:44:21:996 [ info nextcloud.sync.propagator.bulkupload C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\bulkpropagatorjob.cpp:689 ]:	modify final status NormalError OCC::SyncFileItem::NormalError OCC::SyncFileItem::NormalError
2023-06-17 17:44:21:996 [ debug nextcloud.sync.statustracker C:\Users\sysadmin\AppData\Local\Temp\2\windows-8400\client-building\desktop\src\libsync\syncfilestatustracker.cpp:274 ]	[ OCC::SyncFileStatusTracker::slotItemCompleted ]:	Item completed "Shared with Deb/Kristine's Files/Passport External Drive/Pictures/tumblr_m8w1gg6JA21rtmqhco1_500.png" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW

Any suggestions on how I can fix this?

Looking at the code, it’s failing when trying to open that file in read-only mode.

Is there anything unusual about tumblr_m8w1gg6JA21rtmqhco1_500.png? Weird OS file attributes? Maybe not readable by your user (when not running with elevated privileges)?

The file was usable, and completely accessible. Further checks determined that, despite the update check saying everything’s fine, my Nextcloud client was quite out of date. Having completely uninstalled that version and installed the latest version, the error appears to have gone.