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

BOOK第一次加载成功,更新豆瓣内容后再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. #11

Open
LollyWang opened this issue Sep 10, 2024 · 0 comments

Comments

@LollyWang
Copy link

首先感谢提供这么好的方案!
执行打印如下
Run python -u scripts/douban.py "book"
notion 183
total = 0
size = 50
total = 0
size = 100
total = 0
size = 150
total = 0
size = 168
total = 0
size = 15
插入我在北京送快递
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 118, in _parse_response
response.raise_for_status()
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/httpx/_models.py", line 763, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://api.notion.com/v1/databases/None/query'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 277, in
insert_book()
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 234, in insert_book
book["作者"] = [
File "/home/runner/work/douban2notion/douban2notion/scripts/douban.py", line 235, in
notion_helper.get_relation_id(
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 56, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 266, in call
raise attempt.get()
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 301, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/six.py", line 719, in reraise
raise value
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/retrying.py", line 251, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/home/runner/work/douban2notion/douban2notion/scripts/notion_helper.py", line 186, in get_relation_id
response = self.client.databases.query(database_id=id, filter=filter)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/api_endpoints.py", line 132, in query
return self.parent.request(
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 194, in request
return self._parse_response(response)
File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/notion_client/client.py", line 126, in _parse_response
raise APIResponseError(response, body["message"], code)
notion_client.errors.APIResponseError: path failed validation: path.database_id should be a valid uuid, instead was "None".
Error: Process completed with exit code 1.

@LollyWang LollyWang changed the title BOOK第一正常同步,后续再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. BOOK第一次正常同步,后续再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. Sep 10, 2024
@LollyWang LollyWang changed the title BOOK第一次正常同步,后续再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. BOOK第一次加载成功,更新豆瓣内容后再执行出错 httpx.HTTPStatusError: Client error '400 Bad Request' for.. Sep 10, 2024
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

1 participant