Cannot upload data to postgres
in the current main i cannot upload data to postgres.
i do as described in the README and use this file data-for-upload-in-minio.txt to upload some data to the bucket.
But it fails with a bug in the basic-demo-sheduler
.
i cannot pinpoint it it could arise from one of the following i guess:
- wrong db setup / wrong values in
.env(.example)
- wrong passing of arguments somewhere
- a bug in
datastore-lib
- a bug in
extractor
The following message is from the basic-demo-sheduler
, which print the output from the failed sub-process-command which starts the extractor.
ERROR:root:parsing failed. ctx={
'code': 1,
'err': 'INFO:root:load datastore
Connecting to sqlalchemy supported database "postgres"
Successfully connected sqlalchemy to "postgres"
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 320, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 884, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 486, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/impl.py", line 146, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/impl.py", line 143, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 381, in __init__
self.__connect()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 678, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 673, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/create.py", line 578, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py", line 598, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.9/dist-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "postgres" (141.65.125.235), port 5432 failed: FATAL: no such user
connection to server at "postgres" (141.65.125.235), port 5432 failed: FATAL: no such user
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/appuser/app/src/main.py", line 144, in <module>
cli()
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/appuser/app/src/main.py", line 83, in parse
datastore = load_datastore(target_uri, device_id)
File "/home/appuser/app/src/main.py", line 97, in load_datastore
datastore = tsm_datastore_lib.get_datastore(target_uri, device_id)
File "/usr/local/lib/python3.9/dist-packages/tsm_datastore_lib/__init__.py", line 19, in get_datastore
datastore = SqlAlchemyDatastore(uri, device_id)
File "/usr/local/lib/python3.9/dist-packages/tsm_datastore_lib/SqlAlchemyDatastore.py", line 38, in __init__
super().__init__(uri, device_id, schema)
File "/usr/local/lib/python3.9/dist-packages/tsm_datastore_lib/AbstractDatastore.py", line 15, in __init__
self.initiate_connection(schema)
File "/usr/local/lib/python3.9/dist-packages/tsm_datastore_lib/SqlAlchemyDatastore.py", line 59, in initiate_connection
self.sqla_thing = self.session.query(Thing).filter(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/query.py", line 2823, in first
return self.limit(1)._iter().first()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/query.py", line 2907, in _iter
result = self.session.execute(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 1711, in execute
conn = self._connection_for_bind(bind)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 1552, in _connection_for_bind
return self._transaction._connection_for_bind(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/orm/session.py", line 747, in _connection_for_bind
conn = bind.connect()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 3315, in connect
return self._connection_cls(self, close_with_result=close_with_result)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 96, in __init__
else engine.raw_connection()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 3394, in raw_connection
return self._wrap_pool_connect(self.pool.connect, _connection)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 3364, in _wrap_pool_connect
Connection._handle_dbapi_exception_noconnection(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 2198, in _handle_dbapi_exception_noconnection
util.raise_(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 320, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 884, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 486, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/impl.py", line 146, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/impl.py", line 143, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 381, in __init__
self.__connect()
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 678, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/pool/base.py", line 673, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/create.py", line 578, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py", line 598, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.9/dist-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "postgres" (141.65.125.235), port
5432 failed: FATAL: no such user
connection to server at "postgres" (141.65.125.235), port 5432 failed: FATAL: no such user
(Background on this error at: https://sqlalche.me/e/14/e3q8)
Pushed 0 new observations to database.
Close database session.',
'out': '',
'source': 'http://object-storage:9000/thedoors-057d8bba-40b3-11ec-a337-125e5a40a849/CRS01_Data1409010009.566_001105.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20221017%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221017T145025Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=c14db23b0c9ae55326f226d831994ed4d4f04821bed83d5b06c10eb282de996b',
'parser': 'CsvParser'
}