Skip to content

create_token.sh throws an error #314

Closed
@htc1977

Description

@htc1977

I tried to create a usertoken to mass import some documents and got this error on dockerized papermerge:3.0.2

root@dcd44b169514:/core_app# create_token.sh christian
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/auth_server_app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/auth_server_app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/auth_server_app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/auth_server_app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/auth_server_app/auth_server/cli/create_token.py", line 18, in cli
    user = get_user_by_username(db, username)
  File "/auth_server_app/auth_server/crud.py", line 27, in get_user_by_username
    db_user = session.scalars(stmt).one()
  File "/auth_server_app/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2420, in scalars
    return self._execute_internal(
  File "/auth_server_app/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2180, in _execute_internal
    conn = self._connection_for_bind(bind)
  File "/auth_server_app/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2047, in _connection_for_bind
    return trans._connection_for_bind(engine, execution_options)
  File "<string>", line 2, in _connection_for_bind
  File "/auth_server_app/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
    ret_value = fn(self, *arg, **kw)
  File "/auth_server_app/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1143, in _connection_for_bind
    conn = bind.connect()
AttributeError: 'Session' object has no attribute 'connect'. Did you mean: 'connection'?

any ideas, how to sail around this issue?

Thanks, Christian.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions