Hm.
I have
uri = sqlite://
path = /var/db/trytond/db
in my [database]
section of my tryton config file.
When I start trytond via rc.d (service trytond start), the server comes up and the tryton client connects to it.
I deactivate the listen in the [web]
section, e. g.
# listen = localhost:8421
, fire up via uwsgi, and get a complaint from trytond that there was no database, i. e.
OSError: Database '/var/db/trytond/db/db.sqlite' doesn't exist!
And, of course, the tryton client falls over, failing to connect.
But the database is there, at the indicated location, and world-readable.
Odd.
Cheers,
Peter.
58638 7261055426560 [2024-01-20 19:33:26,353] WARNING py.warnings /usr/local/lib/python3.9/site-packages/trytond/protocols/jsonrpc.py:129: DeprecationWarning: The 'charset' attribute is deprecated and will not be used in Werkzeug 2.4. Interpreting bytes as text in body, form, and cookie data will always use UTF-8.
getattr(self, 'charset', 'utf-8'),
58638 7261055426560 [2024-01-20 19:33:26,353] WARNING py.warnings /usr/local/lib/python3.9/site-packages/trytond/protocols/jsonrpc.py:130: DeprecationWarning: The 'encoding_errors' attribute is deprecated and will not be used in Werkzeug 3.0.
getattr(self, 'encoding_errors', 'replace')),
58638 7261055426560 [2024-01-20 19:33:26,348] INFO trytond.wsgi <JSONRequest 127.0.0.1 'http://localhost:8080/' [POST] common.authentication.services>
==> /var/log/nginx/access.log <==
127.0.0.1 - - [20/Jan/2024:20:33:26 +0100] "POST / HTTP/1.1" 200 20 "-" "Python-xmlrpc/3.9"
==> /var/log/uwsgi.log <==
[pid: 58638|app: 0|req: 1/1] 127.0.0.1 () {38 vars in 471 bytes} [Sat Jan 20 19:33:26 2024] POST / => generated 20 bytes in 8 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
58638 7261720379648 [2024-01-20 19:33:30,834] INFO trytond.wsgi <JSONRequest 127.0.0.1 'http://localhost:8080/' [POST] common.server.version>
==> /var/log/nginx/access.log <==
127.0.0.1 - - [20/Jan/2024:20:33:30 +0100] "POST / HTTP/1.1" 200 25 "-" "Python-xmlrpc/3.9"
==> /var/log/uwsgi.log <==
[pid: 58638|app: 0|req: 2/2] 127.0.0.1 () {38 vars in 471 bytes} [Sat Jan 20 19:33:30 2024] POST / => generated 25 bytes in 1 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 1)
58638 7261720379648 [2024-01-20 19:33:31,687] INFO trytond.wsgi <JSONRequest 127.0.0.1 'http://localhost:8080/db/' [POST] common.db.login>
58638 7261720379648 [2024-01-20 19:33:31,689] DEBUG trytond.wsgi Exception when processing <JSONRequest 127.0.0.1 'http://localhost:8080/db/' [POST] common.db.login>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/trytond/transaction.py", line 179, in start
database = backend.Database(database_name).connect()
File "/usr/local/lib/python3.9/site-packages/trytond/backend/sqlite/database.py", line 365, in connect
self._make_uri(), uri=True,
File "/usr/local/lib/python3.9/site-packages/trytond/backend/sqlite/database.py", line 439, in _make_uri
raise IOError("Database '%s' doesn't exist!" % db_path)
OSError: Database '/var/db/trytond/db/db.sqlite' doesn't exist!
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/trytond/transaction.py", line 239, in stop
self.rollback()
File "/usr/local/lib/python3.9/site-packages/trytond/transaction.py", line 356, in rollback
for datamanager in self._datamanagers:
AttributeError: 'Transaction' object has no attribute '_datamanagers'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/trytond/wsgi.py", line 109, in dispatch_request
return endpoint(request, **request.view_args)
File "/usr/local/lib/python3.9/site-packages/trytond/protocols/dispatcher.py", line 43, in rpc
return methods.get(request.rpc_method, _dispatch)(
File "/usr/local/lib/python3.9/site-packages/trytond/protocols/dispatcher.py", line 53, in login
session = security.login(
File "/usr/local/lib/python3.9/site-packages/trytond/security.py", line 29, in login
with Transaction().start(dbname, 0, context=context) as transaction:
File "/usr/local/lib/python3.9/site-packages/trytond/transaction.py", line 218, in start
self.stop(False)
File "/usr/local/lib/python3.9/site-packages/trytond/transaction.py", line 241, in stop
self.database.put_connection(
AttributeError: 'NoneType' object has no attribute 'put_connection'
==> /var/log/nginx/access.log <==
127.0.0.1 - - [20/Jan/2024:20:33:31 +0100] "POST /db/ HTTP/1.1" 200 2065 "-" "Python-xmlrpc/3.9"
==> /var/log/uwsgi.log <==
[pid: 58638|app: 0|req: 3/3] 127.0.0.1 () {38 vars in 477 bytes} [Sat Jan 20 19:33:31 2024] POST /db/ => generated 2065 bytes in 7 msecs (HTTP/1.1 200) 2 headers in 73 bytes (1 switches on core 1)
sudo ls -la /var/db/trytond/db/db.sqlite
-rw-rw-rw- 1 tryton uwsgi 27295744 Jan 9 23:08 /var/db/trytond/db/db.sqlite