Comments (10)
Thank you for the report @vgreg
Can you please share a reproducible example that caused this error? Seems like the except
's aren't catching whatever error is thrown and then we don't have r
defined. It'd be nice to have an example to figure out what that error is
from habanero.
I am still looking for an example that will consistently reproduce the error. I was retrieving all articles for a set of about 150 journals and had the error occur for two journals, but I have been to re-run the request for both with no issue the second time.
Here is a simplified version of a request that failed once but has been working every other time:
from habanero import Crossref
cr = Crossref()
query = {"issn": "0028-3932"}
responses = cr.works(
filter=query, cursor="*", cursor_max=12000
)
cursor_max
is set to slightly more than the number of DOIs for the journal.
from habanero.
Thanks - I'll see if I can get that to fail
from habanero.
This may be difficult to track down - the facat that it doesn't happen consistently suggests it's an intermittent problem with the Crossref API
from habanero.
I was able to reproduce a similar error and see what gets printed on line 163. Here is the exception:
HTTPSConnectionPool(host='api.crossref.org', port=443): Max retries exceeded with url:
/works?filter=issn%3A0028-3932&cursor=DnF1ZXJ5VGhlbkZldGNoBgAAAAAFuuH-Fmx3VDZUUHY5VHlhdThmaGVtbFhBOVEAAAAABcXycBZPY3FES3VMU1R5R3JIWHlwQUZBcktnAAAAAAXd460WTUpsaGN0RGFRbS1yN0ZYWTJ3MG5pUQAAAAAGAprKFlVTQUNpdVFEVHZLdWVZQWxVZEJDUUEAAAAABbl
xaxY0bldDU3pmSlJZeWhaSGk2VHVVdHh3AAAAAAW0yJAWaUpOMms5em5SUmVMR2JjT2VGdEFtdw%3D%3D (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0xffff33f68e90>, 'Connection to api.crossref.org timed out. (connect
timeout=None)'))
It seems that ConnectTimeout
is derived from RequestException
, so it is caught on line 162:
https://requests.readthedocs.io/en/latest/api/#requests.ConnectionError
However, the code continues to line 164 with r
still undefined.
from habanero.
Okay, thanks for this. I'll try to get to this soon
from habanero.
Having the same issue...
HTTPSConnectionPool(host='api.crossref.org', port=443): Max retries exceeded with url: /works?query=author%3AMONAGHAN+A%2BAND%2Btitle%3A%E2%80%98CALMLY+CRITICAL%E2%80%99%3A+EVOLVING+RUSSIAN+VIEWS+OF+US+HEGEMONY%2BAND%2Byear%3A2006%2BAND%2Bjournal%3AJOURNAL+OF+STRATEGIC+STUDIES&rows=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f3fec6f7f70>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
An error occurred: local variable 'r' referenced before assignment
Let me know if I can help with debugging (but the run continues despite the error...)
from habanero.
thanks for your report @sdspieg ! Sorry about the issue. I started working on this, but I just haven't had time to finish it off. I'll let you know if I could use any help.
from habanero.
@vgreg @sdspieg Can both of you reinstall from Github and try again?
from habanero.
closing for now, if it pops up again ping here
from habanero.
Related Issues (20)
- CrossRef.works return type HOT 7
- Exact search for titles HOT 5
- change master to main HOT 1
- test mailto, add to test-settings.py
- list index out of range when using WorksContainer HOT 4
- Get DOI from query? Convert to dataframe? HOT 4
- Installs "test" into Python path HOT 2
- error message requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url even when ua and mailto is set HOT 12
- Add timeout option HOT 5
- works: Warning for one bad id pollutes entire response HOT 10
- Mark two more tests as vcr ones HOT 3
- habanero_utils.py gives TypeError on api.crossref.org 404 err HOT 4
- Fix GH actions for python 3.8 and 3.9
- Month returned by habanero.cn.content_negotiation(ids = doi) no longer in curly brackets HOT 6
- Can't make field queries request HOT 2
- Fix readthedocs connectgion HOT 1
- Library returns wrong values HOT 4
- Update where Crossref's issue tracker is HOT 1
- bibtexparser integration HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from habanero.