Install trytond 3.6.8

Hello,

I am installing trytond 3.6.8 with python 2.7.18 and postgresql 9.4 because I am moving server.
Postgresql 9.4 has been installed with old database successfully.
But I have trouble in installing 3.6.8.

Let me explain what I did so far here.

  1. Install 3.6.8 by using pip install tryton==3.6.8
  2. Create the trytond.conf file
    uri = postgresql://:@localhost:5432/
    path = C:\Users<username><location><of_your><install>
  3. Install trytond-account-invoice, trytond-account-payment, trytond-account-statement

Now I have following error when running server with this command.

python trytond -c ./trytond.conf -d herington

Traceback (most recent call last):
  File "\site-packages\trytond\protocols\jsonrpc.py", line 162, in _marshaled_dispatch
    response['result'] = dispatch_method(method, params)
  File "\site-packages\trytond\protocols\jsonrpc.py", line 191, in _dispatch
    res = dispatch(*args)
  File "\site-packages\trytond\protocols\dispatcher.py", line 41, in dispatch
    res = security.login(database_name, user, session)
  File "\site-packages\trytond\security.py", line 26, in login
    user_id = User.get_login(loginname, password)
  File "\site-packages\trytond\res\user.py", line 478, in get_login
    LoginAttempt.add(login)
  File "\site-packages\trytond\res\user.py", line 563, in wrapper
    return func(cls, login[:cls.login.size], *args, **kwargs)
  File "\site-packages\trytond\res\user.py", line 572, in add
    cls.create([{'login': login}])
  File "\site-packages\trytond\model\modelsql.py", line 447, in create
    [insert_values], [table.id]))
  File "\site-packages\trytond\backend\postgresql\database.py", line 324, in execute
    return self.cursor.execute(sql, params)
SyntaxError: syntax error at or near "AS"
LINE 1: INSERT INTO "res_user_login_attempt" AS "a" ("create_uid", "...

I guess it might be because of database configuration.
Unfortunately, I don’t have trytond-admin in 3.6.8 version.

Questions

  1. How to solve this problem? How to initiate the database in old version?
  2. Can I use higher version with older version’s database?

Thanks

On older versions tryton-admin comands was part of trytond commandline. You can update the database from there if needed.

No, you must use the version from same series.

It seems the problem is caused because you are using an “AS” alias when creating a query. Maybe you should use and older version of python-sql to avoid generating such cause. Note that the query which is failing is the one which records the logging attempt on the database, so it does not seem related to any database update missing.