Oxen-AI / Oxen

Oxen.ai's core rust library, server, and CLI
https://oxen.ai
Apache License 2.0
196 stars 11 forks source link

Call oxen-server api with python failed:actix_http::h1::dispatcher: stream error: request parse error: invalid Header provided #265

Closed NoahAmethyst closed 8 months ago

NoahAmethyst commented 8 months ago

I want to create a remote repo in my own oxen server. Here's my python code: remote_repo = oxen.RemoteRepo(repo_id, local_host, revision='origin') remote_repo.create(True, True)

But i got this error in my server logger: 2024-03-04T07:02:53.427 [ERROR] - actix_http::h1::dispatcher: stream error: request parse error: invalid Header provided

Here's my python console error logger: Traceback (most recent call last): File "/Users/amethyst/oxen-research/oxen-research/main.py", line 27, in <module> remote_repo.create(True, True) File "/Users/amethyst/oxen-research/oxen-research/.venv/lib/python3.10/site-packages/oxen/remote_repo.py", line 126, in create self._repo.create(empty, is_public) ValueError: Create repository could not connect to https://192.168.0.80:3001/api/repos. Make sure you have the correct server and that it is running. I have no idea how to solve it.

gschoeni commented 8 months ago

@NoahAmethyst good find - the issue was with http vs https. We naively defaulted https for everything besides localhost. There is now a new parameter when instantiating a RemoteRepo for scheme= in the python lib version > 0.12.0.

Also revision should be a branch name or commit id, not the remote name.

pip install --upgrade oxenai
remote_repo = oxen.RemoteRepo(repo_id, "192.168.0.80:3001", revision='main', scheme="http")
remote_repo.create(True, True)

Hopefully this fixes it for you!