Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed bugs 2595 2665 are still showing #3888

Closed
ghost opened this issue May 24, 2023 · 11 comments
Closed

Closed bugs 2595 2665 are still showing #3888

ghost opened this issue May 24, 2023 · 11 comments
Labels

Comments

@ghost
Copy link

ghost commented May 24, 2023

I copy paste from #2595 and #2665

I'm having trouble to upgrade my odoo 13 to 14. I have only few external module, but anyway, seems the core account module upgrade didn't pass. Apparently a foreign key reference try to use non existing table from account module while the module itself has those models. I tried various upgrade combination, but I'm not sure yet how to have those models applied to my existing database.

Impacted versions: 14.0

Steps to reproduce:

Installed new odoo 14 virtual machine.
Migrating modules into /opt/odoo/addons/
Adding openupgrade_framework and openupgrade_scripts modules to /opt/odoo/addons/
Importing database.
Running command odoo -u all -c /etc/odoo/odoo.conf --upgrade-path=/opt/odoo/addons/openupgrade_scripts/scripts/ -d my-db --stop-after-init --load=web,openupgrade_framework

Current behavior:
The migration starts and after few dozen of seconds, the following error is displayed.

`
2021-02-25 13:51:58,202 6380 ERROR my-db odoo.sql_db: bad query: ALTER TABLE "account_reconcile_model_analytic_tag_rel" ADD FOREIGN KEY ("account_reconcile_model_line_id") REFERENCES "account_reconcile_model_line"("id") ON DELETE cascade
ERROR: column "account_reconcile_model_line_id" referenced in foreign key constraint does not exist

2021-02-25 13:51:58,209 6380 WARNING my-db odoo.modules.loading: Transient module states were reset
2021-02-25 13:51:58,219 6380 ERROR my-db odoo.modules.registry: Failed to load registry
2021-02-25 13:51:58,219 6380 CRITICAL my-db odoo.service.server: Failed to initialize database my-db.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 1198, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 451, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 198, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name}, new_install)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 418, in init_models
self.check_foreign_keys(cr)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 496, in check_foreign_keys
sql.add_foreign_key(cr, table1, column1, table2, column2, ondelete)
File "/usr/lib/python3/dist-packages/odoo/tools/sql.py", line 170, in add_foreign_key
cr.execute(query.format(tablename1, columnname1, tablename2, columnname2, ondelete))
File "", line 2, in execute
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 298, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column "account_reconcile_model_line_id" referenced in foreign key constraint does not exist`

Expected behavior:
Having the upgrade running until the end of course.

Account migration script is already finished but error still shows

@ghost ghost added the bug label May 24, 2023
@legalsylvain
Copy link
Contributor

do you have openupgrade logs in your full logs ?

@ghost
Copy link
Author

ghost commented May 24, 2023

do you have openupgrade logs in your full logs ?

My log is exactly, exactly the same than #2595

@legalsylvain
Copy link
Contributor

legalsylvain commented May 24, 2023

Hi, when openupgrade, the full log is bigger. I mean, all the logs before the ERROR.
My question is, do you have openupgrade logs in your full log ?

@ghost
Copy link
Author

ghost commented May 24, 2023

Hi, when openupgrade, the full log is bigger. I mean, all the logs before the ERROR. My question is, do you have openupgrade logs in your full log ?

You mean this kind?

023-05-24 15:04:00,431 3281 DEBUG my-db OpenUpgrade: -1 rows affected after 0:00:00.006821 running ALTER TABLE "account_bank_statement_import_ir_attachment_rel" DROP CONSTRAINT "account_bank_statement_import_account_bank_statement_impor_fkey"
2023-05-24 15:04:00,432 3281 DEBUG my-dbOpenUpgrade: -1 rows affected after 0:00:00.000503 running ALTER TABLE "account_bank_statement_import_ir_attachment_rel" DROP CONSTRAINT "account_bank_statement_import_ir_attachme_ir_attachment_id_fkey"

@ghost
Copy link
Author

ghost commented May 24, 2023

Ill reply myself, If i use --update all i have another error
Its related?

@legalsylvain
Copy link
Contributor

You mean this kind?

yes, that means that openupgrade is correctly detected.

@legalsylvain
Copy link
Contributor

Well. I have no idea. I doubt that there is a bug in OpenUpgrade related to that topic, because the CI is green for account v14 module, so upgrade of a demo database is working.

@pedrobaeza
Copy link
Member

Your DB seems incorrect in the source, having a reconcile model reference which doesn't exist. Not an OpenUpgrade bug. If you want more help, put a topic in the discussion part, but not giving more information won't help you to get people willing to help you.

http://www.catb.org/~esr/faqs/smart-questions.html

@ghost
Copy link
Author

ghost commented May 25, 2023

Your DB seems incorrect in the source, having a reconcile model reference which doesn't exist. Not an OpenUpgrade bug. If you want more help, put a topic in the discussion part, but not giving more information won't help you to get people willing to help you.

http://www.catb.org/~esr/faqs/smart-questions.html

Probably, but im not the only with the same problem; information was enought to close the other exactly identical bug reports, but I got mine closed with a completely different answer. I'll find a solution and post it here, greets

@pedrobaeza
Copy link
Member

Previous issues (which aren't) were posted before anything was done, so the solution was: wait until done.

Now yours seems an inconsistent DB, or maybe you are not running correctly OpenUpgrade. In any case, not something to be handled here, but on discussions.

@ghost
Copy link
Author

ghost commented May 26, 2023

truncate account_payment_register cascade;

solves the problem during migration, it seems a legacy table from very old openERP versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants