Cannot Connect to PostgresSQL DB


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/", line 599, in run
    if not common.test_server_version(host, port):
  File "/usr/lib/python2.7/dist-packages/tryton/common/", line 231, in test_server_version
    version = rpc.server_version(host, port)
  File "/usr/lib/python2.7/dist-packages/tryton/", line 67, in server_version
    result = connection.common.server.version(None, None)
  File "/usr/lib/python2.7/", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/dist-packages/tryton/", line 283, in __request
  File "/usr/lib/python2.7/", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/", line 1313, in single_request
    response = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/", line 1136, in getresponse
  File "/usr/lib/python2.7/", line 453, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/", 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/", 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.