DEVONthink Server stops responding

First, thanks for the help in getting started with Apple Script! This is something I’ve not much tinkered with before, and it’s always great to have a new tool in my kit.

Second, I went with a JavaScript bit of code to shut down and restart DT3, which works nicely. The code itself is as follows for anyone else who wants to use this procedure as I will:

(() => {
	/* First, find and quit the app. */
	console.log("About to close DEVONthink 3...");
	var app = Application("DEVONthink 3");

	/* Now wait a few seconds for it to close, then restart it. */
	console.log("About to restart DEVONthink 3...");
	app = Application("DEVONthink 3");

I saved this to a file named “RestartDT3.scpt” and can run this from the command line via:

osascript RestartDT3.scpt

And for the final bit of automation, I used the following command line to create a new crontab:

env EDITOR=vim crontab -e

Along with the following contents to execute the necessary command at 04:00 hrs. every morning:

0 4 * * * cd ~/ && osascript RestartDT3.scpt

We’ll see how this works when I’m next out of town. So far, it always takes longer than a day or so to stop responding, so I’m hoping this is the end of it.

1 Like

Nice work. Let us know how it behaves, especially on its schedule.

1 Like

Just as an aside, this might be one of the longest running support questions I’ve seen people trying to debug a problem that seems very hard to pin down. Kudos both on the support side @BLUEFROG and on the user side @Phileosophos


Thanks. And @cgrunenberg is a big part of this as well on our side of things.

1 Like

The next release will add a new hidden preference (ServerDebugLog) for extended logging by the server. Maybe this will help to figure out what’s going on.

1 Like

Sounds good! Perhaps it’s serendipitous timing that I had the server stop responding to me last week while I was typing a note. That hasn’t happened before. I’m attaching the zipped log files to this message in the hope that they tell you something. I can’t tell you the exact time to the minute, because it took me five or ten minutes to figure things out, but it was within 5 - 10 minutes of 2022-17-06 10:30 hrs. PDT. The DT app had been successfully restarted that morning by my cron job, so I could easily use it remotely, and I was taking a note about how to colorize a black bitmap in Photoshop when it stopped responding to me.
DevonThink 3 (529.7 KB)

Thanks for the log! At that time an HTTP GET request to view a certain file was repeated again and again (214 times in 87 seconds). And most likely that’s what’s making the server unresponsive.

Could you please execute the following script in the Script What kind of document does it open and how large is it?

tell application id "DNtp"
	set theUUID to "94351832-5AEC-4E8F-8CAB-FFB20E9360AD"
	set theRecord to get record with uuid theUUID
	open window for record theRecord
end tell

Sure. It opens the markdown document on which I was working at the time, entitled “Photoshop - Colorizing Line Art”. Today it’s 1.4k, because I’ve since added to it, but I can tell you at the time it was only 505 bytes in length if that helps.

Were both the edit and preview panes visible in the web interface?

Yes. And I type extremely fast if it helps (160 WPM+).