Upgrade from 6.2 > 6.4 or 6.2 > 7.0 fails "ir_ui_view_tree_optional" does not exist

Hi there, I have an installation that has been running solid for a long time now of 6.2. It is a VM I have been able to go back to snapshot of live 6.2 after failed attempts (which are many over the last 24hours), but I am unable to get 6.4 or 7.0 functional.
I have upgraded with pip3 “tryton, trytond, and all of the other existing modules” and the versions are indeed like (ie 6.4.x or 7.0.x) with each respective try.

Example of upgrade and error going 6.2 > 6.4 :

  1. pip3 install --upgrade ‘trytond==6.4.x’ (all packages are done the same) on trytond VM
  2. trytond-admin -c /etc/tryton/trytond.conf -d tryton_test --all (clean exit)
  3. pip3 install --upgrade ‘tryton==6.4.x’ on machine running client (clean exit)
  4. On machine running tryton client from terminal run:
    tryton
  5. Prompts me and accepts my password
  6. Output in terminal is:

ERROR:tryton.common.common:Traceback (most recent call last):
File “/trytond/wsgi.py”, line 119, in dispatch_request
return endpoint(request, **request.view_args)
File “/trytond/protocols/dispatcher.py”, line 46, in rpc
return methods.get(request.rpc_method, _dispatch)(
File “/trytond/wsgi.py”, line 86, in auth_required
return wrapped(*args, **kwargs)
File “/trytond/protocols/wrappers.py”, line 172, in wrapper
return func(request, pool, *args, **kwargs)
File “/trytond/protocols/dispatcher.py”, line 181, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File “/trytond/model/modelview.py”, line 272, in fields_view_get
result[‘arch’], result[‘fields’] = cls.parse_view(
File “/trytond/model/modelview.py”, line 427, in parse_view
viewtreeoptionals = ViewTreeOptional.search([
File “/trytond/model/modelsql.py”, line 1532, in search
cursor.execute(*select)
File “/trytond/backend/postgresql/database.py”, line 68, in execute
cursor.execute(self, sql, args)
psycopg2.errors.UndefinedTable: relation “ir_ui_view_tree_optional” does not exist
LINE 1: …“create_date”)) AS VARCHAR) AS “_timestamp” FROM "ir_ui_vie…
^

Fault: relation “ir_ui_view_tree_optional” does not exist
LINE 1: …“create_date”)) AS VARCHAR) AS “_timestamp” FROM "ir_ui_vie…
^

ERROR:tryton.common.common: File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 258, in do_command_line
self.do_activate()
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 255, in do_activate
self.get_preferences()
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 533, in get_preferences
self.sig_win_menu(prefs=prefs)
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 740, in sig_win_menu
screen = Screen(action[‘res_model’], mode=[‘tree’], view_ids=view_ids,
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/screen/screen.py”, line 141, in init
self.switch_view()
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/screen/screen.py”, line 582, in switch_view
self.screen_container.set(self.current_view.widget)

AttributeError: ‘NoneType’ object has no attribute ‘widget’

  1. tryton client appears to connect to my database but display is completely empty. does not show menus/trees to the left as functional 6.2 does.
  2. If I attempt to type anything in the Search Box in the top left I get this error each time I type a character:

File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 391, in update
CONFIG[‘client.limit’], self.menu_screen.model_name,

AttributeError: ‘NoneType’ object has no attribute ‘model_name’

6.2 > 7.0

  1. same process as above but with the following errors

File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 268, in do_command_line
self.do_activate()
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 265, in do_activate
self.get_preferences()
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 551, in get_preferences
self.sig_win_menu(prefs=prefs)
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 762, in sig_win_menu
screen = Screen(action[‘res_model’], mode=[‘tree’], view_ids=view_ids,
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/window/view_form/screen/screen.py”, line 52, in init
if not (MODELACCESS[model_name][‘write’]
File “/home/thomas/.local/lib/python3.8/site-packages/tryton/common/common.py”, line 248, in getitem
return self._access[model]

KeyError: ‘ir.ui.menu’

File “/home/thomas/.local/lib/python3.8/site-packages/tryton/gui/main.py”, line 403, in update
CONFIG[‘client.limit’], self.menu_screen.model_name,

AttributeError: ‘NoneType’ object has no attribute ‘model_name’

While I don’t know how to fix this, I do not suspect that the problem is on the tryton client side and suspect it is a missing table or something on trytond side looking at the trace. Client connects with user and password. When I have upgraded to 7.0 it does indeed funtion correctly with the 7.0demo.tryton.org server.
If I am not mistaken 6.4 was when optional tree view came to be and I suspect the problem I am having is related to that change. Anyone got some ideas?

For me the database has not been correctly updated.
For example are you sure to run the trytond-admin of 6.4 or 7.0?

Thank you for the speedy reply. Yes sir, I have and am able to run trytond-admin -c /etc/tryton/trytond.conf -d tryton_test --all which does hit the correct and active conf and database. There is a clean exit from the command (no errors) so I assume everything is going well enough. This is the output for running -c /etc/tryton/trytond.conf -d tryton_test --all --verbose :

1662 140026490586944 [2024-02-25 14:26:11,690] WARNING trytond.backend.postgresql.table Unable to migrate column data on table ir_queue from text to jsonb.
1662 140026490586944 [2024-02-25 14:26:54,709] WARNING trytond.backend.postgresql.table Unable to migrate column information on table account_statement_origin from text to jsonb.
1662 140026490586944 [2024-02-25 14:27:01,405] WARNING trytond.backend.postgresql.table Unable to migrate column information on table account_statement_origin from text to jsonb.
1662 140026490586944 [2024-02-25 14:27:01,405] WARNING trytond.backend.postgresql.table Unable to migrate column keywords on table account_statement_origin from text to jsonb.

The above applies to 6.4

This does not proof that you are actually running the 6.4 or 7.0 version.

from terminal of server running trytond
trytond --version

trytond 6.4.16

pip3 list

tryton 6.4.12
trytond 6.4.16
trytond-account 6.4.8
trytond-account-asset 6.4.3
trytond-account-credit-limit 6.4.1
trytond-account-deposit 6.4.1
trytond-account-dunning 6.4.2
trytond-account-dunning-email 6.4.1
trytond-account-dunning-fee 6.4.2
trytond-account-dunning-letter 6.4.1
trytond-account-invoice 6.4.8
trytond-account-invoice-correction 6.4.1
trytond-account-invoice-defer 6.4.2
trytond-account-invoice-history 6.4.2
trytond-account-invoice-line-standalone 6.4.1
trytond-account-invoice-secondary-unit 6.4.1
trytond-account-invoice-stock 6.4.2
trytond-account-payment 6.4.1
trytond-account-payment-clearing 6.4.3
trytond-account-product 6.4.1
trytond-account-statement 6.4.1
trytond-account-statement-aeb43 6.4.1
trytond-account-statement-coda 6.4.1
trytond-account-statement-ofx 6.4.1
trytond-account-statement-rule 6.4.2
trytond-account-stock-anglo-saxon 6.4.1
trytond-account-stock-continental 6.4.2
trytond-account-stock-landed-cost 6.4.2
trytond-account-tax-cash 6.4.1
trytond-account-tax-rule-country 6.4.1
trytond-analytic-account 6.4.1
trytond-analytic-invoice 6.4.1
trytond-analytic-purchase 6.4.2
trytond-analytic-sale 6.4.2
trytond-bank 6.4.5
trytond-carrier 6.4.1
trytond-carrier-weight 6.4.1
trytond-commission 6.4.2
trytond-commission-waiting 6.4.1
trytond-company 6.4.1
trytond-company-work-time 6.4.1
trytond-country 6.4.3
trytond-currency 6.4.3
trytond-customs 6.4.1
trytond-dashboard 6.4.1
trytond-marketing 6.4.1
trytond-marketing-automation 6.4.2
trytond-notification-email 6.4.2
trytond-party 6.4.2
trytond-party-relationship 6.4.1
trytond-party-siret 6.4.2
trytond-product 6.4.2
trytond-product-classification 6.4.1
trytond-product-cost-fifo 6.4.2
trytond-product-cost-history 6.4.2
trytond-product-measurements 6.4.1
trytond-product-price-list 6.4.1
trytond-product-price-list-dates 6.4.2
trytond-product-price-list-parent 6.4.1
trytond-production 6.4.3
trytond-production-outsourcing 6.4.1
trytond-production-routing 6.4.2
trytond-production-split 6.4.1
trytond-production-work 6.4.2
trytond-production-work-timesheet 6.4.1
trytond-project 6.4.1
trytond-project-invoice 6.4.2
trytond-project-plan 6.4.1
trytond-project-revenue 6.4.2
trytond-purchase 6.4.6
trytond-purchase-amendment 6.4.2
trytond-purchase-history 6.4.1
trytond-purchase-invoice-line-standalone 6.4.1
trytond-purchase-request 6.4.4
trytond-purchase-request-quotation 6.4.3
trytond-purchase-requisition 6.4.1
trytond-purchase-secondary-unit 6.4.1
trytond-purchase-shipment-cost 6.4.1
trytond-sale 6.4.7
trytond-sale-advance-payment 6.4.1
trytond-sale-amendment 6.4.1
trytond-sale-complaint 6.4.3
trytond-sale-credit-limit 6.4.3
trytond-sale-discount 6.4.2
trytond-sale-extra 6.4.1
trytond-sale-history 6.4.1
trytond-sale-invoice-grouping 6.4.1
trytond-sale-opportunity 6.4.1
trytond-sale-payment 6.4.1
trytond-sale-price-list 6.4.1
trytond-sale-product-customer 6.4.3
trytond-sale-promotion 6.4.1
trytond-sale-promotion-coupon 6.4.1
trytond-sale-secondary-unit 6.4.1
trytond-sale-shipment-cost 6.4.3
trytond-sale-shipment-grouping 6.4.2
trytond-sale-shipment-tolerance 6.4.1
trytond-sale-subscription 6.4.2
trytond-sale-subscription-asset 6.4.2
trytond-sale-supply 6.4.4
trytond-sale-supply-drop-shipment 6.4.3
trytond-stock 6.4.8
trytond-stock-consignment 6.4.3
trytond-stock-forecast 6.4.2
trytond-stock-inventory-location 6.4.1
trytond-stock-location-move 6.4.1
trytond-stock-location-sequence 6.4.1
trytond-stock-lot 6.4.1
trytond-stock-lot-sled 6.4.1
trytond-stock-lot-unit 6.4.1
trytond-stock-package 6.4.1
trytond-stock-package-shipping 6.4.2
trytond-stock-package-shipping-dpd 6.4.4
trytond-stock-package-shipping-ups 6.4.2
trytond-stock-product-location 6.4.1
trytond-stock-secondary-unit 6.4.1
trytond-stock-shipment-cost 6.4.2
trytond-stock-shipment-measurements 6.4.1
trytond-stock-split 6.4.1
trytond-stock-supply 6.4.5
trytond-stock-supply-day 6.4.1
trytond-stock-supply-forecast 6.4.1
trytond-stock-supply-production 6.4.2
trytond-timesheet 6.4.2
trytond-timesheet-cost 6.4.1
trytond-user-role 6.4.1
trytond-web-shortener 6.4.1
trytond-web-user 6.4.2

I am I missing looking for something else?

From same terminal

trytond-admin --version

trytond-admin 6.4.16

So maybe you are not updating or connecting to the right database.

Respectfully, that is not the case. It is the same database that still works under 6.2 and has been running successfully through various updates predating 5.0 when I spun it up with more than 2 years ago and began using pretty much daily. And with the same user. The only breaking change is when I try to update. This has not been the case with any of the other updates I have done over the years from version 5.0 to now.
May we assume that it is the correct database, with correct and cohesive versions and modules?
Does it stand to reason that potentially one of my tables in the database is causing the breakdown when considering my initial errors in the first post?
If so, what recommendation would be the best way to troubleshoot that to either fix the problem or rule it out?
Thanks in advance!

I can not see any other reason than the database not being updated because the error is that it is missing a new table that should be created by the update process.

Do I understand correctly that you try to migrate from 6.2 to 6.4.16 and then use the database with 7.0 ?

The end goal was to take my existing and functioning 6.2 install and migrate it to 7.0 . I have established a new company and wanted to have it with existing company.
I tried to go from 6.2 > 7.0 and was unsuccessful. I then tried to migrate a version at a time working backwards even 6.2 > 6.8, 6.2 > 6.6, 6.2 > 6.4 trying to find the breaking change.
I was unsuccessful each time. Looking at postgres logs and errors traces from tryton and trytond, the only suspicion I can come up with is my existing database was not compatible for some reason. I was unable to figure out offending value or table. I am now configuring a new installation that is functioning (7.0) on new VM built from scratch. Unfortunately, we were unable to come up with a solution to troubleshoot the DB, so I will just run the two instances until I can make a good demarcation point for existing company and start it new on 2nd server running 7.0

Hi Thomas,

AFAIK you can just update from 6.2 to 7.0 without any intermediate migration. You can do this with the following steps:

  • Setup a tryton server environment for 7.0. Also test the 7.0 environment by

    • creating a temporary postgres database,
    • connect with the tryton 7.0 client and
    • activate e.g. the party module.
    • Add a party.

    Continue only if this works.

  • Restore a backup of your 6.2 database. Keep user/role and access password in sync with trytond.conf.
    Your errors of missing tables could also come from a database restore under the wrong user/role.
    E.g. restoring a database with user postgres can result in problems when in trytond.conf another user/role is configured…

  • Process all manual migration steps between 6.2 and 7.0. In this case it is Migration from 6.2 to 6.4, Migration from 6.6 to 6.8 and Migration from 6.8 to 7.0. Also reading the comments in the Migration recipes can be helpful.

  • In the 7.0 environment run the update with:
    trytond-admin -v --all --activate-dependencies -d database-name -c path/to/trytond.conf

  • After this it should be possible to enter the migrated database with your 7.0 client.

HIH

1 Like