plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
187 stars 50 forks source link

Websocket connection failed #1170

Closed jianaijun closed 2 years ago

jianaijun commented 2 years ago

Follow the documentation , Websocket connection failed.

serve log:

ERROR:    ASGI callable returned without sending handshake.
INFO:     connection open
INFO:     connection closed

client log:

WebSocket connection to 'ws://localhost:8080/db/container/@conversate?ws_token=eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0.mLsVeFv0vrF2SHDkX2OmhoSfEzusd5hxLPzmvhQABflvHxJSrLHfzkd3lZDAubz1DZBfpgV2-J1fV2Le4uFriatQ1p9nNarq.ioVfswfbQtch_UR5VDzh7Q.0yak2YbwU063fqgzbZiR301F-owqnCPNxGKpBzjIO5MIvcm70SXL94DDdlYAfLCHiyn6blLR4VDbcHDknVsZC5njruza02t2d81Th3hJU5m7OiGvZ6YiC4btx37IQ1gDnezYjt-1s8h2ud4kQGW1eZHYOvMeQG0tfWVzyFk4E5CYNNLNcalYzjLPJiHmDf6rDTxBlUsyekgYJt-dct_4TH80eRg8eZ2tCPgS2VL5I7BAnOhm0VQW4wTl45Fm2nOk8w-8XEkdrQKUJEPi4JJtDg._jAEfx5Yp9pk2bV0pPDFupg3-DT8BB-clUGgdIYvQHU' failed:

masipcat commented 2 years ago

Are you running the code from this repo https://github.com/guillotinaweb/guillotina_chat ? Are the server logs truncated? It's weird that the call to @conversate it's not there. Also, can you check that the python library websockets it's installed? If it's not, maybe you need to install uvicorn with extras: uvicorn[standard]

jianaijun commented 2 years ago

thanks masipcat, pip install uvicorn[standard] issue has been resolved.

masipcat commented 2 years ago

You're welcome :) But I still wonder why the uvicorn[standard] fixed the problem because the dependency websockets is listed in the setup.py. https://github.com/plone/guillotina/blob/ee38eea00861adf9072c4d291ec3fa9ac7d39017/setup.py#L59

Can you get a diff of the dependencies before and after installing the extras?

jianaijun commented 2 years ago

It may be that the websockets were accidentally deleted. There is no problem with a clean reinstall.