automatic backup to whatever addon fails to install with bad sql.
When trying to install AB2W from the Flectra Store it fails with an internal error. Looking at the logs it is clear what has happened in so much as the sql is not filled out properly and causes an exception.
--- CUT ---
2019-03-05 15:37:06,318 1 INFO company flectra.modules.loading: loading 68 modules...
2019-03-05 15:37:06,822 1 INFO company flectra.modules.registry: module automatic_backup_to_whatever: creating or updating database tables
2019-03-05 15:37:06,928 1 INFO company flectra.modules.loading: loading automatic_backup_to_whatever/security/ir.model.access.csv
2019-03-05 15:37:06,995 1 ERROR company flectra.sql_db: bad query: b'INSERT INTO "ir_model_access" ("id", "perm_unlink", "name", "perm_create", "perm_read", "group_id", "perm_write", "active", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval(\'ir_model_access_id_seq\'), true, \'access_automatic_backup_to_whatever_configuration\', true, true, 4, true, true, 1, 1, (now() at time zone \'UTC\'), (now() at time zone \'UTC\')) RETURNING id'
ERROR: null value in column "model_id" violates not-null constraint
DETAIL: Failing row contains (580, access_automatic_backup_to_whatever_configuration, t, null, 4, t, t, t, t, 1, 2019-03-05 15:37:06.839045, 1, 2019-03-05 15:37:06.839045).
2019-03-05 15:37:07,002 1 WARNING company flectra.modules.loading: Transient module states were reset
2019-03-05 15:37:07,024 1 ERROR company flectra.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flectra/modules/registry.py", line 85, in new
flectra.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/flectra/modules/loading.py", line 380, in load_modules
loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/flectra/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/flectra/modules/loading.py", line 181, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/usr/lib/python3/dist-packages/flectra/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/usr/lib/python3/dist-packages/flectra/tools/convert.py", line 785, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "/usr/lib/python3/dist-packages/flectra/tools/convert.py", line 832, in convert_csv_import
raise Exception(_('Module loading %s failed: file %s could not be processed:\n %s') % (module, fname, warning_msg))
Exception: Module loading automatic_backup_to_whatever failed: file automatic_backup_to_whatever/security/ir.model.access.csv could not be processed:
No matching record found for external id 'model_automatic_backup_to_whatever_configuration' in field 'Object'
Missing required value for the field 'Object' (model_id)
2019-03-05 15:37:07,087 1 INFO company flectra.modules.loading: loading 1 modules...
2019-03-05 15:37:07,108 1 INFO company flectra.modules.loading: 1 modules loaded in 0.02s, 0 queries
2019-03-05 15:37:07,159 1 INFO company flectra.modules.loading: loading 67 modules...
2019-03-05 15:37:07,310 1 INFO company flectra.modules.loading: 67 modules loaded in 0.15s, 0 queries
2019-03-05 15:37:07,561 1 INFO company flectra.modules.loading: Modules loaded.
2019-03-05 15:37:07,574 1 INFO company flectra.modules.registry: At least one model cache has been invalidated, signaling through the database.
2019-03-05 15:37:07,576 1 INFO company werkzeug: 10.4.0.30 - - [05/Mar/2019 15:37:07] "POST /web/app_download_install HTTP/1.1" 200 - 377 0.336 4.037
2019-03-05 15:37:42,491 1 INFO company werkzeug: 10.4.0.30 - - [05/Mar/2019 15:37:42] "POST /longpolling/poll HTTP/1.1" 200 - 9 0.007 50.061
2019-03-05 15:37:42,562 1 INFO company flectra.addons.base.ir.ir_http: Generating routing map
--- CUT ---
I can possibly fix it myself but as the response to support seems somewhat slow I am leaving this here as a place marker. If I have time for a fix I will submit a pull request.
Thanks.