启动Tryton客户端时出现KeyError 'res.user'错误求助
Hey there, let’s work through this Tryton login issue you’re hitting on macOS High Sierra. From the truncated traceback you shared, it’s clear the problem cropped up during the security.login step in the JSON-RPC dispatch flow—this is a common snag when setting up Tryton in TCP/IP mode. Here are the most actionable fixes to try:
Double-check TCP/IP server configuration
First, confirm your Tryton server is set to accept TCP/IP connections. Locate yourtrytond.conffile (typically in/usr/local/etc/trytond/or your custom install directory) and verify these settings exist under the[database]section:[database] listen = 0.0.0.0:8000Replace
0.0.0.0with your server’s specific IP if you don’t want open access, and make sure the port matches what you’ve entered in the client. Also, check macOS Firewall settings (System Preferences > Security & Privacy > Firewall) to ensure it isn’t blocking thetrytondprocess or port 8000.Validate database credentials and permissions
A failedsecurity.loginoften boils down to incorrect credentials or missing database permissions. Verify:- The database name in your client matches exactly what’s configured on the server
- Your username and password are correct (Tryton defaults to
adminwith no password for fresh setups—don’t forget to secure this later!) - If using PostgreSQL (the standard database for Tryton), your database user has login access. You can confirm this with a quick Postgres shell command:
SELECT usename, canlogin FROM pg_user WHERE usename = 'your_tryton_db_user';
Update compatible Python dependencies
macOS High Sierra ships with an older Python version, which can cause compatibility hiccups with Tryton 3.8 (note: Tryton 3.8 only supports Python 2.7). Make sure you’re using a compatible environment and update required packages:pip install --upgrade trytond==3.8 python-dateutil pytz psycopg2Pro tip: Use a Python virtual environment to avoid messing with your system’s default Python setup.
Restart server and client
Sometimes the simplest fix works. Stop the Tryton server process entirely, wait 10 seconds, then restart it. Quit the Tryton client completely (don’t just minimize it) and launch it again to establish a fresh TCP/IP connection.
If you can share the full, untruncated traceback (the part cut off after security.login(database_name, use...), we can narrow this down even further. But these steps should resolve most common causes of this login error.
内容的提问来源于stack exchange,提问作者Jim Norman

