On my Linuxmint machine I installed tryton and all modules to have a quick look on that stuff. The server is running:
27608 ? Ss 0:02 /usr/bin/python3 /usr/bin/trytond --config /etc/tryton/trytond.conf --logconf /etc/tryton/trytond_log.conf
but if I execute trytond-admin -c /etc/tryton/tryton.conf -d tryton --all
as root I get
Traceback (most recent call last):
File "/usr/bin/trytond-admin", line 21, in <module>
admin.run(options)
File "/usr/lib/python3/dist-packages/trytond/admin.py", line 24, in run
with Transaction().start(db_name, 0, _nocache=True):
File "/usr/lib/python3/dist-packages/trytond/transaction.py", line 88, in start
database = Database(database_name).connect()
File "/usr/lib/python3/dist-packages/trytond/backend/sqlite/database.py", line 251, in connect
raise IOError('Database "%s" doesn\'t exist!' % db_filename)
OSError: Database "tryton.sqlite" doesn't exist!
I first did not change anything in /etc/tryton/tryton.conf and all other tries changing something leaded to the same error.
To initialize an SQLite database, you must first create an empty file with the extension .sqlite in the database path. You can do that with the touch command.
On a side note, we do not recommend to use SQLite backend for anything else than running tests. Even for discovering Tryton, it is better to use PostgreSQL backend.
First, the tryton.sqlite file must be writable by the user running trytond.
And second, I guess this is not the correct directory, by default it is in ${HOME}/db of the user running trytond. So in your case, if the user is tryton, it should be in /var/lib/tryton/db.
But what is the full output of the trytond-admin command in verbose mode?
Are you sure the configuration file is readable by the user?
Are you sure you run trytond-admin with the same user as the service?
Yes, the configfile is 644.
I now did a
su - tryton -c “trytond-admin -c etc/tryton/tryton.conf -d tryton --all”
This account is currently not available.
Then I changed /etc/passwd from
tryton:x:142:152::/var/lib/tryton:/usr/sbin/nologin
to
tryton:x:142:152::/var/lib/tryton:/bin/bash
and /var/lib/tryton/db/tryton.sqlite was filled up and has now a size of 1073152 bytes.