zotero / translation-server

A Node.js-based server to run Zotero translators
Other
123 stars 52 forks source link

DOI searcher or DOI-related web searches hang randomly #172

Closed vassil-atn closed 2 months ago

vassil-atn commented 2 months ago

I'm using the docker version to run the server. Occasionally, all DOI-related searches seem to hang indefinitely (other web searches work fine). For example:

This works fine: curl -d 'https://www.nytimes.com/2018/06/11/technology/net-neutrality-repeal.html' \ -H 'Content-Type: text/plain' http://127.0.0.1:1969/web

This hangs: curl -d 10.2307/4486062 -H 'Content-Type: text/plain' http://127.0.0.1:1969/search

This also hangs: curl -d 'https://doi.org/10.2307/4486062' -H 'Content-Type: text/plain' http://127.0.0.1:1969/web

There's no error, the request just hangs indefinitely. It also seems to happen randomly - earlier today the same commands worked fine). Does anyone know what could be causing this?

dstillman commented 2 months ago

You would have to check the debug output from the server.

vassil-atn commented 2 months ago

This is the error it stops on on a DOI search request:

(node:62) UnhandledPromiseRejectionWarning: ReferenceError: requestText is not defined
    at processDOI (eval at <anonymous> (/app/src/translation/sandboxManager.js:70:4), <anonymous>:67:17)
    at doSearch (eval at <anonymous> (/app/src/translation/sandboxManager.js:70:4), <anonymous>:62:9)
    at Zotero.Translate.Search.rest (/app/modules/zotero/chrome/content/zotero/xpcom/translation/translate.js:1406:49)
    at loadPromise.then (/app/modules/zotero/chrome/content/zotero/xpcom/translation/translate.js:1396:39)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:62) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

Seems like it's the same error as in https://github.com/zotero/translation-server/issues/163. I can confirm that building the docker container from source fixes the issue. It would be good to update the Docker Hub image if possible.