zotero / translation-server

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

Unhandled promise rejection error with ISBNs, no ISBNs working #79

Closed mvolz closed 5 years ago

mvolz commented 5 years ago

I can't get any isbns to work with the search endpoint. I've tried

curl -d 9780995555563 -H 'Content-Type: text/plain' http://127.0.0.1:1969/search curl -d 0511040938 -H 'Content-Type: text/plain' http://127.0.0.1:1969/search curl -d 9780198029359 -H 'Content-Type: text/plain' http://127.0.0.1:1969/search


> translation-server@2.0.0 start /home/marielle/code/zotero
> node src/server.js
(3)(+0000000): Translators initialized with 540 loaded

(3)(+0000003): Listening on 0.0.0.0:1969

(4)(+0003189): Translate: Binding sandbox to http://www.example.com/

(4)(+0000002): Translate: Parsing code for EIDR (79c3d292-0afc-42a1-bd86-7e706fc35aa5, 2017-06-03 11:41:00)

(4)(+0000001): Translate: Parsing code for Crossref (11645bd1-0420-45c1-badb-53fb41eeb753, 2019-01-07 08:14:17)

(4)(+0000001): Translate: Parsing code for Crossref REST (0a61e167-de9a-4f93-a68a-628b48855909, 2018-06-16 12:00:00)

(4)(+0000001): Translate: Parsing code for Library of Congress ISBN (c070e5a2-4bfd-44bb-9b3c-4be20c50d0d9, 2018-04-13 13:41:00)

(4)(+0000000): Translate: Parsing code for Gemeinsamer Bibliotheksverbund ISBN (de0eef58-cb39-4410-ada0-6b39f43383f9, 2018-04-13 13:41:00)

(4)(+0000001): Translate: Parsing code for DataCite (9f1fb86b-92c8-4db7-b8ee-0b481d456428, 2018-07-09 07:15:00)

(4)(+0000000): Translate: Parsing code for Open WorldCat (c73a4a8c-3ef1-4ec8-8229-7531ee384cc4, 2017-03-19 23:26:57)

(4)(+0000002): Translate: Parsing code for PubMed (3d0231ce-fd4b-478c-b1d3-840389e5b68c, 2019-01-07 07:52:09)

(4)(+0000001): Translate: Parsing code for arXiv.org (ecddda2e-4fc6-4aea-9f17-ef3b56d7377a, 2018-04-17 20:00:00)

(4)(+0000001): Translate: Parsing code for Lulu (9a0ecbda-c0e9-4a19-84a9-fc8e7c845afa, 2016-11-04 21:18:44)

(4)(+0000000): Translate: Parsing code for mEDRA (d9b57cd5-5a9c-4946-8616-3bdf8edfcbb5, 2014-05-26 03:50:55)

(4)(+0000001): Translate: Parsing code for Airiti (5f0ca39b-898a-4b1e-b98d-8cd0d6ce9801, 2018-04-17 21:16:52)

(3)(+0000001): Translate: All translator detect calls and RPC calls complete:

(3)(+0000000):  Library of Congress ISBN: 98

(3)(+0000000):  Gemeinsamer Bibliotheksverbund ISBN: 99

(3)(+0000000):  Open WorldCat: 100

(3)(+0000000):  Lulu: 101

(5)(+0000000): Translate: Running handler 0 for translators

(4)(+0000001): Translate: Parsing code for Library of Congress ISBN (c070e5a2-4bfd-44bb-9b3c-4be20c50d0d9, 2018-04-13 13:41:00)

(3)(+0000000): Translate: Beginning translation with Library of Congress ISBN

(3)(+0000000): Translate: resolving URL http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.ISBN=^9780995555563&maximumRecords=1

(3)(+0000001): Translate: resolved to http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.ISBN=^9780995555563&maximumRecords=1

(3)(+0000000): Zotero.HTTP.doGet is deprecated. Use Zotero.HTTP.request

(3)(+0000000): HTTP GET http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.ISBN=^9780995555563&maximumRecords=1

(3)(+0000359): Translate: Creating translate instance of type import in sandbox

(4)(+0000002): Translate: Binding sandbox to http://www.example.com/

(4)(+0000003): Translate: Parsing code for MARCXML (edd87d07-9194-42f8-b2ad-997c4c7deefd, 2018-08-25 14:14:34)

(3)(+0000003): Translate: Beginning translation with MARCXML

(3)(+0000001): Translate: Creating translate instance of type import in sandbox

(4)(+0000001): Translate: Binding sandbox to http://www.example.com/

(4)(+0000002): Translate: Parsing code for MARC (a6ee60df-1ddc-4aae-bb25-45e0537be973, 2018-01-30 09:40:41)

(3)(+0000018): Translate: Translation successful

(5)(+0000000): Translate: Running handler 0 for done

(5)(+0000000): Translate: Running handler 1 for done

(3)(+0000000): Translate: Could not find a result using Library of Congress ISBN -- trying next translator

(4)(+0000001): Translate: Parsing code for Gemeinsamer Bibliotheksverbund ISBN (de0eef58-cb39-4410-ada0-6b39f43383f9, 2018-04-13 13:41:00)

(3)(+0000000): Translate: Beginning translation with Gemeinsamer Bibliotheksverbund ISBN

(3)(+0000000): Translate: resolving URL http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.isb=9780995555563 AND pica.mat%3DB&maximumRecords=1

(3)(+0000000): Translate: resolved to http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.isb=9780995555563 AND pica.mat%3DB&maximumRecords=1

(3)(+0000000): Zotero.HTTP.doGet is deprecated. Use Zotero.HTTP.request

(3)(+0000000): HTTP GET http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.isb=9780995555563 AND pica.mat%3DB&maximumRecords=1

(3)(+0000083): Translate: Could not find a result using Gemeinsamer Bibliotheksverbund ISBN -- trying next translator

(3)(+0000000): HTTP GET http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.isb=9780995555563 AND pica.mat%3DB&maximumRecords=1 failed with status code undefined

(4)(+0000002): Translate: Parsing code for Open WorldCat (c73a4a8c-3ef1-4ec8-8229-7531ee384cc4, 2017-03-19 23:26:57)

(3)(+0000003): Translate: Beginning translation with Open WorldCat

(3)(+0000001): ZU.processDocuments() now takes only 3 arguments -- update your code

(3)(+0000000): Translate: resolving URL http://www.worldcat.org/search?qt=results_page&q=isbn%3A9780995555563

(3)(+0000001): Translate: resolved to http://www.worldcat.org/search?qt=results_page&q=isbn%3A9780995555563

(3)(+0000001): HTTP GET http://www.worldcat.org/search?qt=results_page&q=isbn%3A9780995555563

(node:3117) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
(node:3117) 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: 1)
(node:3117) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(3)(+0000164): Translate: Could not find a result using Open WorldCat -- trying next translator

(3)(+0000001): Error: read ECONNRESET

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)

(4)(+0000000): Translate: Parsing code for Lulu (9a0ecbda-c0e9-4a19-84a9-fc8e7c845afa, 2016-11-04 21:18:44)

(3)(+0000002): Translate: Beginning translation with Lulu

(3)(+0000001): Translate: resolving URL http://www.lulu.com/shop/search.ep?keyWords=9780995555563

(3)(+0000000): Translate: resolved to http://www.lulu.com/shop/search.ep?keyWords=9780995555563

(3)(+0000000): HTTP GET http://www.lulu.com/shop/search.ep?keyWords=9780995555563

(node:3117) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
(node:3117) 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: 2)
(3)(+0000132): Translate: Could not find a result using Lulu

(3)(+0000000): Error: read ECONNRESET

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)

(3)(+0000000): No more translators to try

(3)(+0000001): No items returned from any translator

(2)(+0000000): Translate: Translation using Lulu failed: 
No items returned from any translator

(5)(+0000000): Translate: Running handler 0 for error

(5)(+0000001): Translate: Running handler 1 for error

(5)(+0000000): Translate: Running handler 2 for error

(5)(+0000000): Translate: Running handler 3 for error

(node:3117) UnhandledPromiseRejectionWarning: No items returned from any translator
(node:3117) 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: 3)
(node:3117) UnhandledPromiseRejectionWarning: No items returned from any translator
(node:3117) 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)
(node:3117) UnhandledPromiseRejectionWarning: No items returned from any translator
(node:3117) 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: 5)
(node:3117) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
(node:3117) 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: 6)
mrtcode commented 5 years ago

Seems like some of the websites, that we are parsing, are unexpectedly closing connection. I can't reproduce this. But possible reasons could be:

You should check from the same host if you are able to get HTTP 200 code for: http://www.worldcat.org/search?qt=results_page&q=isbn%3A9780995555563 http://www.lulu.com/shop/search.ep?keyWords=9780995555563

mvolz commented 5 years ago

It was a public wifi. At home works fine :). Thanks!