JupyterHub + Docker spawner

I’m trying to set up a JupyterHub with a docker – spawner. After I log in into my JupyterHub I get the following error:

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.

My JupyterHub config looks as follows:

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

and this is the content of my 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"]

How can I fix this error?

Thanks for the help in advance!

Source: Docker Questions