AttributeError: ‘Transaction’ object has no attribute ‘_datamanagers’

As I use docker,
I tried to input
docker run --rm -ti tryton/tryton trytond-console -d tryton_database

There is this error returned :

connection to “tryton_database” failed
Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py”, line 229, in new
inst._connpool = ThreadedConnectionPool(
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 161, in init
AbstractConnectionPool.init(
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 59, in init
self._connect()
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 63, in _connect
conn = psycopg2.connect(*self._args, **self._kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: could not translate host name “postgres” to address: Name or service not known

Traceback (most recent call last):
File “/usr/local/lib/python3.11/dist-packages/trytond/transaction.py”, line 179, in start
database = backend.Database(database_name).connect()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py”, line 229, in new
inst._connpool = ThreadedConnectionPool(
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 161, in init
AbstractConnectionPool.init(
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 59, in init
self._connect()
File “/usr/lib/python3/dist-packages/psycopg2/pool.py”, line 63, in _connect
conn = psycopg2.connect(*self._args, **self._kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/psycopg2/init.py”, line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: could not translate host name “postgres” to address: Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/trytond-console”, line 30, in
console.run(options)
File “/usr/local/lib/python3.11/dist-packages/trytond/console.py”, line 45, in run
with Transaction().start(db_name, 0, readonly=True):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/dist-packages/trytond/transaction.py”, line 218, in start
self.stop(False)
File “/usr/local/lib/python3.11/dist-packages/trytond/transaction.py”, line 237, in stop
self.rollback()
File “/usr/local/lib/python3.11/dist-packages/trytond/transaction.py”, line 355, in rollback
for datamanager in self._datamanagers:
^^^^^^^^^^^^^^^^^^
AttributeError: ‘Transaction’ object has no attribute ‘_datamanagers’

Can somebody help me please ?

psycopg2.OperationalError: could not translate host name “postgres”

You seem to not have link your instance with the postgres database with --link tryton-postgres:postgres like in https://hub.docker.com/r/tryton/tryton

Hi,
Thanks for your fast answer :pray:
I modified the command as so :

docker run --network tryton_network --link tryton_postgres:postgres -e DB_PASSWORD=XXXXXXX --rm -ti tryton/tryton trytond-console -d tryton_database

Now Powershell displays this :

/usr/lib/python3/dist-packages/passlib/utils/init.py:854: DeprecationWarning: ‘crypt’ is deprecated and slated for removal in Python 3.13
from crypt import crypt as _crypt
:1049: ImportWarning: PluginImportFixer.find_spec() not found; falling back to find_module()
/usr/lib/python3/dist-packages/zeep/utils.py:1: DeprecationWarning: ‘cgi’ is deprecated and slated for removal in Python 3.13
import cgi
/usr/local/lib/python3.11/dist-packages/braintree/dispute.py:83: DeprecationWarning: Use ProtectionLevel enum instead
warnings.warn(“Use ProtectionLevel enum instead”, DeprecationWarning)
/usr/local/lib/python3.11/dist-packages/braintree/search.py:79: DeprecationWarning: Use protection_level parameter instead
warnings.warn(“Use protection_level parameter instead”, DeprecationWarning)
:1049: ImportWarning: PluginImportFixer.find_spec() not found; falling back to find_module()

Then the cursor blinks and I can type but it doesn’t seem to react.

Am I doing this right please ?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.