inspirehep / rest-api-doc

Documentation of the INSPIRE REST API
https://inspirehep.net
Creative Commons Attribution Share Alike 4.0 International
40 stars 10 forks source link

Syntax error while parsing DOI #11

Closed eschnett closed 4 years ago

eschnett commented 4 years ago

I am trying to look up this DOI: 10.1007/jhep0(.2013)041. This leads to a syntax error when using the API. It leads to an internal error when I use the search field on the web page.

The full error message I receive is (I am using Julia, but the error should be "readable" anyway):

ERROR: HTTP.ExceptionRequest.StatusError(400, "GET", "/v1/search/query?q=doi:10.1007%2Fjhep07%282013%29041&fl=bibcode,citation_count", HTTP.Messages.Response:
"""
HTTP/1.1 400 Bad Request
Date: Tue, 28 Jul 2020 04:00:40 GMT
Content-Type: application/json
Content-Length: 565
Connection: keep-alive
Server: openresty/1.15.8.1
Access-Control-Allow-Origin: http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu
Access-Control-Allow-Methods: DELETE, GET, OPTIONS, POST, PUT
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken
Access-Control-Allow-Credentials: true
Vary: Origin
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4823
X-RateLimit-Reset: 1595992737
Retry-After: 83896
Set-Cookie: session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJS8gv3LY808i33DffL9qvKrvBzyTb2qwqt8Hfxy_TL9a30c_fKijQKNPB1cbVVqgXqLUgtyk3MS80rgZlWWpxaBDZRycjMxEipFgDRzSOy.Xx-i6A.UtqEVCdOAuRzdIAGbynY5Mjaz3g; Expires=Wed, 28-Jul-2021 10:00:40 GMT; HttpOnly; Path=/

{"responseHeader":{"status":400,"QTime":1,"params":{"q":"doi:10.1007/jhep07(2013)041","fl":"bibcode,citation_count","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5f1fa2e8-415e19707bffd2ffa6d5e046","rows":"10","wt":"json"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.Exception"],"msg":"org.apache.solr.search.SyntaxError: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse doi:10.1007/jhep07(2013)041: The parser reported a syntax error, antlrqueryparser hates errors! ","code":400}}
""")

I think it might be the parentheses in the DOI that cause the problem.

michamos commented 4 years ago

Are you sure is this an issue with the INSPIRE API? we don't have a /v1/search/query endpoint, and the access control headers make it look like you're querying ADS instead.

eschnett commented 4 years ago

You are right, I submitted this to the wrong issue tracker. Apologies.