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…

Hello,
I actually had the same issue and message with version 3.8.1 on Windows 10 right now.
The problem appears to be the selection through the pre-defined “Image” folder from Windows.
If I select a folder within the Windows Image folder to be imported to Darktable, I do get while importing the message: Cannot write xmp file “…”: Bad file descriptor.
However, if I add the location manually ( by clicking on the Plus symbol on the top of the folder pane and walk my way through the folders until I reach the images I want to import within the Windows Image folder), the xmp files are created and I can initiate to have these overriden if desired.

That appears like a bug to me, that is existent since many versions now. I had tried it with many different versions right now and in each of the once I tried (3.6.0, 3.6.1, 3.8.0, 3.8.1) it is the same behaviour.

Best,
KW

Have you raised an issue on github?

Are you syncing that folder to onedrive by any chance…if so try to unsync it and see if the behaviour goes away…

No, as I am not a user yet

Onedrive is disabled in my case . Not using it at all.
Same issue arises also when disconnected from the network.

I don’t use that folder but I will see what happens if I try…

@K_W Welcome to the forum!

Meaning you will sign up with GitHub soon…? If not, someone else could probably report it for you, but it would be better if you did.

@europlatus Best leave OneDrive out of the equation. It can cause issues with open-source software. That and Defender. Either add your directories as exceptions or disable the services permanently. Maybe try symbolic linking[1] your local non-syncing folder with the OneDrive one. ([1] Forgive me if I used the term wrong…)

One other thing I though of in Windows some people have an admin account but work in a user account so that things are a bit more locked down. Again just throwing darts but any chance @K_W that might be it…if so you could try to run DT as an admin and see if the issue resolves …as I said just guessing here…

Can you describe better what is the “image” folder in windows. Is this the Libraries - Pictures? Maybe a print screen might be helpful to understand your problem.

Hi, and sorry for the long scilence!
I have worked a bit more now with Darktable and found that I had a setting on my Windows Machine that did hide the XMP files that are created when importing the image files to Darktable. When I now disable this option - I remember that I did activate it in the past as the additional files next to my image files did not suit me - then everything works fine again. No warning messages, changes are stored in the XMP files etc.
So this solved it for me.

I recognized it when I did copy all image files into a new folder and imported the new folder. The XMP files were not hidden by default in the new folder and could be created and were visible. When trying to copy these newly created XMP files back to an old folder I got a warning that the file did already exist - but was not visible.

It works for me now.

Best!

Olá! Qual opção você desabilitou para que o arquivo XMP seja criado? Meu Darktable não está criando nenhum arquivo XMP.

Versão 4.4.2
Windows 10 64b

Este é o meu primeiro uso com o Darktable (gostei muito do software), estou utilizando as pré-definições de fábrica.