ioanp
(Ioannis Proios)
May 6, 2026, 9:07pm
1
I have installed trytond 8.0.2
Access from localhost is ok but when I try from another address it gives a 401 error.
I tried with sao and rpc client
conf
[web]
listen = 0.0.0.0:4548
cors =
http://192.168.1.111
http://localhost
*
root = /opt/venv/Tryton8/sao
logs
INFO werkzeug 127.0.0.1 - - [06/May/2026 20:41:57] "POST /mp/rpc/ HTTP/1.1" 200 -
INFO werkzeug 127.0.0.1 - - [06/May/2026 20:42:05] "POST /mp/rpc/ HTTP/1.1" 200 -
INFO werkzeug 127.0.0.1 - - [06/May/2026 20:44:21] "POST /mp/bus HTTP/1.1" 200 -
ERROR trytond.security session failed for '1' from '192.168.1.111' on database 'mp'
INFO werkzeug 192.168.1.111 - - [06/May/2026 20:44:59] "POST /mp/rpc/ HTTP/1.1" 401 -
alejandro
(Alejandro Ayala Usuga)
May 6, 2026, 11:39pm
2
How do you deploy your system?, I would like to help you but is the first time that I see this error message. I saw that you have cors, the 0.0.0.0 this must be work.
401 is an usal error of credentials.
alejandro
(Alejandro Ayala Usuga)
May 7, 2026, 1:07am
3
I have reproduce the error using de RPC call. Could you share your code for RPC client?
alejandro
(Alejandro Ayala Usuga)
May 7, 2026, 1:46am
4
this code works for me:
In [65]: import requests
...: import json
In [73]: HOST = '127.0.0.1'
...: PORT = '8090'
...: DATABASE = 'tryton'
...: USER = 'admin'
...: PASSWD = 'S0p0rt3f1n4l*'
...:
...: url = f"http://{HOST}:{PORT}/{DATABASE}/"
...:
...: # 1. Login
...: payload = json.dumps({
...: 'jsonrpc': "2.0",
...: 'method': 'common.db.login',
...: 'params': [USER, {'password': PASSWD}],
...: 'id': 1
...: })
In [70]: response = requests.post(url, data=payload, headers={'Content-Type': 'application/json'})
ioanp
(Ioannis Proios)
May 7, 2026, 6:03am
5
I deploy with virtualenv ./.venv/bin/trytond -c trytond.conf --dev
with httpx.Client(timeout=5.0, headers=headers) as client:
body = {“id”:1,“method”:“model.sale.sale.create”,“params”:[payload,{}]}
r = client.post(“http://192.168.1.111:4548/mp/rpc/”, json=body)
if I change the url to localhost it works but with this while the login responds correctly, at the rpc the response is empty (the same on sao)
ced
(Cédric Krier)
May 7, 2026, 8:35am
6
Since the usage of cookie to store the session in sao, it does not work without a secure connection except for localhost. See tryton_session cookie is rejected (#14813) · Issues · Tryton / Tryton · GitLab
ioanp
(Ioannis Proios)
May 7, 2026, 9:45am
7
Is this something that will be fixed in the future or do I need to set some parameter in the config ?
[session]
secure = False
ced
(Cédric Krier)
May 7, 2026, 9:56am
8
For development use localhost and otherwise secure the connection.
1 Like
system
(system)
Closed
May 8, 2026, 9:57am
9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.