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

Sync failing - Process completed with exit code 1. #43

Open
bvendsel opened this issue Apr 14, 2023 · 9 comments
Open

Sync failing - Process completed with exit code 1. #43

bvendsel opened this issue Apr 14, 2023 · 9 comments

Comments

@bvendsel
Copy link

Pasted Graphic 1

@bvendsel
Copy link
Author

image

@e-alizadeh
Copy link
Owner

@bvendsel Can you run follow instructions on running the script through a Python terminal as shown here to generate a local json file of highlights that were failed. You can check the highlights to see if there is anything strange.

Based on the error code (400 bad request), It seems to me that there are some highlights that might break the Readwise restrictions. For instance, Readwise sets limits to the number of characters per highlight.

@bvendsel
Copy link
Author

@e-alizadeh I did what you asked and got an empty json file back. I'm fairly certain it isn't a highlight as i recently archived off my old library and started fresh as part of a new job. Unless that could have caused a problem?

@e-alizadeh
Copy link
Owner

e-alizadeh commented Apr 24, 2023

@bvendsel Based on your description, there seems to be something wrong with your new setup, because I haven't updated the library, nor I see a Readwise API change that may impact the library.

Just a curiosity question, is there by any chance a change in the following items that are used as environment variables?

  • Readwise access token
  • Zotero API key
  • Zotero personal or group ID

Based on the log in your screenshot "0 Zotero items are retrieved.", the issue most likely is due to a change in Zotero settings.

@bvendsel
Copy link
Author

bvendsel commented Apr 24, 2023 via email

@alibrack
Copy link

alibrack commented Sep 13, 2023

Hi, I'm having this same issue, but with this json file generated for failed items. It seems to be an issue with the author field? How can I identify which items are causing the issues?

(json file changed to txt just to be able to upload)
error_log_400_failed_post_request_to_readwise.txt

@e-alizadeh
Copy link
Owner

@alibrack I got a chance to look at this. The issue comes from the fact that I only export Responses from Readwise (

dump(resp.json(), f)
).

If you still have the issue I can update the code to export the error along with the highlight itself?

@alibrack
Copy link

alibrack commented Sep 24, 2023 via email

@ncarboni
Copy link

ncarboni commented Jan 8, 2025

I am also affected by this problem. I am currently using Zotero2Readwise-Sync and in the Zotero to Readwise Automation phase I get the error "TypeError: unsupported operand type(s) for |: 'dict' and 'dict'". Important to underline that Zotero2Readwise-Sync worked without problem until last week or so.

Here's the log:

Run python run.py *** *** ***
  python run.py *** *** ***
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
    Python[2](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:3).8.18/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x6[4](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
Retrieving ALL annotations from Zotero Database
It may take some time...
Traceback (most recent call last):
  File "run.py", line 73, in <module>
    zt2rw.run()
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/zotero2readwise/zt2rw.py", line [5](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:5)3, in run
    zot_annots_notes = self.get_all_zotero_items()
  File "/opt/hostedtoolcache/Python/3.8.18/x[6](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:6)4/lib/python3.8/site-packages/zotero2readwise/zt2rw.py", line 42, in get_all_zotero_items
    items.extend(self.retrieve_all("annotation", self.since))
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/zotero2readwise/zt2rw.py", line 82, in retrieve_all
    query = self.zotero_client.items(itemType={item_type}, since=since)
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyzotero/zotero.py", line 16[7](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:7), in wrapped_f
    retrieved = self._retrieve_data(func(self, *args))
  File "/opt/hostedtoolcache/Python/3.[8](https://github.com/ncarboni/Zotero2Readwise-Sync/actions/runs/12625808503/job/35178035782#step:6:8).18/x64/lib/python3.8/site-packages/pyzotero/zotero.py", line 460, in _retrieve_data
    merged_params = params | self.url_params
TypeError: unsupported operand type(s) for |: 'dict' and 'dict'
Error: Process completed with exit code 1.

edit: fixed with proposition on issue #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants