ietf-tools / bibxml-service

Django-based Web service implementing IETF BibXML APIs
https://bib.ietf.org
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

DOI bibxml error #364

Closed kesara closed 1 year ago

kesara commented 1 year ago

Describe the issue

I the error "Error resolving bibliographic item. Tried methods: auto (DoiAdapter: ): uncategorized issue, fallback (): not indexed" when I tried to query:

Both work fine now.

Code of Conduct

sentry-io[bot] commented 1 year ago

Sentry issue: BIBXML-SERVICE-76

kesara commented 1 year ago

In the logs:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  File "requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "simplejson/decoder.py", line 372, in decode
    obj, end = self.raw_decode(s)
  File "simplejson/decoder.py", line 402, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  File "xml2rfc_compat/views.py", line 101, in resolve_automatically
    item = adapter.resolve()
  File "bibxml/xml2rfc_adapters.py", line 625, in resolve
    result = get_doi_bibitem(docid)
  File "doi/crossref.py", line 56, in get_bibitem
    resp = works.doi(docid.id)
  File "crossref/restful.py", line 957, in doi
    result = result.json()
  File "requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

and

GET https://api.crossref.org/works/10.1145/2975159 [504]

{reason: Gateway Time-out}
kesara commented 1 year ago

Do these types of queries make a GET request to crossref.org?

stefanomunarini commented 1 year ago

Hi @kesara ,

We retrieve DOI data from Crossref using their API. It looks like their system was down when you tried to make that request.

Can we close this issue as it's not persisting?

kesara commented 1 year ago

@stefanomunarini I'm okay with closing this issue. Can we provide a more helpful error message for the users?

stefanomunarini commented 1 year ago

@kesara caching seems like to me a good solution. We can for sure improve error message for the users. I'll take care of this over the next few weeks