Websoft9 / docker-library

Docker Compose examples of selfhosted FOSS based on official image, just run it.
https://www.websoft9.com
Other
33 stars 17 forks source link

Bug for jupyterhub #662

Closed yuanssssss closed 1 week ago

yuanssssss commented 1 month ago

Describe the bug

use the the latest version can't login because of Invalid username or password. image

Bug source

System Environment

the inner image maker.

Application Version

latest

qiaofeng1227 commented 1 month ago

You can successfully install jupyterhub4.0, but jupyterhub latest or 5.1 error.

[E 2024-08-07 02:39:49.998 JupyterHub proxy:949] api_request to proxy failed: HTTP 403: Forbidden
[E 2024-08-07 02:39:49.998 JupyterHub app:3873]
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/app.py", line 3871, in launch_instance_async
        await self.start()
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/app.py", line 3658, in start
        await self.proxy.get_all_routes()
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/proxy.py", line 989, in get_all_routes
        resp = await self.api_request('', client=client)
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/proxy.py", line 953, in api_request
        result = await exponential_backoff(
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/utils.py", line 249, in exponential_backoff
        ret = await maybe_future(pass_func(*args, **kwargs))
      File "/usr/local/lib/python3.10/dist-packages/jupyterhub/proxy.py", line 938, in _wait_for_api_request
        return await client.fetch(req)
    tornado.httpclient.HTTPClientError: HTTP 403: Forbidden

02:39:50.198 [ConfigProxy] info: Proxying http://*:8000 to (no default)
02:39:50.200 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
02:39:50.201 [ConfigProxy] error: Uncaught Exception: listen EADDRINUSE: address already in use :::8000
02:39:50.202 [ConfigProxy] error: Error: listen EADDRINUSE: address already in use :::8000
chendelin1982 commented 1 month ago
[W 2024-08-12 06:48:40.721 JupyterHub auth:1374] PAM Authentication failed (admin@43.159.230.221): [PAM Error 7] Authentication failure
[W 2024-08-12 06:48:40.722 JupyterHub base:979] Failed login for admin
[I 2024-08-12 06:48:40.723 JupyterHub log:192] 200 POST /hub/login?next=%2Fhub%2F (@43.159.230.221) 3813.44ms
zhaojing1987 commented 2 weeks ago

官方文档

问题描述:用户不能登录 image

解决方案:

  1. 定义配置文件:src/jupyterhub_config.py 并配置如下:
    c.Authenticator.allow_all = True
    #c.Authenticator.allow_existing_users = True
    #c.LocalAuthenticator.create_system_users = True
  2. 挂载配置文件:
    volumes:
      - ./src/jupyterhub_config.py:/etc/jupyterhub/jupyterhub_config.py
  3. 修改jupyterhub启动方式,从配置文件启动
    command:
      - sh
      - -c 
      - |
          [ ! -d /usr/local/lib/python3.10/dist-packages/jupyterlab ] && pip install jupyterlab
          [ -z "`grep -w ^$$USERNAME /etc/passwd`" ] && useradd $$USERNAME -m && echo $$USERNAME:$$PASSWORD | chpasswd
          jupyterhub -f /etc/jupyterhub/jupyterhub_config.py      
chendelin1982 commented 1 week ago

fix