jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
623 stars 222 forks source link

Connection info is not returned from the launchers in Python 3 envs #239

Closed charlie718y closed 6 years ago

charlie718y commented 6 years ago

Presetup: -Start 1 Spark Master and 1 Spark Slave on the same host -Install Jupyter env with Anaconda3 -Enable nb2kg for Jupyter

Steps to reproduce: 1) Start EG with ip=0.0.0.0 2) Start Jupyter 3) Create Spark 2.1 - Python (....) kernel 4) Examine EG log,

Exception on POST,

File "/var/playground/Anaconda/lib/python3.6/site-packages/enterprise_gateway/services/processproxies/processproxy.py", line 483, in receive_connection_info raise e File "/var/playground/Anaconda/lib/python3.6/site-packages/enterprise_gateway/services/processproxies/processproxy.py", line 473, in receive_connection_info data = data + buffer # append what we received until we get no more... TypeError: must be str, not bytes

kevin-bates commented 6 years ago

Thanks Charlie! The issue is because EG is not decoding the payload returned from the launcher (for initial connection info).

We've confirmed the 0.7.0 release can be easily patched by changing processproxy.py line 473 from:

data = data + buffer to data = data + buffer.decode(encoding='utf-8')