# Still can not install my module in Tryton

**URL:** https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044
**Category:** Developer
**Created:** [July 20, 2020, 1:50am UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044 "2020-07-20T01:50:53Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 1:50am UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/1 "2020-07-20T01:50:53Z")

</div>

Trying to install my custom module into Tryton. No errors while setup and startup. And even my custom class is registered but no any traces of the new module in Tryton web-client.  
The setup is two docker containers (within Ubuntu Server 18.04) with **tryton** and a **postgres**  **DB**.  
`trytond-admin ver. 5.6.3`  
module called ‘fleets’.  
I used **cookiecutter** to create module structure. I followed manual of module creation, and seems checked all cross-referrences between .py files and xml-s.

I did required install and all updates:

> ```
> python3 setup.py develop (in the folder ../modules/fleets)
> trytond-admin -u fleets --activate-dependencies -c /etc/trytond.conf 
> trytond-admin --update-modules-list --activate-dependencies -c /etc/trytond.conf
> 
> ```

But still no module in Tryton.  
I started Tryton server with DEBUG info and I can see that class is actually registered:  
`Mon Jul 20 01:41:18 2020] INFO:trytond.modules:fleets:registering classes`  
then I can see the Pool:

> ```
> Mon Jul 20 01:42:31 2020] INFO:trytond.pool:init pool for "tryton"
> ... <no my module here> ....
> Mon Jul 20 01:42:33 2020] INFO:trytond.modules:all modules loaded
> 
> ```

And… no any mentions of my module anymore.  
No success.  
————  
I spent hours, trying to understand where to look at. I have no idea how to debug this problem. I checked DB tables — there is no mention either fields of my module nor the module name (‘fleets’) itself.  
What should be my next step?

Thanks,  
Constantine.

---

<div class="post-metadata">

### Author: ![semarie](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/semarie/32/112_2.png) [@semarie](https://discuss.tryton.org/u/semarie)
#### Post date: [July 20, 2020, 4:46am UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/2 "2020-07-20T04:46:19Z")

</div>

I would first ensure that the module is properly installed.

you could run a python interpreter and manually import the module:

```auto
$ path/to/venv/bin/python3
>>> import trytond.modules.fleets
>>> 

```

it should have no error.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [July 20, 2020, 6:24am UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/3 "2020-07-20T06:24:59Z")

</div>

Could be database name parameter is missing in trytond-admin command? Os is it defined in environment variable?

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [July 20, 2020, 8:23am UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/4 "2020-07-20T08:23:17Z")

</div>

You have to create a symlink on ../modules/your\_module\_name in trytond/trytond/modules

See script: [http://hg.tryton.org/tryton-env/file/tip/.hooks/link\_modules](http://hg.tryton.org/tryton-env/file/tip/.hooks/link_modules)

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 4:27pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/5 "2020-07-20T16:27:37Z")

</div>

```auto
$ path/to/venv/bin/python3
>>> import trytond.modules.fleets

```

Thank you! Good idea to test the installation quickly.  
Tested right now. No errors. Yet, as it is shown here: `INFO:trytond.modules:fleets:registering classes` — I did not expect any troubles here.

> [@sergyo](#):
>
> Could be database name parameter is missing in trytond-admin command? Os is it defined in environment variable?

I set the address in the config:

```
[database]
uri = postgresql://postgres:< ************ >@postgres:5432/

```

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 20, 2020, 4:35pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/6 "2020-07-20T16:35:46Z")

</div>

> [@banknote](#):
>
> I set the address in the config

So if you do not specify a database then `trytond-admin` will not know in which database to update the module list.

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 4:43pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/7 "2020-07-20T16:43:29Z")

</div>

> So if you do not specify a database then `trytond-admin` will not know in which database to update the module list.

I used string:  
`trytond-admin -u fleets --activate-dependencies -c /etc/trytond.conf `

Why don’t? In this config it is explicitly set the uri

```auto
[database]
uri = postgresql://postgres:< ************ >@postgres:5432/

```

Also, I can not understand how I can point to URL instead of path in ‘-d’ parameter.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [July 20, 2020, 5:00pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/8 "2020-07-20T17:00:31Z")

</div>

> [@banknote](#):
>
> I used string:  
> `trytond-admin -u fleets --activate-dependencies -c /etc/trytond.conf `

It is missing `-d <database name>`

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 5:05pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/9 "2020-07-20T17:05:15Z")

</div>

> [@ced](#):
>
> It is missing `-d <database name>`

Sure, it is missing: that is not possible to connect to DB with -d parameter as PostgreSQL is in the other container and the only way to connect it by the following:

```auto
postgresql://postgres:< ************ >@postgres:5432/

```

Again, I have no local database in this Tryton container.  
Based on the help by trytond-admin:  
_…The config file can be  
specified in the TRYTOND\_CONFIG environment variable. The database URI can be  
specified in the TRYTOND\_DATABASE\_URI environment variable._  
And SET produces among others:  
TRYTOND\_CONFIG=/etc/trytond.conf  
TRYTOND\_DATABASE\_URI=postgresql://postgres:XXXXXXXX@postgres:5432/

**PS:** All these settings and manipulations made from within the container by  
`docker exec -u root -it tryton bin/bash`

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 6:07pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/10 "2020-07-20T18:07:09Z")

</div>

I think the problem is in the operations of trytond-admin.  
even in verbose mode, it produces almost no output, so I can’t even know what happens on the back end. I am going to edit admin.py to add verbosity to the process.  
————  
With that, I need some help to understand where in DB (in what table) all modules are stored?

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [July 20, 2020, 6:31pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/11 "2020-07-20T18:31:06Z")

</div>

> [@banknote](#):
>
> even in verbose mode, it produces almost no output, so I can’t even know what happens on the back end. I am going to edit admin.py to verbosity to the proces

You should use the -v flag to increase the verbosity.  
The verbosity increases with the number of v used. I will recomend using at least two flags:

```
trytond-admin -vv -d db_name -c /etc/trytond.conf -u fleets --activate-dependencies

```

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 9:20pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/12 "2020-07-20T21:20:09Z")

</div>

I added some  
logger.info() strings.  
I suggest add additional Exception if DB name is missing (the “for” loop with access to DB is skipped)

Constantine.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [July 20, 2020, 9:38pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/13 "2020-07-20T21:38:39Z")

</div>

> [@banknote](#):
>
> I set the address in the config:
> 
> ```
> [database]
> uri = postgresql://postgres:< ************ >@postgres:5432/
> 
> ```

The uri in the config file does not contain information about the database due to a trytond server instance can work with many databases.  
As @ced said you need to call trytond-admin with -d parameter to update the given database.

---

<div class="post-metadata">

### Author: ![banknote](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/banknote/32/980_2.png) [@banknote](https://discuss.tryton.org/u/banknote)
#### Post date: [July 20, 2020, 9:41pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/14 "2020-07-20T21:41:23Z")

</div>

Yes,  
that was the problem.  
My final string (successful):

> trytond-admin -u fleets -m --logconf /etc/trytond.log.conf -c /etc/trytond.conf -vv -d tryton

---

<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: [August 19, 2020, 9:41pm UTC](https://discuss.tryton.org/t/still-can-not-install-my-module-in-tryton/3044/15 "2020-08-19T21:41:24Z")

</div>

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