Installation Ubuntu 14.04 Error after initializing database

106 views
Skip to first unread message

Bijjou

unread,
Jan 5, 2017, 7:55:05 AM1/5/17
to tryton
Hi,

I am trying to install tryton for a while now but I get an error when initializing the database. I tried installing tryton on version 4.3(trunk), 4.2 and 4.0.
Wenn I execute this code:

trytond-admin -c trytond.conf -d test123 --all

Then I get following error:

Traceback (most recent call last):
File "trytond/bin/trytond-admin", line 21, in <module>
admin.run(options)
File "/home/vagrant/server/trytond/
trytond/admin.py", line 38, in run
transaction.connection.cursor(
) as cursor: AttributeError: exit


When I create the database via the client on the gui I get the same error on the server and on the client I get additionally following error:

Can't create the database caused by an unknown error.

The database I created via the client is being created in postgres but the initialization of the database in tryton is not working.

I tried to downgrade python 2.7 to python 2.6 via pythonbrew due to following ticket I found:

https://code.djangoproject.com/ticket/17671

Then I tried to install python-sql version 0.4 instead of python-sql version 0.8 which I found on following post:


https://groups.google.com/forum/#!topic/tryton/ZDMJ-Yv4TV8


I also tried to install all packages on older versions just as described in the prerequsities of tryton installation in the tryton documentation.
But that didn't make any changes...


This is my whole installation process (Ubuntu 14.04 Vagrant on OS x):

sudo apt-get install python-pip

sudo apt-get install postgresql

sudo passwd postgres

su - postgres -c "createuser --createdb --no-createrole --no-superuser --pwprompt tryton"


sudo apt-get install python-psycopg2  python-lxml python-dateutil python-relatorio python-polib python-ldap3 python-webdav python-vobject python-tz python-stdnum python-vatnumber python-werkzeug python-cairo python-pycha


sudo pip install python-sql simpleeval wrapt cached-property


sudo apt-get install mercurial mercurial-nested


hg clone -u 4.0 http://hg.tryton.org/trytond


python -c 'import getpass,crypt,random,string; print crypt.crypt(getpass.getpass(), "".join(random.sample(string.ascii_letters + string.digits, 8)))'


python -c 'import 
getpass,crypt,random,string; print crypt.crypt(getpass.getpass(), 
"".join(random.sample(string.ascii_letters + string.digits, 8)))'


I store the password appearing on the prompt and I will later add it in the trytond.conf file:


sudo vim trytond.conf


sudo vim trytond.conf


I insert following in trytond.conf:



[web]
# remarque : [web] est à remplacer par [jsonrpc] en 3.8
listen = *:8000
[database]
uri = postgresql://tryton:PASSWORD_FROM_TRYTON_ROLE@localhost:5432/
[session]
super_pwd =<PASSWORD, WHICH I STORED>

sudo vim trytond.conf


Next I create a database on postgresql and I name it test123:

su postgres

psql

sudo vim trytond.conf


Then in the postgres console:

CREATE DATABASE test123 OWNER tryton;

\q

sudo vim trytond.conf


Now I initialize the database in tryton:

trytond-admin -c trytond.conf -d test123 --all

# HERE I GET MY ERROR ...

sudo vim trytond.conf


Then I start the server:


trytond/bin/trytond -c trytond.conf -v

sudo vim trytond.conf


On Serverside I dont get any errors and Client can also connect to server but I cant create database ...

I can also post my installation process where I downgrade python to 2.6 and so on ...

I hope someone can help me in this issue!


Best regards

Bijjou

Bijjou

unread,
Jan 5, 2017, 8:15:05 AM1/5/17
to tryton

Sergi Almacellas Abellana

unread,
Jan 7, 2017, 6:06:11 AM1/7/17
to try...@googlegroups.com
El 05/01/17 a les 13:49, 'Bijjou' via tryton ha escrit:
> Hi,
>
> I am trying to install tryton for a while now but I get an error when
> initializing the database. I tried installing tryton on version
> 4.3(trunk), 4.2 and 4.0.
> Wenn I execute this code:
>
> /*//*/trytond-admin -c trytond.conf -d test123 --all
>
> /*//*/Then I get following error:
>
> *Traceback (most recent call last):
> File "trytond/bin/trytond-admin", line 21, in <module>
> admin.run(options)
> File "/home/vagrant/server/trytond/*
>
> *trytond/admin.py <http://admin.py>", line 38, in run
> transaction.connection.cursor(**) as cursor: AttributeError: exit*
IIRC this error whas due to executing and old driver version of the
database backend. So you must update psycopg2 if using postgresql.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Bijjou

unread,
Jan 10, 2017, 5:50:04 PM1/10/17
to tryton
Thanks! That worked for me!


Adrian Herrera Montenegro

unread,
May 10, 2017, 5:10:08 PM5/10/17
to tryton
I got the same error, which version of psycopg2 you had installed before and after?
Reply all
Reply to author
Forward
0 new messages