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

no websocket with: lc-serve deploy local skyagi-api #183

Open
j2l opened this issue Jul 6, 2023 · 3 comments
Open

no websocket with: lc-serve deploy local skyagi-api #183

j2l opened this issue Jul 6, 2023 · 3 comments

Comments

@j2l
Copy link

j2l commented Jul 6, 2023

Hello, I'm trying hard to make it work locally :)
HTTP seems to work:

──────────────────────────────────── 🎉 Flow is ready to serve! ────────────────────────────────────
╭────────────── 🔗 Endpoint ───────────────╮
│  ⛓      Protocol                   HTTP  │
│  🏠        Local           0.0.0.0:8080  │
│  🔒      Private     192.168.1.230:8080  │
│  🌍       Public       86.214.9.96:8080  │
╰──────────────────────────────────────────╯
╭─────────── 💎 HTTP extension ────────────╮
│  💬          Swagger UI        .../docs  │
│  📚               Redoc       .../redoc  │
╰──────────────────────────────────────────╯
Do you love open source? Help us improve Jina in just 1 minute and 30 seconds by taking our survey: 
https://10sw1tcpld4.typeform.com/jinasurveyfeb23?utm_source=jina(Set environment variable 
JINA_HIDE_SURVEY=1 to hide this message.)

But the client fails to connect:

python skyagi-api-client.py -f ../../examples/BigBangTheory/
Traceback (most recent call last):
  File "/home/pm/skyagi/skyagi/skyagi/skyagi-api/example/skyagi-api-client.py", line 88, in <module>
    asyncio.run(
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/pm/skyagi/skyagi/skyagi/skyagi-api/example/skyagi-api-client.py", line 52, in client
    async with session.ws_connect(f"{url}/{name}") as ws:
  File "/home/pm/.local/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/home/pm/.local/lib/python3.10/site-packages/aiohttp/client.py", line 795, in _ws_connect
    raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url=URL('ws://localhost:8080/runskyagi')

Indeed, I tried the websocket locally and get a 403 (forbidden)

Maybe I missed a step?

Using Ubuntu 22.04, skyagi from pip

@qizheng7
Copy link
Collaborator

qizheng7 commented Jul 6, 2023

@j2l
hmm...the client can connect to the server on my side...

(venv-skyai-release) qiz@docker-desktop:~/skyagi/skyagi-api/example$ python skyagi-api-client.py -f ../../examples/BigBangTheory/
Connected to ws://localhost:8080/runskyagi.

can you try to visit http://localhost:8080/docs in your browser? Want to know if the lc server is actually up or not.

Also status 403 means your client doesn't have the authorization to access the API. Is it something regarding your network setting?

@j2l
Copy link
Author

j2l commented Jul 17, 2023

Thank you @qizheng7
Sure, here's the result:
image
And http://0.0.0.0:8080/healthz returns status: "ok"

AFAIK, Ubuntu doesn't block websocket.

To help debug, is there any log with the server?

@j2l
Copy link
Author

j2l commented Jul 24, 2023

any news?

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

2 participants