-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyzotero.zotero_errors.HTTPError: Code: 500 #134
Comments
Unfortunately the 500 error isn't particularly informative, and you'll receive a specific error if you're being rate-limited, but there's no reason for you to call zot.item individually. If you want to retrieve every item in your library, you can use zot.everything(zot.item(content='bib', style='ieee')) which should be a lot faster and less error prone, and far less likely to get you rate-limited. |
I guess you meant |
As you say, the itemKey parameter is the only way to do this with arbitrary keys. You can either put them into a group, or manually split your list into sub-lists of 50 (with the last one potentially being shorter) and pass each one to your |
Actually this seems to work fine even for more than 50 items (tested with 320 items): |
Thanks! |
Here I am stuck with another problem. Even though the command If we could sort the result by Any other idea how this could be fixed? Sorting them by |
Hi, I then fill in the fields with info, and finally check the item and try to upload it: However, I get the following error:
I believe the key at the end is created automatically. |
It's hard to know what's going on here. A 500 error is (of course) a server-side application error, so unless Pyzotero is sending malformed input (which seems unlikely, but not impossible) there isn't much I can do. Are you creating large numbers of items in sequence? Can you reproduce the error by trying to recreate the item in question? |
Yes, so first I tried it with ~200 items, got the ~50 limit prompt.
Where I replaced the user number with the string USER_ID and the key with the string 'key' in the Zotero object instantiation for privacy reasons. Output:
Maybe I am doing something wrong? |
Can you paste the output of |
Sure:
When I run the check_items() method with |
Check only ensures that there are no missing or extra fields, it doesn't check content. I'll see whether I can reproduce the error here. |
The error is occurring because you're using the add a line to your
and modify |
Thanks! It works. |
I have a script running every night which automatically creates various bibliographies from my Zotero library.
To do so I get the HTML citation for every library item individually (more than 200 items) using the example code below (where
i
corresponds to a zotero item and the second line is executed multiple times, i.e. for each of the >200 items individually):This often works fine. However, sometimes it fails (without me or anyone else having changed anything at the library or the code) with an HTTP Error 500 and the following traceback:
If I then restart the script (without changing anything in the code or in the library) it often works.
Therefore I suspect that this is an issue either with timings or the Zotero server blocking too many requests.
Could this be possible?
Is there an option of setting a number of retries or something to avoid this problem?
Besides, it would probably make sense to query the citation of all library items at once instead of querying item by item, right?
The text was updated successfully, but these errors were encountered: