Tryton Windows Desktop cant connect to server on same machine database if Sqlite

hi! i’m checking out tryton 7 for the first time in my windows 11 machine.

i have installed trytond into my venv, with the following config file, the server is listening on localhost port 7779

full conf file below:

[database]
uri = sqlite://
path = C:\Users\evan\db

[web]
listen = 0.0.0.0:7779

when i ran
python C:\tryton7\venv\Scripts\trytond-admin -c C:\tryton7\trytond.conf -d test --all
it seemed to have ran successfully, after i gave the admin password.

the following tables were created in test.sqlite

ir_cache
ir_configuration
ir_lang
ir_model
ir_model_field
ir_module
ir_module_dependency
ir_translation
ir_ui_menu
ir_ui_view
res_group
res_user
res_user-res-group
sqlite-sequence

when i ran the windows desktop client (installed on same machine as the server trytond), i get the following error:

Traceback (most recent call last):
  File "C:/msys64/home/ced/tryton-7.0-64/tryton/tryton/gui/main.py", line 256, in do_activate
  File "C:/msys64/home/ced/tryton-7.0-64/tryton/tryton/common/common.py", line 1032, in get_credentials
  File "C:/msys64/home/ced/tryton-7.0-64/tryton/tryton/common/common.py", line 1089, in __init__
  File "C:/msys64/home/ced/tryton-7.0-64/tryton/tryton/rpc.py", line 122, in login
  File "C:/msys64/mingw64/lib/python3.11/xmlrpc/client.py", line 1122, in __call__
  File "C:/msys64/home/ced/tryton-7.0-64/tryton/tryton/jsonrpc.py", line 304, in __request
tryton.jsonrpc.Fault: 'ir.configuration'

Fault: 'ir.configuration'

i was running in the desktop client with the following info
profile name: mydemo
host: localhost:7779
database: test
user name: admin

here is the output in the terminal where i’m running the server:

(venv) C:\tryton7>python C:\tryton7\venv\Scripts\trytond -c C:\tryton7\trytond.conf
C:\tryton7\venv\Lib\site-packages\trytond\__init__.py:27: UserWarning: Timezone must be set to UTC instead of Taipei Standard Time
  warnings.warn('Timezone must be set to UTC instead of %s' % time.tzname[0])
8852 6332 [2024-04-17 16:50:56,017] INFO werkzeug WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:7779
 * Running on deleted
8852 6332 [2024-04-17 16:50:56,017] INFO werkzeug Press CTRL+C to quit
8852 14568 [2024-04-17 16:52:40,202] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:52:40] "POST / HTTP/1.1" 200 -
8852 8692 [2024-04-17 16:52:50,735] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:52:50] "POST / HTTP/1.1" 200 -
8852 11452 [2024-04-17 16:52:56,688] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:52:56] "POST /test/ HTTP/1.1" 200 -
8852 8992 [2024-04-17 16:54:28,785] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:54:28] "POST / HTTP/1.1" 200 -
8852 11200 [2024-04-17 16:54:55,527] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:54:55] "POST / HTTP/1.1" 200 -
8852 10756 [2024-04-17 16:55:01,534] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:55:01] "POST /test/ HTTP/1.1" 200 -
8852 10912 [2024-04-17 16:55:17,504] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:55:17] "POST / HTTP/1.1" 200 -
8852 14220 [2024-04-17 16:56:05,658] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:56:05] "POST / HTTP/1.1" 200 -
8852 8708 [2024-04-17 16:56:07,963] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:56:07] "POST / HTTP/1.1" 200 -
8852 13840 [2024-04-17 16:56:25,227] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:56:25] "POST / HTTP/1.1" 200 -
8852 14784 [2024-04-17 16:56:32,368] INFO werkzeug 127.0.0.1 - - [17/Apr/2024 16:56:32] "POST /test/ HTTP/1.1" 200 -

the single row in res_user table has the following values:
id = 0
name = Root
active = 0
login = root
password = NULL

so is this where an admin user is supposed to have been saved?

also. the ir_configuration table is empty

any idea how to fix the problem?

thank you for any help!!

Welcome @evanhere, good to have you here.

Yes and it has id=1.

This table usually has one line.

I am not this experienced with sqlite. I use it internally for tests only.
But with postgres the database must be created at first and then it is initialized.
Does it help to run this two times from the same directory:

also it would be interesting what happens if you activate modules with e.g.:
python C:\tryton7\venv\Scripts\trytond-admin -c C:\tryton7\trytond.conf -d test -u country currency

Do you find also the tables country_country and currency_currency?

hi udono!

thanks for your reply. before reading your reply, i ran trytond-admin again and for some reason unknown to me, several more tables were created in test.sqlite and i was able to login as admin. once i’m in i see two tabs in the screen. the leftmost seems to be for Module Configuration, and I got message saying as Admin, you’ll be able to configure modules depending on what modules you’ve installed. i didnt activate any module so i’m in the process of figuring this out.

then i read your reply.
i ran the command u specified and i got the following error:

(venv) C:\tryton7>python C:\tryton7\venv\Scripts\trytond-admin -c C:\tryton7\trytond.conf -d test -u country currency
C:\tryton7\venv\Lib\site-packages\trytond\__init__.py:27: UserWarning: Timezone must be set to UTC instead of Taipei Standard Time
  warnings.warn('Timezone must be set to UTC instead of %s' % time.tzname[0])
Traceback (most recent call last):
  File "C:\tryton7\venv\Scripts\trytond-admin", line 31, in <module>
    admin.run(options)
  File "C:\tryton7\venv\Lib\site-packages\trytond\admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "C:\tryton7\venv\Lib\site-packages\trytond\pool.py", line 167, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "C:\tryton7\venv\Lib\site-packages\trytond\modules\__init__.py", line 384, in load_modules
    _load_modules(update)
  File "C:\tryton7\venv\Lib\site-packages\trytond\modules\__init__.py", line 346, in _load_modules
    graph = create_graph(modules)
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\tryton7\venv\Lib\site-packages\trytond\modules\__init__.py", line 95, in create_graph
    info = get_module_info(module)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\tryton7\venv\Lib\site-packages\trytond\modules\__init__.py", line 34, in get_module_info
    with tools.file_open(os.path.join(name, 'tryton.cfg')) as fp:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\tryton7\venv\Lib\site-packages\trytond\tools\misc.py", line 49, in file_open
    path = find_path(name, subdir)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\tryton7\venv\Lib\site-packages\trytond\tools\misc.py", line 90, in find_path
    raise FileNotFoundError("No such file or directory: %r" % name)
FileNotFoundError: No such file or directory: 'country\\tryton.cfg'

should i have ran other commands like a pip install <tryton country module> before running the command u gave me?

Yes, you need to install the Tryton module packages you need.
You may use this for inspiration:

hi odono!

i had to do the following in order to get the country related modules, tables and populate the data:

python -m pip install trytond_country
Installing collected packages: trytond_country
Successfully installed trytond_country-7.0.0
python -m pip install  pycountry
Installing collected packages: pycountry
Successfully installed pycountry-23.12.11
python -m pip install porteus
Installing collected packages: proteus
Successfully installed proteus-7.0.1
C:\tryton7\venv\Scripts\trytond_import_countries  -c C:\tryton7\trytond.conf -d test
python C:\tryton7\venv\Scripts\trytond-admin -c C:\tryton7\trytond.conf -d test -u country 

i see the country-related tables in test.sqlite and the populated data!! :slight_smile:

thanks again for your reply!

1 Like

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