问题描述
我正在尝试使用docker-spawner来建立JupyterHub。登录到JupyterHub后,出现以下错误:
500 : Internal Server Error
Error in Authenticator.pre_spawn_start: ChunkedEncodingError ('Connection broken: IncompleteRead(0 bytes read)',IncompleteRead(0 bytes read))
You can try restarting your server from the home page.
我的JupyterHub配置如下:
from jupyterhub.auth import Authenticator
class DictionaryAuthenticator(Authenticator):
passwords = {'max':'123'}
async def authenticate(self,handler,data):
if self.passwords.get(data['username']) == data['password']:
return data['username']
# docker image tag in the docker registry
c.DockerSpawner.image = 'jupyterhub/singleuser:latest'
# listen on all interfaces
c.DockerSpawner.host_ip = "0.0.0.0"
c.DockerSpawner.network_name = 'jupyterhub'
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.JupyterHub.authenticator_class = DictionaryAuthenticator
这是我的Dockerfile的内容:
FROM python:3.7
RUN pip3 install \
jupyterhub==1.0.0 \
'notebook>=5.0,<=6.0'
# create a user,since we don't want to run as root
RUN useradd -m max
ENV HOME=/home/max
workdir $HOME
USER max
CMD ["jupyterhub-singleuser"]
谢谢您的帮助!
解决方法
我能够解决问题。在我看来,Docker-Spawner仅适用于Docker 2.3.0.5版(MacOS)。
如果有人遇到相同的问题->只需降级。