muk-it / muk_dms

MuK Document Management System
GNU Lesser General Public License v3.0
91 stars 144 forks source link

Unable to install muk_dms #68

Closed bennals closed 5 years ago

bennals commented 5 years ago

Installation environment : Odoo 11 CE on Ubuntu 16.04 server (AWS).

I have been using the older 1.0 version of muk_dms happily since early 2018. I just tried to upgrade to the latest 2.0 versions but have hit a problem. The steps I followed were:

2019-02-07 12:40:15,919 16426 ERROR production odoo.sql_db: bad query: b'ALTER TABLE "muk_dms_file" ALTER COLUMN "name" SET NOT NULL' ERROR: column "name" contains null values

2019-02-07 12:40:15,920 16426 WARNING production odoo.schema: Table 'muk_dms_file': unable to set NOT NULL on column 'name'! If you want to have it, you should update the records and execute manually: ALTER TABLE "muk_dms_file" ALTER COLUMN "name" SET NOT NULL Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/tools/sql.py", line 109, in set_not_null cr.execute(query) File "/home/odoo/odoo-server/odoo/sql_db.py", line 155, in wrapper return f(self, *args, **kwargs) File "/home/odoo/odoo-server/odoo/sql_db.py", line 232, in execute res = self._obj.execute(query, params) psycopg2.IntegrityError: column "name" contains null values

2019-02-07 12:40:15,941 16426 ERROR production odoo.sql_db: bad query: b'ALTER TABLE "muk_dms_file" ALTER COLUMN "directory" SET NOT NULL' ERROR: column "directory" contains null values

2019-02-07 12:40:15,942 16426 WARNING production odoo.schema: Table 'muk_dms_file': unable to set NOT NULL on column 'directory'! If you want to have it, you should update the records and execute manually: ALTER TABLE "muk_dms_file" ALTER COLUMN "directory" SET NOT NULL Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/tools/sql.py", line 109, in set_not_null cr.execute(query) File "/home/odoo/odoo-server/odoo/sql_db.py", line 155, in wrapper return f(self, *args, **kwargs) File "/home/odoo/odoo-server/odoo/sql_db.py", line 232, in execute res = self._obj.execute(query, params) psycopg2.IntegrityError: column "directory" contains null values

...and then

2019-02-07 12:40:18,006 16426 ERROR production odoo.modules.registry: Failed to load registry Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/fields.py", line 937, in get value = record.env.cache.get(record, self) File "/home/odoo/odoo-server/odoo/api.py", line 960, in get value = self._data[field][record.id][key] KeyError: <odoo.api.Environment object at 0x7fe500216c50>

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/modules/registry.py", line 85, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/odoo/odoo-server/odoo/modules/loading.py", line 380, in load_modules loaded_modules, update_module, models_to_check) File "/home/odoo/odoo-server/odoo/modules/loading.py", line 274, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/home/odoo/odoo-server/odoo/modules/loading.py", line 153, in load_module_graph registry.init_models(cr, model_names, {'module': package.name}) File "/home/odoo/odoo-server/odoo/modules/registry.py", line 314, in init_models models[0].recompute() File "/home/odoo/odoo-server/odoo/models.py", line 4905, in recompute vals = {n: rec[n] for n in ns} File "/home/odoo/odoo-server/odoo/models.py", line 4905, in vals = {n: rec[n] for n in ns} File "/home/odoo/odoo-server/odoo/models.py", line 4759, in getitem return self._fields[key].get(self, type(self)) File "/home/odoo/odoo-server/odoo/fields.py", line 941, in get self.determine_value(record) File "/home/odoo/odoo-server/odoo/fields.py", line 1028, in determine_value self.compute_value(recs) File "/home/odoo/odoo-server/odoo/fields.py", line 1008, in compute_value self._compute_value(records) File "/home/odoo/odoo-server/odoo/fields.py", line 999, in _compute_value getattr(records, self.compute)() File "/home/odoo/thirdparty/addons/muk_dms/models/dms_file.py", line 259, in _compute_mimetype record.mimetype = get_mimetype(record) File "/home/odoo/thirdparty/addons/muk_dms/models/dms_file.py", line 253, in get_mimetype mimetype = mimetypes.guess_type(record.name)[0] File "/usr/lib/python3.5/mimetypes.py", line 289, in guess_type return _db.guess_type(url, strict) File "/usr/lib/python3.5/mimetypes.py", line 114, in guess_type scheme, url = urllib.parse.splittype(url) File "/usr/lib/python3.5/urllib/parse.py", line 861, in splittype match = _typeprog.match(url) TypeError: expected string or bytes-like object 2019-02-07 12:40:18,018 16426 ERROR production odoo.http: Exception during JSON request handling. Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/fields.py", line 937, in get value = record.env.cache.get(record, self) File "/home/odoo/odoo-server/odoo/api.py", line 960, in get value = self._data[field][record.id][key] KeyError: <odoo.api.Environment object at 0x7fe500216c50>

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/odoo/odoo-server/odoo/http.py", line 651, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/home/odoo/odoo-server/odoo/http.py", line 310, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/home/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise raise value File "/home/odoo/odoo-server/odoo/http.py", line 693, in dispatch result = self._call_function(self.params) File "/home/odoo/odoo-server/odoo/http.py", line 342, in _call_function return checked_call(self.db, *args, *kwargs) File "/home/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper return f(dbname, args, kwargs) File "/home/odoo/odoo-server/odoo/http.py", line 335, in checked_call result = self.endpoint(*a, kw) File "/home/odoo/odoo-server/odoo/http.py", line 937, in call return self.method(*args, *kw) File "/home/odoo/odoo-server/odoo/http.py", line 515, in response_wrap response = f(args, kw) File "/home/odoo/odoo-server/addons/web/controllers/main.py", line 938, in call_button action = self._call_kw(model, method, args, {}) File "/home/odoo/odoo-server/addons/web/controllers/main.py", line 926, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/home/odoo/odoo-server/odoo/api.py", line 689, in call_kw return call_kw_multi(method, model, args, kwargs) File "/home/odoo/odoo-server/odoo/api.py", line 680, in call_kw_multi result = method(recs, *args, *kwargs) File "", line 2, in button_immediate_install File "/home/odoo/odoo-server/odoo/addons/base/module/module.py", line 71, in check_and_log return method(self, args, **kwargs) File "/home/odoo/odoo-server/odoo/addons/base/module/module.py", line 449, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/home/odoo/odoo-server/odoo/addons/base/module/module.py", line 542, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/home/odoo/odoo-server/odoo/modules/registry.py", line 85, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/odoo/odoo-server/odoo/modules/loading.py", line 380, in load_modules loaded_modules, update_module, models_to_check) File "/home/odoo/odoo-server/odoo/modules/loading.py", line 274, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/home/odoo/odoo-server/odoo/modules/loading.py", line 153, in load_module_graph registry.init_models(cr, model_names, {'module': package.name}) File "/home/odoo/odoo-server/odoo/modules/registry.py", line 314, in init_models models[0].recompute() File "/home/odoo/odoo-server/odoo/models.py", line 4905, in recompute vals = {n: rec[n] for n in ns} File "/home/odoo/odoo-server/odoo/models.py", line 4905, in vals = {n: rec[n] for n in ns} File "/home/odoo/odoo-server/odoo/models.py", line 4759, in getitem return self._fields[key].get(self, type(self)) File "/home/odoo/odoo-server/odoo/fields.py", line 941, in get self.determine_value(record) File "/home/odoo/odoo-server/odoo/fields.py", line 1028, in determine_value self.compute_value(recs) File "/home/odoo/odoo-server/odoo/fields.py", line 1008, in compute_value self._compute_value(records) File "/home/odoo/odoo-server/odoo/fields.py", line 999, in _compute_value getattr(records, self.compute)() File "/home/odoo/thirdparty/addons/muk_dms/models/dms_file.py", line 259, in _compute_mimetype record.mimetype = get_mimetype(record) File "/home/odoo/thirdparty/addons/muk_dms/models/dms_file.py", line 253, in get_mimetype mimetype = mimetypes.guess_type(record.name)[0] File "/usr/lib/python3.5/mimetypes.py", line 289, in guess_type return _db.guess_type(url, strict) File "/usr/lib/python3.5/mimetypes.py", line 114, in guess_type scheme, url = urllib.parse.splittype(url) File "/usr/lib/python3.5/urllib/parse.py", line 861, in splittype match = _typeprog.match(url) TypeError: expected string or bytes-like object

I tried to reverse my steps and uninstalled all of the 2.0 dependencies that I had succesfully installed, removed the newer modules, replaced the older 1.0 modules and updated the apps list, installed the dependencies successfully again, but then struck the same error when trying to install muk_dms (tried both 11.0.1.2.1 and 11.0.1.3.2 with the same result). Now I'm stuck.

Any suggestions?

I can access the database with PGAdmin 4 if that is of any use.

bennals commented 5 years ago

It seems that the tables muk_dms_file, muk_autovacuum_rules, and another one that I can't recall (muk_web_client_refresh maybe?) had not been properly dropped during the uninstall procedure. I used PGAdmin4 to drop the tables manually and was then able to install the latest version of muk_dms and all dependencies successfully.

Thanks again for the great community modules.