# Can't access backend from desktop app

**URL:** https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986
**Category:** User
**Created:** [February 27, 2023, 9:10pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986 "2023-02-27T21:10:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stustd](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/4491bb/32.png) [@stustd](https://discuss.tryton.org/u/stustd)
#### Post date: [February 27, 2023, 9:10pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986/1 "2023-02-27T21:10:07Z")

</div>

I have installed Tryton on Ubuntu 22.04. However, I can’t get a connection from the desktop to the backend. The server is running in verbose mode as:

```auto
root 86609 0.3 0.5 301580 97084 pts/3 Sl 20:54 0:02 /usr/bin/python3 /usr/bin/trytond -c /etc/tryton/trytond.conf -vvvvvv

```

Trying to connect through the desktop gui, the table is visible; trying to login with password the server then produces the following log:

```auto
...
erkzeug.exceptions.Unauthorized: 401 Unauthorized: The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.
86609 140561273456192 [2023-02-27 20:55:07,822] INFO werkzeug 127.0.0.1 - - [27/Feb/2023 20:55:07] "POST /tryton_actryx/ HTTP/1.1" 401 -
86609 140561273456192 [2023-02-27 20:55:07,826] INFO trytond.wsgi <JSONRequest 127.0.0.1 'http://localhost:8000/tryton_actryx/' [POST] common.db.login>
86609 140561273456192 [2023-02-27 20:55:07,828] DEBUG trytond.backend.postgresql.database b'SELECT COUNT(\'*\') FROM "res_user_login_attempt" AS "a" WHERE (("a"."ip_network" = \'127.0.0.1/32\') AND ("a"."create_date" >= \'2023-02-27T20:50:07.828055\'::timestamp))'
86609 140561273456192 [2023-02-27 20:55:07,833] DEBUG trytond.backend.postgresql.database b'SELECT "a"."id" AS "id", "a"."cookie" AS "cookie", "a"."create_date" AS "create_date", "a"."create_uid" AS "create_uid", "a"."login" AS "login", "a"."write_date" AS "write_date", "a"."write_uid" AS "write_uid", CAST(EXTRACT(\'EPOCH\' FROM COALESCE("a"."write_date", "a"."create_date")) AS VARCHAR) AS "_timestamp" FROM "res_user_device" AS "a" WHERE (("a"."login" = \'tryton\') AND ("a"."cookie" IS NULL)) ORDER BY "a"."id" ASC LIMIT 1'
86609 140561273456192 [2023-02-27 20:55:07,836] DEBUG trytond.backend.postgresql.database b'SELECT COUNT(\'*\') FROM "res_user_login_attempt" AS "a" WHERE ((("a"."login" = \'tryton\') AND ("a"."device_cookie" IS NULL)) AND ("a"."create_date" >= \'2023-02-27T20:50:07.835733\'::timestamp))'
86609 140561273456192 [2023-02-27 20:55:10,840] DEBUG trytond.wsgi Exception when processing <JSONRequest 127.0.0.1 'http://localhost:8000/tryton_actryx/' [POST] common.db.login>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/usr/lib/python3/dist-packages/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/usr/lib/python3/dist-packages/trytond/protocols/dispatcher.py", line 61, in login
    session = security.login(
  File "/usr/lib/python3/dist-packages/trytond/security.py", line 33, in login
    user_id = User.get_login(loginname, parameters)
  File "/usr/lib/python3/dist-packages/trytond/res/user.py", line 667, in get_login
    user_ids.add(func(login, parameters))
  File "/usr/lib/python3/dist-packages/trytond/res/user.py", line 679, in _login_password
    raise LoginException('password', msg, type='password')
trytond.exceptions.LoginException: ('LoginException', ('password', 'Password for tryton', 'password'))
86609 140561273456192 [2023-02-27 20:55:10,842] INFO werkzeug 127.0.0.1 - - [27/Feb/2023 20:55:10] "POST /tryton_actryx/ HTTP/1.1" 200 -

```

Your help is much appreciated.

---

<div class="post-metadata">

### Author: ![dave](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://discuss.tryton.org/u/dave)
#### Post date: [February 27, 2023, 9:32pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986/2 "2023-02-27T21:32:55Z")

</div>

From what I can see, you do have a connection from the frontend to the backend, as the log messages are what you would expect if you are trying to login but have not provided the correct login details.

I think the problem may be that you are trying to connect as the `tryton` user, which wont exist if you have only just set everything up, the `admin` user is the one you need to start with.

So try connecting to the `tryton_actryx` database, with the `admin` user, and the password you set when you ran the `trytond-admin` command to initialize the database.

---

<div class="post-metadata">

### Author: ![stustd](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/4491bb/32.png) [@stustd](https://discuss.tryton.org/u/stustd)
#### Post date: [February 27, 2023, 9:49pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986/3 "2023-02-27T21:49:18Z")

</div>

The ‘tryton’ role was created in psql with the right privileges: under this user the ‘trytond-admin’ script was run to initialize the database ('sudo -H -u tryton bash -c ‘trytond-admin…’). Also, I can access the tryton\_actryx database directly with the dbeaver sql database browser and using the ‘tryton’ user as login, accepting the password.

---

<div class="post-metadata">

### Author: ![dave](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://discuss.tryton.org/u/dave)
#### Post date: [February 27, 2023, 9:57pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986/4 "2023-02-27T21:57:55Z")

</div>

The Postgres users and Tryton users are totally separate.

The `trytond` server connects to postgres using the user and password that you have setup, which is why you can connect to the database using dbeaver with this user.

However, when you run the `trytond-admin` command this initializes the database in Postgres, and creates a single Tryton user (`admin`). This is the user that you are setting the password for just before the `trytond-admin` finishes, and this is the user that you need to enter into the Tryton client.

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [March 29, 2023, 9:58pm UTC](https://discuss.tryton.org/t/cant-access-backend-from-desktop-app/5986/5 "2023-03-29T21:58:05Z")

</div>

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