Locked Files (*.rtf) - can't edit files in DT3

Hi Jim,

Yeah, when the issue occurs, if I switch to DEVONthink and select “Show in Finder”, and then try to open the file with TextEdit, I get same “file is locked” message from TextEdit.

I haven’t tried MacDown, but can do so later this evening after work.

I open files in DT externally by pressing ⌘⇧+O.

Just tried MacDown and get the same error:

When in Finder what permissions to the file and containing folder are shown?

In Finder, both the file and its parent folder have “normal” permissions. File has permissions 644, and folder has permissions 755. ACLs on both show nothing unusual.

What’s really weird to me (and what makes me “suspect” DEVONthink) is that this issue occurs semi-randomly and at differing time intervals. Sometimes I can happily edit my notes for a long time (> 20 minutes) without issue, while at other times the second time I save the file (in Typora / TextEdit / MacDown (which I just installed))—or the external editor’s auto-save kicks in—the file is locked.

Also interesting is that, despite the file being “locked”, selecting Get Info in Finder shows the “Locked” checkbox unchecked, and DEVONthink can happily save the file. Saving in DEVONthink “automagically” removes the lock and external editors can then save (for a while, until the issue recurs).

to confirm, an imported file inside the database not indexed?

Do you see this behavior with files in any other database?

Yes, the files are inside the database and not indexed. They were not “imported” but were created directly within DEVONthink itself.

I haven’t tried (yet). All of my Markdown notes (~ 2500 notes) are in the “Notebook” database. Among others, I have the following databases:

  • Notebox — this is where I keep all of my Zettelkasten-style notes
  • Personal — personal PDFs, webarchives, etc.
  • Tech — tech-related PDFs, webarchives, etc.
  • Work — work-related PDFs, webarchives, etc.

I will do some experiments this evening with notes in another database and see what mileage I get.

Is there anything special about your system, which version of macOS do you use?

Hi Jim,

I just tried creating a new Markdown note in a different database and ran into the same locking issue after a few minutes.

No, there’s nothing special about my system. I use DEVONthink on both an Intel iMac (27" 5K, 72GB RAM, 2TB SSD, 2019) and a MacBook Pro (16" M1 Max, 32GB RAM, 1TB SSD, 2022). I run into the issue less frequently on the Intel iMac. On the MacBook, which I use most of the day, I’m running into the issue more or less constantly.

On both machines I’m running macOS Monterey 12.5.1 (upgraded both machines from 12.5 to 12.5.1 last night, but issues have been present since Big Sur—for which I was a late adopter).

Did you try booting in safe mode or new, clean user account too? Do you use any file/folder encryption or compression tool? E.g. APFS compression?

No, I haven’t (yet) tried booting into safe mode or creating a clean user account. I had a “close” equivalent to a clean account when I got my new MacBook a few months ago (which I set up from scratch), and where I ran into the same issues.

No, I don’t use any file/folder encryption (other than the built-in FileVault, which is enabled), and I don’t use any compression (including APFS) tools.

Does it affect any other file type - plain text or rich text?

I haven’t tried. All of my note-taking is in Markdown format.

Are there any workarounds I might try? Today seems to be National Locked-File Day for some reason. I’ve resorted to closing DEVONthink so the files don’t get locked, keeping currently active notes open in Typora. A bit annoying, though, as I frequently find myself wanting to refer to / cross-link to other notes, web archives, etc.

Sorry, I ought probably have contributed to this a few days ago but didn’t really read the thread in detail until just now. I want to say only that my default markdown editor is also Typora and I’ve just tried opening in Typora, from DEVONthink, a markdown file which was created in my DEVONthink database. I had no problems editing and saving it in Typora.

Admittedly that was one quick, single file test but I’m wondering whether the material difference between your setup and mine might be that I don’t sync my databases at all.

Sorry not to be more constructive but I thought the crumb of information might be worth mentioning.

Stephen

1 Like

I do not know this but asking a wild and crazy question. Is there a log entry somewhere on which process locks or holds the lock on files. if so that would help debugging.

Edit: I remember. I do not know about logging but the “lsof” command will say what process locking a file. There is a man page to see how to use it. would be interesting to hear what process is holding the locks on those files. I am not at my computer to check if the command is present on the mac. i suspect it is hence i am mentioning.

Yes. Try rich text and plain text as I suggested to see if this is a broader issue than just Markdown :smiley: