DEVONthink Server stops responding

All I wanted to say is that DEVONthink does not handle TCP/IP on its own but that doesn’t…

…rule out this possibility.

1 Like

Given that you know the process ID (32458) now, you could open activity monitor, find that process (search for “DEVONthink” and then select the approprate process). From the dropdown in the toolbar (the one with the three dots on it) select the first option (“analyze process”). For my webserver, the start of the output looks like that:

Call graph:
    2540 Thread_3223   DispatchQueue_1: com.apple.main-thread  (serial)
      2540 start  (in dyld) + 462  [0x10338951e]
        2540 main  (in httpd) + 4065  [0x102921221]
          2540 ap_run_mpm  (in httpd) + 114  [0x1029378d2]
            2540 prefork_run  (in mod_mpm_prefork.so) + 475  [0x102b8e09b]
              2540 startup_children  (in mod_mpm_prefork.so) + 122  [0x102b8f43a]
                2540 make_child  (in mod_mpm_prefork.so) + 459  [0x102b8f39b]
                  2540 child_main  (in mod_mpm_prefork.so) + 2334  [0x102b9043e]
                    2540 ap_unixd_accept  (in httpd) + 55  [0x102988d97]
                      2540 apr_socket_accept  (in libapr-1.0.dylib) + 74  [0x7ffb1e4890cf]
                        2540 __accept  (in libsystem_kernel.dylib) + 10  [0x7ff806c4c092]

which seems reasonable: The process is waiting in the accept call on the socket. I suppose that DT server should show the a similar output.

1 Like

That’s a clever idea, and I surely wish I’d thought of it. For the record, when I try using the browser on the very same machine, I get the same timeout error. It doesn’t connect to the instance of DEVONthink running right next to the browser app (and it doesn’t matter whether I use Safari, Firefox, or Chrome, nor does it matter if I use the machine’s name, IP address, etc.).

Again, I didn’t know you could do that on the macOS. I’m learning! Two things in reply. First, there is no “analyze process” option, but the first one was named “sample process” and seems like maybe it does what you’re after. Second, I got a very different dump from what you posted. I’ve attached the compressed text here in the hope that it helps.

Sample of DEVONthink 3.zip (37.1 KB)

Cool stuff. I’d never have thought to encounter a class called WTF::wtf::ParkingLot. WTF, indeed.

Anyway, that and all the other WTF methods belong to WebKit, which is basically the browser engine underlying Safari (see here WebKit/Source/WTF/wtf at main · WebKit/WebKit · GitHub).

Not to mix up with Apple’s WebKit framework which is using very different class names (Apple would probably not use a WTF class, would they?) And it seems that there’s some messaging going on (or rather not?) in the app, too.

I have no idea what WebKit is doing in this process. @cgrunenberg would probably know, and he can also get more insight from this process sample than me.

There is in fact an indication that the process might still be waiting for input since it’s using select in one of the Threads. That’s used from CFSocket apparently, so it might be DT server’s way of doing TCP/IP, given that there’s also a CFRunLoopSpecific. Mostly all a wild guess, I’ve never done macOS network programming. Nor do I intend to, I’d rather go down the good ol’ Unix way, using poll instead of select.

Also in this respect, @cgrunenberg is probably the one who can enlighten us.

One more question: You were talking about a global style sheet. Are you perhaps also using some JavaScript code for your Markdown files? Or did you turn on Prism and/or Mermaid? I’m asking because some of the WTF threads seem connectec to JavaScript.

Heh, the original post subject is a bit misleading at this point. When I first posted, all I knew is that DEVONthink started with the whole not responding behavior a few days after I tried a global style sheet for the first time. However, it wasn’t long after that I got rid of the global style sheet altogether and was surprised when the problem persisted. This post has existed for far too long :slight_smile:

As to Prism and Mermaid, yes, I have both enabled. I love DT’s ability to do that stuff. I use it all the time to take snippets of code that can be formatted and design software diagrams as well. But I’ve had those enabled forever. I can disable them before I restart DT to see if that helps.

It might be a wild goose chase. But it can’t do any harm.

Thanks for the sample! I did few local samples for comparison. Overall it’s a pretty standard sample of a running server which was already accessed via a web browser and is currently idle/waiting. Therefore everything at least seems to work as expected (and none of the logs that I received contained every an error related to the server).

It’s an idle thread which was created by former WebKit activities (e.g. viewing web pages/documents or Markdown documents, converting/capturing them etc.)

So if everything’s basically all peachy and running fine, why is DEVONthink’s web server not responding at all to any client? Any ideas how I get this to stop happening?

Unfortunately impossible to tell so far. Might be a rare bug, a Bonjour hiccup (not unusual) or related to your network setup, the used browsers etc.

Given that a nc on the relevant port does not return anything and that Wireshark does not report any server answer when a TCP SYN is sent, a relation to a browser seems improbable. I’m quite certain that there’s some kind of problem in the network layer of the server process. Also, a network malconfiguration seems improbable given that they connect with SSH etc. So it can’t be a DNS or a routing problem, provided that the same approach (i.e. name or IP address) is used in SSH and the browser.

But it’s really difficult to figure out in a forum. Remote access would be more helpful than this to and fro of questions and answers.

Well, the configuration of the browser, extensions, documents (and maybe even the network) etc. might be important to initially trigger (!) this. Especially to reproduce this (as obviously logs & samples don’t help).

I’m happy to do a remote-access session with somebody, though I don’t know how to set that up.

1 Like

In the end this would be just another confirmation of the issue, ideal for debugging would be a way to reproduce this reliably.

time to change the posting title so as not to mislead future generations of readers?

1 Like

Done.

Another data point: tonight when DT stopped responding, I tried simply opening the server page in the settings dialog and doing a stop/start. That fixes the problem too. I don’t see how this can be anything but a web server issue in DT. I’m going out of town tomorrow and am restarting the iMac now after disabling support for MathJAX, Mermaid, and Prism in the markdown options. We’ll see if that has any effect.

Another data point: before leaving town last week, I restarted the DEVONthink server and unticked the boxes to support MathJAX, Mermaid, and Prism. The server stopped responding to me on Thursday of last week, so I don’t see any difference. Today, I used the stop button on the server settings page, then the start button, and sure enough it’s back. Still looking for a fix for this or any thoughts as to how to track and diagnose the problem.

See my former reply (“ideal for debugging would be a way to reproduce this reliably”).