Initializing the database

I have installed the tryton server and postgresql on an 18.04LTS Ubunto distro. I have set up a postgresql database. When I run the command to initialize the database I get an error that database “my_db”.sqlite" doesn’t exist. I am not wanting to use sqlite - I’m confident my trytond.conf file is not set up properly. Is uncommenting the postgresql settings and editing the uri line all that is needed to turn off the internal default to use sqlite, or am I missing something else? Using the 4.6 version the package installer has.
Thank you for any help!

Yes it is.
So I don’t know, are you sure that you are pointing to the correct configuration file trytond -c /etc/tryton/trytond.conf and also that the user executing the command have read permissions?

Thank you Oscar, yes I am pointing to the correct config file, but according to what you have said, apparently I am not connecting to the database during the initialization and so it is defaulting to sqlite. So apparently, if there is any problem connecting to the database, either due to incorrect username, password, or database name the initialization will default to sqlite, correct?

The first database I set up in postgresql uses the same user name as my Ubuntu user account, and the database name is also the same - creating the role and database this way does not require authentication on the Ubuntu server at least, to connect to the database - so I thought perhaps this is the problem.

I’ve been assuming I should be able to initialize the database using the Unix domain just to test for now, and was planning to change the config file to the TCP/IP section later so I can connect to the tryton server with my windows clients.

I created a fresh superuser role “tryton” with a password and unique database named “test”. I can connect to the database using psql with the user postgres easily. So I assume I can use the postgres username and my database name “test” in the uri line with no password in the Unix domain section just to test, but it returns the same error - “Database test.sqlite doesn’t exist”.

I also tried using the “tryton” user with the password. I haven’t been able to connect to the database with psql yet using that user name because of some conflict with the shell. I get an error that the account is unavailable.

No, it is not using postgresql because the configuration does not say to connect to it.
You must ensure that the configuration is actually read (there is a log INFO about that) and that the [database] uri is correctly defined.

Thank you - I think I found my error, I am very much a novice at doing the terminal commands. I was commanding “trytond-admin -c etc/tryton/tryton.conf -d databasename --all”.

I needed to command “trytond-admin -c /etc/tryton/tryton.conf -d databasename --all” instead.

Now I am getting a “psycopg2.OperationalError: Fatal: Peer authentication failed” message. Does that imply that my trytond.conf file is being read now?

I have edited my log.conf file to the level “INFO” and found where the log files are stored /var/log/tryton/ but there are no new log files.

On my second attempt I got it after editing my uri in the TCP/IP section of the trytond.conf file to be active instead of the unix domain. My terminal asked for my password for the database. Now I am apparently ready to try to connect with the tryton client.

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