Res.user cannot be loaded during login on test environment

When I want to try something out, I usually copy the database over to a different server, where I run a second instance of tryton. So far, this has worked without any issues.

But now it cannot locate the module res.user when trying to login:

27 140671699875712 [2026-10-20 10:02:26,874] ERROR trytond.wsgi Exception when processing <JSONRequest 172.18.0.1 'http://tryton.passerro.de/tryton_demo/session/login' [POST] common.db.login>
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/dist-packages/trytond/wsgi.py", line 125, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/usr/local/lib/python3.13/dist-packages/trytond/protocols/dispatcher.py", line 79, in login_w_cookies
    user_id, token, bus_url_host = login(
                                   ~~~~~^
        request, database_name, *request.json['params'])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/dist-packages/trytond/protocols/dispatcher.py", line 52, in login
    session = security.login(
        database_name, user, parameters, context=context)
  File "/usr/local/lib/python3.13/dist-packages/trytond/security.py", line 49, in login
    User = pool.get('res.user')
  File "/usr/local/lib/python3.13/dist-packages/trytond/pool.py", line 173, in get
    return self._pool[type][name]
           ~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'res.user'
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/dist-packages/trytond/wsgi.py", line 125, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/usr/local/lib/python3.13/dist-packages/trytond/protocols/dispatcher.py", line 79, in login_w_cookies
    user_id, token, bus_url_host = login(
                                   ~~~~~^
        request, database_name, *request.json['params'])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/dist-packages/trytond/protocols/dispatcher.py", line 52, in login
    session = security.login(
        database_name, user, parameters, context=context)
  File "/usr/local/lib/python3.13/dist-packages/trytond/security.py", line 49, in login
    User = pool.get('res.user')
  File "/usr/local/lib/python3.13/dist-packages/trytond/pool.py", line 173, in get
    return self._pool[type][name]
           ~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'res.user'

Interestingly, calling Pool().get("res.user") works fine from trytond-console.

Any idea how this could be fixed?

See login with tryton-client after update 8.2 not possible (#15185) · Issues · Tryton / Tryton · GitLab

Thank, setting TRYTOND_DATABASE_NAME fixed it just fine.

No it is TRYTOND_DATABASE_NAMES

That is what I meant, I lost the S when writing the comment :wink: