Running trytond-admin -u on my module throws me an error

53 views
Skip to first unread message

Vincent Bastos

unread,
Feb 25, 2017, 12:52:15 AM2/25/17
to tryton-dev
I have installed my custom module on 4.2 and it worked with no errors.

Now, after having made some code changes I ran >trytond-admin -v -c file.conf -d dbname -u module_name and I am getting the following error which I don't know how to debug:

Traceback (most recent call last):

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/bin/trytond-admin", line 5, in <module>

    pkg_resources.run_script('trytond==4.2.1', 'trytond-admin')

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/pkg_resources.py", line 534, in run_script

    self.require(requires)[0].run_script(script_name, ns)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/pkg_resources.py", line 1434, in run_script

    execfile(script_filename, namespace, namespace)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/EGG-INFO/scripts/trytond-admin", line 21, in <module>

    admin.run(options)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/admin.py", line 53, in run

    pool.init(update=options.update, lang=list(lang))

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/pool.py", line 155, in init

    lang=lang)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/modules/__init__.py", line 453, in load_modules

    _load_modules()

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/modules/__init__.py", line 422, in _load_modules

    load_module_graph(graph, pool, update, lang)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/modules/__init__.py", line 245, in load_module_graph

    cls.__register__(module)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/model/modelsql.py", line 196, in __register__

    table.add_fk(field_name, ref, field.ondelete)

  File "/Users/vbastos/.virtualenvs/selfstorage2_42/lib/python2.7/site-packages/trytond-4.2.1-py2.7.egg/trytond/backend/postgresql/table.py", line 333, in add_fk

    'ON DELETE ' + on_delete)

psycopg2.ProgrammingError: constraint "self_storage_configuration_lease_postage_notice_fee_account_fke" for relation "self_storage_configuration" already exists

Cédric Krier

unread,
Feb 25, 2017, 5:50:06 AM2/25/17
to tryton-dev
On 2017-02-24 21:52, Vincent Bastos wrote:
> psycopg2.ProgrammingError: constraint
> "self_storage_configuration_lease_postage_notice_fee_account_fke" for
> relation "self_storage_configuration" already exists

The name of your table and field is too long for postgresql. There is a
default limit of 64. There are two options:

- Increase the limit on postgresql (complicated)
- Reduce the length of the table and field names

More information at https://bugs.tryton.org/issue4620 and
https://bugs.tryton.org/issue6026

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
Reply all
Reply to author
Forward
0 new messages