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

invalid input as error in database url #305

Open
shirobachi opened this issue Mar 22, 2021 · 12 comments
Open

invalid input as error in database url #305

shirobachi opened this issue Mar 22, 2021 · 12 comments

Comments

@shirobachi
Copy link

Hey,

I wrote script what was working just fine, but since week it stopped. I just now had time to see what's going on and it say invalid input on line with db url. I run smoke test and same shit

Traceback (most recent call last):
  File "Downloads/run_smoke_test.py", line 29, in <module>
    run_live_smoke_test(token, args.page)
  File "/home/simon/.local/lib/python3.8/site-packages/notion/smoke_test.py", line 12, in run_live_smoke_test
    parent_page = client.get_block(parent_page_url_or_id)
  File "/home/simon/.local/lib/python3.8/site-packages/notion/client.py", line 169, in get_block
    block = self.get_record_data("block", block_id, force_refresh=force_refresh)
  File "/home/simon/.local/lib/python3.8/site-packages/notion/client.py", line 162, in get_record_data
    return self._store.get(table, id, force_refresh=force_refresh)
  File "/home/simon/.local/lib/python3.8/site-packages/notion/store.py", line 184, in get
    self.call_load_page_chunk(id)
  File "/home/simon/.local/lib/python3.8/site-packages/notion/store.py", line 286, in call_load_page_chunk
    recordmap = self._client.post("loadPageChunk", data).json()["recordMap"]
  File "/home/simon/.local/lib/python3.8/site-packages/notion/client.py", line 260, in post
    raise HTTPError(
requests.exceptions.HTTPError: Invalid input.

Any idea?

@ghost
Copy link

ghost commented Mar 24, 2021

I had a same problem and I solved it.

There are some changes added 'limit' parameter client.py and store.py, you can see it recent pull request!
However code on main page doesn't reflect it, and it occurs error like above.

If you download code here https://github.com/c0j0s/notion-py ,then error will be fixed :)

@ghost
Copy link

ghost commented Mar 25, 2021

I had a same problem and I solved it.

There are some changes added 'limit' parameter client.py and store.py, you can see it recent pull request!
However code on main page doesn't reflect it, and it occurs error like above.

If you download code here https://github.com/c0j0s/notion-py ,then error will be fixed :)

Is this a change in version 0.0.28? I am using 0.0.27 and getting the same issue.

@ghost
Copy link

ghost commented Mar 25, 2021

New commit code came out, but it was not reflected to new version.
Version 0.0.28 came out on 5, Feb and new commit code came out 20 days ago.
So you have to download new code on your own.
I checked URL that I wrote above and I found that url doesn't work :( sorry..
#294
In above url, If you click red box like picture, you can download new code.
스크린샷 2021-03-25 오후 2 45 32

@shirobachi
Copy link
Author

So I am not master user so probably I am making stupid mistake ..
I clone https://github.com/c0j0s/notion-py.git and all files from notion directory I copied to /home/simon/.local/lib/python3.8/site-packages/notion/block. Also I tried `/usr/local/lib/python3.8' but there are no files

So after this action my problem did not resolved ;/

@kamikazebr
Copy link

kamikazebr commented Apr 11, 2021

@shirobachi if you use pip install -r requirements.txt for the dependencies you can use the git link direct

like that
git+https://github.com/c0j0s/notion-py@master#egg=notion

In my case i'm using in Docker.

@shirobachi
Copy link
Author

So,
I cloned by git clone https://github.com/c0j0s/notion-py.git notion next I typed pip install -r requirements.txt and this is the output:
https://termbin.com/prst

Unfortunately, my script still has the same problem :(

@kamikazebr
Copy link

kamikazebr commented Apr 13, 2021

@shirobachi try put the link like dependecy. Ill paste my requirement here.

requirement.txt

urllib3==1.25.11
git+https://github.com/c0j0s/notion-py@master#egg=notion
ppretty
aiofiles
jinja2
cachetools
peewee

So the pip install will clone it automatic

@shirobachi
Copy link
Author

I am losing my mind ..
It's not working but it Downloads some packages this time.. is anything I could else do?

@kamikazebr
Copy link

kamikazebr commented Apr 13, 2021

@shirobachi still Invalid Input error? Put some logs, pip install logs eg, and your requeriments.txt file

One thing u can try is remove notion dependency and run pip install and should get error from notion module not found, if not fired so u have another notion module somewhere.

@shirobachi
Copy link
Author

Have a look here: https://tinyl.io/3v5x

Is it matter if the requirement is in a different directory than py project? As I understood requirement has packages names that will be installed global, so it should not matter, but because I am not sure I prefer to write about that

Thanks for your help

@kamikazebr
Copy link

kamikazebr commented Apr 14, 2021

@shirobachi first all, u not need import the others things i put in requirements.txt, like ppretty, aiofiles, if you not using that, just the git+https stuff.

Second, that error not like related to your initial error, so you should look in other places to solve that issue.

BUT to get some LIGHT, check that link below

https://stackoverflow.com/a/47393778

It's look like circular dependency, check too with the samples here in GitHub if notion is working properly without use PageBlock, with it you will confirm if your dependency manager its working properly and you can go foward and solve others problems will appear.

I hope it can help you.

And let me know if it works and if the initial bug appears.

@SonGokussj4
Copy link

By default pip install downloads v0.0.28 and it raises the same error.

  • Uninstalling all pip packages pip freeze > uninstall.txt && pip uninstall -r uninstall.txt -y
  • Replacing notion with git+https://github.com/c0j0s/notion-py@master#egg=notion in requirements.txt
  • Installing everything back pip install -r requirements.txt

It works. Hurray!

If it's not working, try to isolate git+https://github.com/c0j0s/notion-py@master#egg=notion to for example notion.requirements.txt, uninstall everything and install one by one and then pip install -r notion.requirements.txt so it download it's own new dependencies.

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

3 participants