Cannot Connect to PostgresSQL DB

Hi,

After starting the daemon trytond and the client tryton and then filling the form to connect to the DB, I get an Application Error BadStatusLine:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/tryton/gui/window/dblogin.py", line 599, in run
    if not common.test_server_version(host, port):
  File "/usr/lib/python2.7/dist-packages/tryton/common/common.py", line 231, in test_server_version
    version = rpc.server_version(host, port)
  File "/usr/lib/python2.7/dist-packages/tryton/rpc.py", line 67, in server_version
    result = connection.common.server.version(None, None)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 283, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1313, in single_request
    response = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1136, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 417, in _read_status
    raise BadStatusLine(line)
BadStatusLine: ''

Any hint?

It seems an issue with the server. You should check your server logs not the client ones.

If you paste them here we can give a better advice.

Hi @pokoli, I cannot see any logs from my Linux console, even with -v there is no logs on the server console.
From the postgresql logs in /var/log/postgresql/postgresql-9.5-main.log, I can see:

[unknown]@[unknown] LOG:  invalid length of startup packet

You should start the server with the --verbose option to see the logs on the standard output of the running terminal.

Aditionaly you can use a more advanced logging configuration as explained on the logging section

venvs/ytryton-Lrmto7Kr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: FATAL:  Peer authentication failed for user "tryton_admin"

Somehow, I cannot give a correct password to my Postgresql, even I only know one password and created a new user and database twice.