Define the address where the tryton server is listening on

Hello, following this manual it does everything right and connects me without problems, but a very curious thing happens to me.

When I try to do an installation with another Database name, another user and another password, when I put this instruction: trytond -c /etc/tryton/trytond.conf

I only see this: Running on http://localhost:8000
and not with the IP, that is, this other thing that would be correct: http://mi.ip:8000

Do you know what I am leaving behind without doing it correctly?

Thank you.

For the server to listen to a different address than localhost, you must configure the [web] listen configuration.

I have it on ced.
If I change it to the Database tryton_test works without problems because I have it installed on the system as well.

I guess it must be something I’m missing.

I do not understand. What are you calling “Database”? I only talked about the [web] listen there is no database in this section.

So, I must have something wrong in the trytond.conf file, because the reality is that when I change this file to start with the user tryton_test it works, but when I put it with the new one, it doesn’t work with the IP, only in localhost.

Where do you put it? Indeed what does this mean?

but instead when I put it with the new user and password is when this happens to me.

Is there some kind of log file that I can consult to give me a clue as to what might be going on?

See Logging configuration — trytond latest documentation

But I suspect that the OS user used to launch trytond does not have the read access to the configuration file.
trytond follows the Python configparser library which silently skip files that can not be read. The logging display in information about the configuration files used. So if there are no such message, no files have been read.

I don’t think it’s a file reading problem, ced.

The issue is in the file that I attached “File-trytond.conf”, the only thing I do is change the comment in the line that I mark with an arrow.

When I put it with the line where it says “tryton_test:tryton_test”, there is no problem, everything works correctly, but when I put it with the following line, it is when and that I also mark with the second arrow, it is when it only boots on localhost. That’s why I’m surprised it’s not reading the file.

I also attach two more images that indicate what it does with each case and as you can see there is one of them that only appears as localhost.


The [database] uri parameter is unrelated to the [web] listen parameter.
But I see that you are using sudo to edit the configuration, so I still suspect some read access issue. You can see if the configuration file is loaded if you launch trytond with the option -vv.

I don’t know if you mean this:

Let’s go if I put in the system: $ trytond -vv
comes out the same

Then I think you have to provide the each configuration files fully.

PS: please avoid screenshots with text, they are not accessible nor indexable

This is the trytond.conf file:

# /etc/tryton/trytond.conf - Configuration file for Tryton Server (trytond)
 # This file contains the most common settings for trytond (Defaults
 # are commented).
 # For more information read
 # /usr/share/doc/trytond-<version>/

 # 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@/
 #Default setting for a local postgres database
 #uri = postgresql:///

 # 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://tryton:tryton@localhost:5432/
 #uri = postgresql://user:password@localhost/
# uri = postgresql://tryton_test:tryton_test@localhost:5432/
uri = postgresql://myuser:mypass@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/tryton

 # 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 = nl
 # en

 # SSL settings
 # Activation of SSL for all available protocols.
 # Uncomment the following settings for key and certificate
 # to enable SSL.

 # The path to the private key
 #privatekey = /etc/ssl/private/ssl-cert-snakeoil.key

 # The path to the certificate
 #certificate = /etc/ssl/certs/ssl-cert-snakeoil.pem

 # Settings for the JSON-RPC network interface

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

 listen =

 # Listen on all interfaces (IPv4 and IPv6)
 #listen = [::]:8000

 # The hostname for this interface
 #hostname =

 # The root path to retrieve data for GET requests
 #data = jsondata

 # Settings for the XML-RPC network interface

 # The IP/host and port number of the interface
 #listen = localhost:8069

 # Settings for the WebDAV network interface

 # The IP/host and port number of the interface
 #listen = localhost:8080
 listen =

 # Session settings

 # The time (in seconds) until an inactive session expires
 timeout = 3600

 # The server administration password used by the client for
 # the execution of database management tasks. It is encrypted
 # using using the Unix crypt(3) routine. A password can be
 # generated using the following command line (on one line):
 # $ python -c 'import getpass,crypt,random,string; \
 # print crypt.crypt(getpass.getpass(), \
 # "".join(random.sample(string.ascii_letters + string.digits, 8)))'
 # Example password with 'admin'
 #super_pwd = jkUbZGvFNeugk
 #super_pwd = <your pwd>

 # Mail settings

 # The URI to connect to the SMTP server.
 # Available protocols are:
 # - smtp: simple SMTP
 # - smtp+tls: SMTP with STARTTLS
 # - smtps: SMTP with SSL
 #uri = smtp://localhost:25
 uri = smtp://localhost:25

 # The From address used by the Tryton Server to send emails.
 from = tryton@<your-domain.tld>

 # Report settings

 # Unoconv parameters for connection to the unoconv service.
 #unoconv = pipe,name=trytond;urp;StarOffice.ComponentContext

 # Module settings
 # Some modules are reading configuration parameters from this
 # configuration file. These settings only apply when those modules
 # are installed.
 # The URI to connect to the LDAP server.
 #uri = ldap://host:port/dn?attributes?scope?filter?extensions
 # A basic default URL could look like
 #uri = ldap://localhost:389/

 # Path for the web-frontend
 #root = /usr/lib/node-modules/tryton-sao
 listen =
#root = /usr/share/sao
 root = /home/npc/sao

There are a lot of useless parameters (and also there are spaces that looks odd) there, just try with the simplest one:

uri = postgresql://myuser:mypass@localhost:5432/
path = /var/lib/tryton
language = nl

listen =
root = /home/npc/sao

I have put this that you tell me only and nothing.
It does the exact same thing to me.

CED !!!

I just found the problem.

It’s a blank space that I have at the beginning of each line.
It can be seen that when I copied and pasted it, it put a blank space on all the lines at the beginning.

Removing it has solved the problem. That’s why I didn’t read the [web] part.

Thanks anyway for the help.

I’m out of ideas. I can not see how changing the database connection can change how the web server is listening.

Knowing where the problem is and to avoid having unnecessary code in the trytond.conf file, all you need is this code that you have given me before or something else is needed.

I say this to complete it with the valid code. Since there is a lot of code out there but it is similar to the one I put above, I suppose it is old.

Thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.