Closed EuPhobos closed 3 years ago
The full output: ` $ python3 ./pietest.py Traceback (most recent call last): File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2338, in _wrap_pool_connect return fn() File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 364, in connect return _ConnectionFairy._checkout(self) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 778, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 495, in checkout rec = pool._do_get() File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 140, in _do_get self._dec_overflow() File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 69, in exit exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x8664.egg/sqlalchemy/util/compat.py", line 182, in raise raise exception File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/impl.py", line 137, in _do_get return self._create_connection() File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 309, in _create_connection return _ConnectionRecord(self) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 440, in init self.connect(first_connect_check=True) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 661, in __connect pool.logger.debug("Error on connect(): %s", e) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py", line 69, in exit exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x8664.egg/sqlalchemy/util/compat.py", line 182, in raise raise exception File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/pool/base.py", line 656, in connect connection = pool._invoke_creator(self) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 114, in connect return dialect.connect(*cargs, *cparams) File "/usr/local/lib/python3/dist-packages/SQLAlchemy-1.3.19-py3.7-linux-x86_64.egg/sqlalchemy/engine/default.py", line 493, in connect return self.dbapi.connect(cargs, cparams) File "/home/prot/.local/lib/python3.7/site-packages/psycopg2/init.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, kwasync) psycopg2.OperationalError: FATAL: no pg_hba.conf entry for host "10.50.50.1", user "prot", database "postgres", SSL on FATAL: no pg_hba.conf entry for host "10.50.50.1", user "prot", database "postgres", SSL off
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./pietest.py", line 3, in
(Background on this error at: http://sqlalche.me/e/13/e3q8) `
Sorry, haven't seen your issue till today. I think it is an issue with your postgres configuration if I read the error properly: no pg_hba.conf entry for host "10.50.50.1", user "prot", database "postgres", SSL off
Sorry, haven't seen your issue till today. I think it is an issue with your postgres configuration if I read the error properly: no pg_hba.conf entry for host "10.50.50.1", user "prot", database "postgres", SSL off
But i do not need database "postgres", i specified the database in the URI as "test" Besides, I have no problems connecting from the same host via the CLI psql -d test -U prot -h 10.50.50.12
Ok sorry for misunderstanding your issue. Have a look at #91 for the solution
@sdementen yes, in the first post of this issue i say about #91 This solution do not work for me.
Sorry bis for not reading properly :-( You can pass the argument check_exists=False in open_book as it will skip the test for existence that is causing the root issue
check_exists=False
Oh, thanks! It's work, finally My bad, i missed this solution in #91
Good! Normally, the bug has to be fixed in the sqlalchemy-utils package so I close your issue
I'm trying simple script:
$ cat pietest.py import piecash book = piecash.open_book(uri_conn="postgres://prot:pass123@10.50.50.12/test") for account in book.accounts: print(account)
The database is "test" but i have error:FATAL: no pg_hba.conf entry for host "10.50.50.1", user "prot", database "postgres", SSL off
Then when im trying update pip packages, i get this:
piecash 1.1.2 has requirement SQLAlchemy-Utils!=0.36.8, but you'll have sqlalchemy-utils 0.36.8 which is incompatible.
I also check:
$ grep SQLAlchemy requirements-dev.txt SQLAlchemy==1.3.20 SQLAlchemy-Utils==0.36.8
in requirements-dev.txt - SQLAlchemy-Utils==0.36.8 Then i found closed similar issue: https://github.com/sdementen/piecash/issues/91 I downgrade SQLAlchemy-Utils to 0.36.7 but still no luck, same error about database "postgres", but not "test" as URI set..