Skip to content

Cant login anymore: password cannot be longer than 72 bytes #19317

@Y0ngg4n

Description

@Y0ngg4n

Description

I can not login into my account anymore. My password is very long.

Steps to reproduce

  • try to login into my synapse instance

Homeserver

matrixchat.org

Synapse Version

v1.140.0

Installation Method

Docker (matrixdotorg/synapse)

Database

singe postgresql server

Workers

Single process

Platform

Kubernetes deployment

Configuration

No response

Relevant log output

ValueError: password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72])
2025-12-20 16:54:52,260 - synapse.http.server - 151 - ERROR - POST-114 - Failed handle request via 'LoginRestServlet': <XForwardedForRequest at 0x7ff25e3568d0 method='POST' uri='/_matrix/client/v3/login' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/synapse/http/server.py", line 339, in _async_render_wrapper
    callback_return = await self._async_render(request)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/http/server.py", line 582, in _async_render
    callback_return = await raw_callback_return
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/rest/client/login.py", line 262, in on_POST
    result = await self._do_other_login(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/rest/client/login.py", line 357, in _do_other_login
    canonical_user_id, callback = await self.auth_handler.validate_login(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/handlers/auth.py", line 1288, in validate_login
    return await self._validate_userid_login(username, login_submission)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/handlers/auth.py", line 1377, in _validate_userid_login
    canonical_user_id = await self._check_local_password(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/handlers/auth.py", line 1437, in _check_local_password
    result = await self.validate_hash(password, password_hash)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/handlers/auth.py", line 1719, in validate_hash
    return await defer_to_thread(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 1187, in __iter__
    yield self
  File "/usr/local/lib/python3.12/site-packages/twisted/python/threadpool.py", line 269, in inContext
    result = inContext.theWork()  # type: ignore[attr-defined]
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/twisted/python/threadpool.py", line 285, in <lambda>
    inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/logging/context.py", line 1169, in g
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synapse/handlers/auth.py", line 1710, in _do_validate_hash
    return bcrypt.checkpw(
           ^^^^^^^^^^^^^^^
ValueError: password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72])

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions