MacOS version: Ventura 13.4
DEVONthink version on the Mac: 3.9.2
DEVONthink To Go on my iPhone: 3.7.4 (17370)
Before I describe the shortcut and the problem, let me first describe how I made sure that my Inbox in DTTG on my iPhone and in DEVONthink Pro on my Mac were both clean, synchronized, and (apparently) free of issues.
- Force-quit DTTG on my phone to make sure it didn’t sync while I did the next few steps
- Back on the Mac, quit and restarted DEVONthink.
- Removed all files from the DEVONthink Inbox:
- Emptied the DEVONthink Trash on the Mac and checked that there was nothing in it.
- Used File ▹ Verify and Repair Database followed by File ▹ Check File Integrity on the Inbox in DEVONthink on the Mac and made sure there are no issues in the log:
- In the Preferences for DEVONthink on the Mac, in the Sync tab, selected Inbox and ran “Clean Database…”:
- Since the previous step deselected the Inbox from the list of Databases being synchronized, I then reselected the checkbox for Inbox, and let DEVONthink sit for several minutes to make sure all the databases were sync’ed to the sync store.
- Back on the phone, restarted DTTG, let it sync for many minutes, made sure the Inbox was empty and there were no warnings in the sync log. For good measure, I tapped on the “cloud” icon in the bottom row to make it sync a couple more times. There were no sync warnings, no errors – everything looked peachy. I verified that the sync location panel showed that the toggle for the Inbox location was on, and that all the databases synchronized in the last minute.
I made a simple iOS shortcut to create quick short notes in DEVONthink:
The purpose is simple: ask me for some text, then create a markdown document with that text as the title of the document prepended with the string “@log”. (The document has no body created here and that’s okay – I create title-only md documents on the Mac on a daily basis and it is never a problem.)
I ran the Shortcut from the Shortcut app. It prompted me for the text, as expected. I typed some text,
and clicked Done, and it ran apparently without any problems or warnings. Great! I switched back to DTTG, and saw that the Inboxes showed a count of 1:
I tapped on “Inboxes” and found my newly created document, as hoped:
I tapped on the document and DTTG said it didn’t have a body, just as expected:
I let DTTG and DT on my Mac sync for a good long while. Came back to the Mac, and … hmmm … uh-oh. While the document existed, it had a cloud-with-downarrow icon next to it:
I looked in the log, and it’s showing as “File still pending”:
I went back to DTTG on my phone, and it is showing “Missing file”:
I cleared the logs, force-quit DTTG, restarted it, tapped the cloud icon to make it sync, let it sync, waited, made it sync again. Now a new warning showed up in the sync log:
And that’s where things are stuck now:
- I can see a document in both DTTG and DT
- DTTG seems to think it still needs to upload a document to the sync store, yet something by that name does exist there, and I can see it in DT on the Mac
- DT on the Mac says that the document remains to be downloaded
This behavior of the Shortcut is also 100% consistent and repeatable: every document it creates looks like it synchronizes to DT on the Mac, yet suffers from this “file still pending”/“left to be uploaded” problem. At the same time, no other kinds of documents have this problem. Everything is otherwise sync’ing perfectly – documents that I add to databases on my Mac show up on my iPhone; documents I add or create on my iPhone show up on my Mac. As far as I can tell, only the documents created by the Shortcut have this peculiar problem.
What is happening? Am I missing some step in the Shortcut that would make it create a document in a different and more correct fashion in DTTG? Or is it a bug in the DTTG “Create” action for Shortcuts on iOS? Does this problem happen to other people? How do I fix whatever the problem is, and make the Shortcut work?
I’m not new at debugging issues, so rest assured that I didn’t experience this problem just once. I’ve been struggling with this issue for days. I recreated the Shortcut to make sure some glitch didn’t occur, I verified all my databases, quit DTTG and DT multiple times, generally tried to make sure things are free of sync issues, etc. – basically tried everything I could think of. The description in this posting was done this morning by doing every step to reproduce the problem yet again, and make screenshots along the way.
One of the screenshots of the DTTG sync log above shows a “Synchronization” error 4099. This is not typical; I don’t think I’ve ever seen it before, and I think it’s extraneous to the whatever is really happening. Certainly it’s the case that in past days while trying to figure out what’s happening, I never saw this error. I’ve included it in the screenshot here because I didn’t want to take the time to redo all the steps to get to the point of being able to show the log at that particular moment in the sequence. The DEVONthink developers may recognize this error (I don’t), which is another reason I’m leaving it in, but again, I emphasize that (to the best of my recollection) this is the first time I’ve seen this particular error in the logs. Logically, since the “missing file” problem has been occurring consistently for this Shortcut but the error 4099 has not, it argues that some other problem or error is the root cause. (However, we can’t discount the possibility that it could be an interaction between the two, i.e., between the sync method and empty documents.)
In the past couple of weeks, I’ve also been seeing the familiar CloudKit “CKErrorDomain 15” error on the Mac. It is tempting to ascribe the Shortcut problem to this sync issue, but I’m not convinced this is the cause. First, DEVONthink is synchronizing something – the document created on my iPhone is showing up in DEVONthink on my Mac. Second, other documents sync fine. Third, based on all the symptoms, the problem seems more likely to involve something about the nature of the document being created by the Shortcut and less about the nature of the sync method.
2023-08-26 (later this morning) I had the bright idea of using the Shortcut to create a document, but then quickly switching to DTTG and editing the new document to put some text into the body, before DTTG tried to sync it. Lo and behold: this document does not suffer from the “missing file”/“still to be downloaded” problem. It sync’ed to DEVONthink on the Mac and there it looks like a normal document. This implies to me that the issue is with empty documents, or possibly a problem in the way that the DTTG “Create” action for iOS Shortcuts creates the documents it creates.
To test another possibility, I went into DTTG in the Inbox group, and used the ⊞ button to create a new document in the group, but giving it only a name and no body. In DTTG, the result looks very much like the documents created by the Shortcut: when you view the document, DTTG flashes a message that “This Markdown document contains only metadata”. Giving DTTG time to sync, no errors appear in the DTTG logs, and the document appears in my Mac DEVONthink Inbox group normally, without the cloud-with-downarrow icon and no error in the log. So I went back to the Shortcut on the iPhone one more time, and again created a document that way, let things sync, looked at it on the Mac, and … it has the cloud-with-downarrow icon.
So at this point, I am convinced the problem centers on the “Create” action on iOS.