Any idea what causes this error? - Cannot write xmp file - Bad file descriptor (Win10 build 3.4.1.1)

Almost every session I get this error popping up every now and again. It doesn’t seem to cause too many problems and I haven’t noticed any file corruption. So I have just been ignoring it so far. I’m assuming that the xmp file is written eventually.
Anyone know what might be causing this?

This is on Windows 10 build 3.4.1.1.

That doesn’t seem to be a darktable error message (it is not in codebase), rather an OS error.
I suggest to check the integrity of the file system and that you have write permission on the image folder.
are you sure the .xmp files are really written?

1 Like

Thanks for the info. I’m sure the xmp files are being written and I have write permissions to the folder. It’s just a regular folder with photos in it. I have been successfully editing the photos for several weeks and all my edits are being saved. The error message isn’t constant, it just pops up every now and again when I’m adjusting sliders.

This shows the last modified date of an xmp file, which corresponds with some edits I’ve done today:

Couple things…

Easy to fix:

  • faulty antivir messing with stuff
  • some windows-defender problem
  • maybe some rights limits

Check and make sure that no antivir/defender is messing with processes and make sure your user has full rights to the folder & files, folder isn’t on network drive etc

Harder:

  • faulty/dying disk

Scan and if problems foun replace immediatelly.

Thanks @johnny-bit for your help

  • faulty antivir messing with stuff - I only use Windows Defender
  • some windows-defender problem - Not sure how to check if this is causing issues. I only have issues with darktable
  • maybe some rights limits - I am the sole administrator on the PC and have full rights to the folder and all parent folders

Check and make sure that no antivir/defender is messing with processes and make sure your user has full rights to the folder & files, folder isn’t on network drive etc

I definitely have full rights to the folder and files. However, the folder is a Onedrive folder, which means it is automatically backed up to the cloud. I wonder if this might have something to do with it. Also worth noting is that I have not experienced this problem before on previous darktable builds, but that might be coincidental. I also don’t experience it with RT, ART or any other program.

  • faulty/dying disk - Windows is reporting no errors with the (very new) SSD.

It is possible that onedrive sync process is locking files at the same time as darktable is trying to write the file.

1 Like

I get exactly the same thing. I believe its a sync error…you can recreate it by turning a module off and on quickly to assess an edit or back and forth between ctrl z and ctrl y to check a slider setting…anything like that …I just think there is a temp lock until onedrive gets sync’d…if I see it I just pause a second and then make a change but I have not noticed it to cause any issues

Edit I also often do an edit and if I like the result and the next few photos are roughly the same I will ctrl c and then ctrl v to each as I go through them. I have found I sometimes get going too fast ie ctl v spacebar ctrl v…after a few i sometimes see the error so I think onedrive just needs to catch up…I know i can apply it to more than one but I like to do them one at a time in case I get an unexpected result then… I ctl z to remove it for that one and or tweak a module if needed and then on to the next …but regardless of all that this will bring on that error for sure after some time…

1 Like

Thanks very much for all the help.
This was my exact suspicion, that it’s Onedrive not catching up with how fast darktable is writing to the xmp files. The error does some to happen when I’m working particularly fast and making lots of quick changes (like turning modules on and off, etc.). It’s strange that I never noticed it before with builds prior to 3.4, but I can’t imagine that the xmp write frequency has changed…

It’s an annoyance, but as you @priort have also noticed, it doesn’t seem to cause any long-term issues. On balance, I think it’s worth living with rather than relocating my files and not having Onedrive sync them. I love the automatic backup to ensure I never lose anything.

If anyone has any ideas for how to “fix” it, please shout out. Is it just coincidence that I’m only seeing this since build 3.4? @priort did you notice it before?

I have not bothered but I suspect if you paused syncing while editing and then turned it back on you would be okay…you can select to pause onedrive for a couple of hours ….just a though…if I remember I will try it…