Clean Install Problems

460 views
Skip to first unread message

PMan

unread,
Oct 14, 2017, 3:55:08 AM10/14/17
to tryton
Greetings!

I'm trying to install 4.4.4 from source on Cloud Linux 7 with cagefs.

My environment:

Postgres 9.6, which I know is working, because it is the backend for another app on that server that has been running for months.

Virtual environment (VE): Python 3.6

I try to test install from the command line Inside active VE:

./bin/trytond -c /opt/Tryton/etc/trytond.conf

This gives me this error:

'trytond.backend', db_type)
ValueError: not enough values to unpack (expected 1, got 0)

Here are the relevant parts of trytond.conf:

[web]
# Settings for the web interface

# The IP/host and port number of the interface
# (Internal default: localhost:8000)
#
# Listen on all interfaces (IPv4)
listen = localhost:8000
#
# Listen on all interfaces (IPv4 and IPv6)
#listen = [::]:8000

# The hostname for this interface
#hostname =

# The root path to retrieve data for GET requests
root = /path/to/sao-4.4.4


[database]
# Database related settings

# The URI to connect to the SQL database (following RFC-3986)
# uri = database://username:password@host:port/
# (Internal default: sqlite:// (i.e. a local SQLite database))
#
# PostgreSQL via Unix domain sockets
# (e.g. PostgreSQL database running on the same machine (localhost))
#uri = postgresql://tryton:tryton@/
#
# PostgreSQL via TCP/IP
# (e.g. connecting to a PostgreSQL database running on a remote machine or
# by means of md5 authentication. Needs PostgreSQL to be configured to accept
# those connections (pg_hba.conf).)
uri = postgresql://username:passwordlocalhost:5432/

# The path to the directory where the Tryton Server stores files.
# The server must have write permissions to this directory.
# (Internal default: /var/lib/trytond)
path = /var/lib/trytond

# Shall available databases be listed in the client?
#list = True

# The number of retries of the Tryton Server when there are errors
# in a request to the database
#retry = 5

# The primary language, that is used to store entries in translatable
# fields into the database.
language = en_US


Is there a way to set db type in the config file?

Thanks in advance!

Cédric Krier

unread,
Oct 14, 2017, 4:40:06 AM10/14/17
to tryton
On 2017-10-13 17:28, PMan wrote:
> This gives me this error:
>
> 'trytond.backend', db_type)
> ValueError: not enough values to unpack (expected 1, got 0)
>

This is clearly a truncated error message.
We can not help with such partial information.


>
> Is there a way to set db type in the config file?
>

http://doc.tryton.org/4.4/trytond/doc/topics/configuration.html#uri

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

PMan

unread,
Oct 14, 2017, 9:20:07 PM10/14/17
to tryton
Sorry... Here is the complete error message:

(Tryton) root@host [/opt/Tryton]# ./bin/trytond -c /opt/Tryton/etc/trytond.conf
Traceback (most recent call last):
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/__init__.py", line 32, in get
'trytond.backend', db_type)
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./bin/trytond", line 4, in <module>
__import__('pkg_resources').run_script('trytond==4.4.4', 'trytond')
File "/opt/Tryton/lib/python3.6/site-packages/pkg_resources/__init__.py", line 743, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/Tryton/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1498, in run_script
exec(code, namespace, namespace)
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/EGG-INFO/scripts/trytond", line 24, in <module>
from trytond.application import app
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/application.py", line 8, in <module>
Pool.start()
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/pool.py", line 95, in start
register_classes()
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules/__init__.py", line 336, in register_classes
import trytond.ir
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/ir/__init__.py", line 4, in <module>
from .configuration import *
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/ir/configuration.py", line 3, in <module>
from ..model import ModelSQL, ModelSingleton, fields
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/model/__init__.py", line 3, in <module>
from .model import Model
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/model/model.py", line 8, in <module>
from trytond.model import fields
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/model/fields/__init__.py", line 4, in <module>
from .field import *
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/model/fields/field.py", line 20, in <module>
Database = backend.get('Database')
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/__init__.py", line 34, in get
raise exception
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/__init__.py", line 26, in get
__import__(modname)
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/postgresql/__init__.py", line 4, in <module>
from .database import *
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/postgresql/database.py", line 16, in <module>
from psycopg2 import connect, Binary
File "/opt/python36/lib/python3.6/site-packages/psycopg2-2.7.3.1-py3.6-linux-x86_64.egg/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /opt/python36/lib/python3.6/site-packages/psycopg2-2.7.3.1-py3.6-linux-x86_64.egg/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PQconninfo

Thank you.

Mark Shane Hayden

unread,
Oct 14, 2017, 11:17:20 PM10/14/17
to try...@googlegroups.com

On Oct 14, 2017 01:55, "PMan" <max...@gmail.com> wrote:
Greetings!

I'm trying to install 4.4.4 from source on Cloud Linux 7 with cagefs.

My environment:

Postgres 9.6, which I know is working, because it is the backend for another app on that server that has been running for months.

Virtual environment (VE): Python 3.6

I try to test install from the command line Inside active VE:

./bin/trytond -c /opt/Tryton/etc/trytond.conf

This gives me this error:

'trytond.backend', db_type)
ValueError: not enough values to unpack (expected 1, got 0)

This looks like an incorrectly specified database URI. The error message you sent later seems to show it knows it's a postgresql type database but the connection info was not supplied. See below...
^^^HERE^^^

Is this exactly how it is in your config file? The @ sign as missing so the parser can't unpack (separate) the credentials and the host:port

Should be username:password@localhost:5432

# The path to the directory where the Tryton Server stores files.
# The server must have write permissions to this directory.
# (Internal default: /var/lib/trytond)
path = /var/lib/trytond

# Shall available databases be listed in the client?
#list = True

# The number of retries of the Tryton Server when there are errors
# in a request to the database
#retry = 5

# The primary language, that is used to store entries in translatable
# fields into the database.
language = en_US


Is there a way to set db type in the config file?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/8c640812-3206-4681-a353-71eece762f64%40googlegroups.com.

Cédric Krier

unread,
Oct 15, 2017, 10:25:08 AM10/15/17
to tryton
psycopg2 is not correctly installed.
I suggest you to use the package of your distribution.

PMan

unread,
Oct 15, 2017, 10:40:06 AM10/15/17
to tryton
My mistake! When I replaced the real credentials with the generic username:password I left out the "@". In the config, it is db_name:username:password@localhost:5432 (I removed the trailing slash).

After removing the trailing slach, I still get the same error.

PMan

unread,
Oct 17, 2017, 3:10:06 AM10/17/17
to tryton
> After removing the trailing slash, I still get the same error.

Thank you!

I did "pip3 install psycopg2" (If I did a "yum install" it would use the system python 2.7). Now I get a different error:

./bin/trytond -c /opt/Tryton/etc/trytond.conf
Traceback (most recent call last):
File "/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/backend/__init__.py", line 32, in get
'trytond.backend', db_type)
ValueError: not enough values to unpack (expected 1, got 0)

ModuleNotFoundError: No module named 'trytond.backend.'

Thanks in advance,
Paul

PMan

unread,
Oct 17, 2017, 3:10:08 AM10/17/17
to tryton
On Sunday, October 15, 2017 at 10:40:06 AM UTC-4, PMan wrote:
I have confirmed that in the directory:
/opt/Tryton/lib/python3.6/site-packages/trytond-4.4.4-py3.6.egg/trytond/modules
and directory:
/opt/Tryton/trytond-4.4.4/trytond/modules
there is no module “trytond.backend”.
The Tryton/lib… directory contains the file: __init__.py and the directory: __pycache__ and nothing else. The Tryton/trytond-4.4.4… directory only contains __init__.py.

I installed trytond by downloading the source from http://www.tryton.org/download.html, checking the gpg signature, expanding the tarball in a python 3.6 virtual environment (called Tryton), cd’ing into the new directory, and doing: python setup.py install.

What am I missing?

Sergi Almacellas Abellana

unread,
Oct 17, 2017, 3:28:27 AM10/17/17
to try...@googlegroups.com
El 17/10/17 a les 03:27, PMan ha escrit:
The trytond/backend should contain a postgresql directory as the
postgresql backend is inlcuded by default.

Probably you have a typo on the database uri driver. If you are using
postgresql your uri should start with postgresql:

Hope it helps.

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

Cédric Krier

unread,
Oct 17, 2017, 3:30:07 AM10/17/17
to tryton
Your configuration does not define correctly a backend:
http://doc.tryton.org/4.4/trytond/doc/topics/configuration.html#uri
(Or the configuration file is not readable)


PS: Please cleanup your emails when answering, having to scroll so much
useless lines before finding your answer will discourage most of the
reader, see https://groups.tryton.org/netiquette

PMan

unread,
Oct 24, 2017, 4:15:08 PM10/24/17
to tryton
I specified PostgreSQL like this:

uri = PostgreSQL://username:'password'@localhost:5432

And now trytond starts.

Thank you very much!
Reply all
Reply to author
Forward
0 new messages