jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.04k stars 341 forks source link

Error 500 on trying to access change-password page #691

Closed mangecoeur closed 3 years ago

mangecoeur commented 3 years ago

Bug description

I'm testing out TLJH in a VM, installed with only default options. I added a user, then tried changing the user password at /hub/auth/change-password . I get a 500 internal server error

Expected behaviour

Reach the password change page

Actual behaviour

Logs (journalctl) show this error:

Jun 11 10:58:22 primary python3[22545]: [E 2021-06-11 10:58:22.440 JupyterHub web:1789] Uncaught exception GET /hub/auth/change-password (192.168.64.1)
Jun 11 10:58:22 primary python3[22545]:     HTTPServerRequest(protocol='http', host='192.168.64.3', method='GET', uri='/hub/auth/change-password', versio>
Jun 11 10:58:22 primary python3[22545]:     Traceback (most recent call last):
Jun 11 10:58:22 primary python3[22545]:       File "/opt/tljh/hub/lib/python3.8/site-packages/tornado/web.py", line 1704, in _execute
Jun 11 10:58:22 primary python3[22545]:         result = await result
Jun 11 10:58:22 primary python3[22545]:       File "/opt/tljh/hub/lib/python3.8/site-packages/firstuseauthenticator/firstuseauthenticator.py", line 64, i>
Jun 11 10:58:22 primary python3[22545]:         self.finish(html)
Jun 11 10:58:22 primary python3[22545]:       File "/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/handlers/base.py", line 172, in finish
Jun 11 10:58:22 primary python3[22545]:         super().finish(*args, **kwargs)
Jun 11 10:58:22 primary python3[22545]:       File "/opt/tljh/hub/lib/python3.8/site-packages/tornado/web.py", line 1127, in finish
Jun 11 10:58:22 primary python3[22545]:         self.write(chunk)
Jun 11 10:58:22 primary python3[22545]:       File "/opt/tljh/hub/lib/python3.8/site-packages/tornado/web.py", line 841, in write
Jun 11 10:58:22 primary python3[22545]:         raise TypeError(message)
Jun 11 10:58:22 primary python3[22545]:     TypeError: write() only accepts bytes, unicode, and dict objects
Jun 11 10:58:22 primary python3[22545]:     
Jun 11 10:58:22 primary python3[22545]: [E 2021-06-11 10:58:22.445 JupyterHub log:181] {
Jun 11 10:58:22 primary python3[22545]:       "Host": "192.168.64.3",
Jun 11 10:58:22 primary python3[22545]:       "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0",
Jun 11 10:58:22 primary python3[22545]:       "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
Jun 11 10:58:22 primary python3[22545]:       "Accept-Encoding": "gzip, deflate",
Jun 11 10:58:22 primary python3[22545]:       "Accept-Language": "en-US,en;q=0.5",
Jun 11 10:58:22 primary python3[22545]:       "Cookie": "jupyterhub-hub-login=[secret]; jupyterhub-session-id=[secret]; _xsrf=[secret]",
Jun 11 10:58:22 primary python3[22545]:       "Upgrade-Insecure-Requests": "1",
Jun 11 10:58:22 primary python3[22545]:       "X-Forwarded-For": "192.168.64.1",
Jun 11 10:58:22 primary python3[22545]:       "X-Forwarded-Host": "192.168.64.3",
Jun 11 10:58:22 primary python3[22545]:       "X-Forwarded-Port": "80",
Jun 11 10:58:22 primary python3[22545]:       "X-Forwarded-Proto": "http",
Jun 11 10:58:22 primary python3[22545]:       "X-Forwarded-Server": "primary",
Jun 11 10:58:22 primary python3[22545]:       "X-Real-Ip": "192.168.64.1"
Jun 11 10:58:22 primary python3[22545]:     }
Jun 11 10:58:22 primary python3[22545]: [E 2021-06-11 10:58:22.446 JupyterHub log:189] 500 GET /hub/auth/change-password (testuser@192.168.64.1) 56.73ms

Your personal set up

TLJH installed according to instructions, no customisations made.

swill commented 3 years ago

I opened a similar bug within the First Use Authenticator: https://github.com/jupyterhub/firstuseauthenticator/issues/36

consideRatio commented 3 years ago

@swill thanks for a very thoroughly documented issue and tracking this down so clearly! This has been resolved in firstuseauthenticator. A release should be made and we should upgrade that package in TLJH. This is now represented by #738.