bbc / brave

Basic Real-time AV Editor - allowing you to preview, mix, and route live audio and video streams on the cloud
Apache License 2.0
654 stars 148 forks source link

Websocket issue #6

Closed nitrat7 closed 5 years ago

nitrat7 commented 5 years ago

Hi

I see in Server-Log

ERROR:root:Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/sanic/app.py", line 603, in handle_request response = await response File "/usr/lib/python3.6/site-packages/sanic/app.py", line 295, in websocket_handler ws = await protocol.websocket_handshake(request, subprotocols) File "/usr/lib/python3.6/site-packages/sanic/websocket.py", line 69, in websocket_handshake key = handshake.check_request(get_header) File "/usr/lib64/python3.6/site-packages/websockets/handshake.py", line 82, in check_request [parse_connection(value) for value in headers.get_all('Connection')], [] AttributeError: 'function' object has no attribute 'get_all'

and on website I see issues, creating WS-Connection. [Debug] Showing this top – "warning" – " message:" – "Server connection lost, retrying..." (index.js, line 53) [Error] WebSocket connection to 'ws://18.184.174.7:5000/socket' failed: Unexpected response code: 500

moschopsuk commented 5 years ago

Hi there,

We have ran into issues before with the version of sanic that is being installed. Did you use pip or pip3.6`?

Could you also post the the output of which ever version of pip you installed pip freeze so we can see all the versions of packages it installed.

Thanks.

nitrat7 commented 5 years ago

Hi, I used pip3.6 - as mentioned in your excellent installation documentation for CentOS 7

[centos@ip-172-31-36-216 ~]$ pip3.6 freeze
aiofiles==0.4.0
atomicwrites==1.2.1
attrs==18.2.0
gbulb==0.6.1
httptools==0.0.11
more-itertools==4.3.0
multidict==4.4.2
pluggy==0.8.0
psutil==5.4.8
py==1.7.0
pycairo==1.18.0
PyGObject==3.30.1
pytest==3.10.0
PyYAML==3.13
sanic==0.8.3
six==1.11.0
ujson==1.35
uvloop==0.11.3
websockets==7.0
[centos@ip-172-31-36-216 ~]$ sudo pip3.6 -V
pip 18.1 from /usr/lib/python3.6/site-packages/pip (python 3.6)
moschopsuk commented 5 years ago

Hi,

Part of the reason this is occurring is we've not supplied a requirements.txt file to lock down the versions of pip modules.

It looks like a few of your packages are newer than those we developed against could you please downgrade your copy of websockets to 5.0.

For reference here is the output of my pip freeze.

aiofiles==0.4.0
awscli==1.16.44
botocore==1.12.34
colorama==0.3.9
docutils==0.14
httptools==0.0.11
jmespath==0.9.3
multidict==4.4.2
psutil==5.4.7
pyasn1==0.4.4
pycairo==1.18.0
PyGObject==3.30.1
python-dateutil==2.7.5
PyYAML==3.13
rsa==3.4.2
s3transfer==0.1.13
sanic==0.8.3
six==1.11.0
ujson==1.35
urllib3==1.24
uvloop==0.11.2
websockets==5.0.1

We'll get a PR with a requirments.txt sorted to help reduce this problem from occurring.

nitrat7 commented 5 years ago

thanks, downgrading to websockets==5.0.1 fixed this issue.

I highly favor having requirements.txt 👍