Skip to content
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

Error syncing files #7

Open
opal06 opened this issue Feb 10, 2021 · 2 comments
Open

Error syncing files #7

opal06 opened this issue Feb 10, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@opal06
Copy link

opal06 commented Feb 10, 2021

I get the following error when trying to sync a file:
Fetching collection from Zotero... Done.
Fetching item list... Done.
Items to sync: 1
Traceback (most recent call last):
File "/home/luca/.local/bin/sync_zotero_rm", line 70, in
rm_items = rmapy.get_meta_items()
File "/home/luca/.local/lib/python3.8/site-packages/rmapy/api.py", line 180, in get_meta_items
for item in response.json():
File "/home/luca/.local/lib/python3.8/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3/dist-packages/simplejson/init.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Any ideas?

@dnlbauer
Copy link
Owner

Hi,

this happens to me from time to time too. I'm still not sure what is causing this and how to fix it. The reason seems to be in the rmapy library (or I'm using it wrong).

This (suboptimal) workaround works for me:

  • I have https://github.com/juruen/rmapi installed which uses the same config files rmapy uses for credentials etc.
  • If this error happens, I make a single call to rmapi from command line. I.e. rmapi ls. This seems to refresh some cached token or something I am not aware of. (Log is saying ERROR: 2021/02/11 12:43:03 api.go:34: failed to fetch documents 401 Unauthorized Error; ERROR: 2021/02/11 12:43:03 main.go:30: retrying...)
  • After that, sync_zotero_rm is working again.

Cheers,
Daniel

@dnlbauer dnlbauer added the bug Something isn't working label Feb 11, 2021
@opal06
Copy link
Author

opal06 commented Feb 11, 2021

This did the job for me too, but I will keep an eye on it and maybe try to nail it down. Would be sweet if we were able to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants