-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
[12 -> 13.0] muk_dms: OpenUpgrade: dms: error in migration script /opt/odoo/lib/addons/oca-mirror-dms/dms/migrations/13.0.8.1.0/post-migration.py: ('dms.file(3249,).content', None) #4881 #394
Comments
Moved here from OCA/OpenUpgrade#4881 as requested by @victoralmau |
Repeat comment by @victoralmau with explanation: The problem is related to the dms code and/or the migration scripts included there. I explain what happens: Running https://github.com/OCA/dms/blob/13.0/dms/migrations/13.0.8.1.0/post-migration.py#L9 produces the error you indicate. Line 395 in ca641ce
The reason why the error is displayed is because none of the 3 conditions are met, i.e. the file does not have content_file, content_binary or attachment_id defined. What is the reason why none of these values are defined in this (maybe other) file(s)? The solution will be to define one of those values to all files. Another possibility would be to modify in dms 13.0 to make it possible to have the content field empty (this option would not be the most appropriate). |
Here is the content of the original row in table
The dms is working fine in v12 for that file, though it seems to be a bogus and unneeded entry.
This again has a strange name starting with A search shows only those two files with such strange name, so I delete them both for test purposes before the migration. The next failure then is related to
I've also checked that the content for the files is actually available in the volumes of the docker container: wagner@odoo-mig-1:/opt/dconf/odoo-v13-ou$ docker-compose exec odoo /bin/bash -c 'ls -l /var/lib/odoo/files/elego_erp_v12/14/1432a4d25b5a44945dfa11beaeff557fef09d2ad'
-rw-r--r-- 1 odoo odoo 162 Jan 23 2021 /var/lib/odoo/files/elego_erp_v12/14/1432a4d25b5a44945dfa11beaeff557fef09d2ad
wagner@odoo-mig-1:/opt/dconf/odoo-v13-ou$ docker-compose exec odoo /bin/bash -c 'ls -l /var/lib/odoo/files/elego_erp_v12/9f/9f127ea69ba96dd62530bd17160ffe579574ad0a'
-rw-r--r-- 1 odoo odoo 27098 Jan 23 2021 /var/lib/odoo/files/elego_erp_v12/9f/9f127ea69ba96dd62530bd17160ffe579574ad0a It might be something simple I'm missing and overlooking all the time. I'd still guess it is related to the errors previously reported from the openupgradelib:
|
The problem is that the value of the |
I think the problem is because the DMS files are stored in a non compatible storage. MuK had other storages that are not supported by OCA. |
It is correct that MuK DMS uses separate fielstores, though they have the same structure as the ones used by Odoo for the attachments. I have copied that filestore (below /var/lib/odoo/files) manually and mounted in the correct location into the docker image. |
I think that's the problem indeed. |
I have tried sudo rsync -au /var/lib/odoo/files/elego.erp_v12/elego_erp_v12/ /var/lib/odoo/filestore/odoo-v13/elego_v13/
sudo chown -R odoo:odoo /var/lib/odoo/filestore/odoo-v13/elego_v13/ now but the migration still aborts with the cache miss :-| |
We did the migration from MuK DMS 12 to 13 with these scripts and worked, but it was a long time ago and don't remember the details of the used storage, sorry. About the warning |
Thank you, that's valuable information, Pedro. And it's really good to know that is has worked once before :-) |
I just want to post some updates here in case anybody else is interested. Things are progressing slowly.
The latter can easily be fixed by alter table muk_security_access_groups_users_rel rename to dms_access_group_users_rel but we should probably also add a proper table renaming at the right position in the python code. I'll report here with some patches as soon as we have them. |
I think this is the proper patch for the missing rename: diff --git a/dms/migrations/13.0.1/pre-migration.py b/dms/migrations/13.0.1/pre-migration.py
index 0e739fae..f655daae 100644
--- a/dms/migrations/13.0.1/pre-migration.py
+++ b/dms/migrations/13.0.1/pre-migration.py
@@ -23,6 +23,7 @@ _table_renames = [
("muk_dms_directory_tag_rel", "dms_directory_tag_rel"),
("muk_dms_directory_star_rel", "dms_directory_star_rel"),
("muk_security_access_groups", "dms_access_group"),
+ ("muk_security_access_groups_users_rel", "dms_access_group_users_rel"),
("muk_security_groups_explicit_users_rel", "dms_access_group_explicit_users_rel"),
# Security Mixin relation tables
("muk_dms_directory_groups_rel", "dms_directory_groups_rel"), |
When I run the migration in 13.0, it fails in the postmigration step for the dms. Im am using the latest versions of the openupgradelib (3.9.3) and the 13.0 branch from openupgrade itself.
Module
dms
Describe the bug
Post-migration script fails with this error:
This may be a subsequent error, as I see some of these error logs before:
I haven’t been able to isolate the problem further yet.
The actual data — dms.file(3249) — is there and should be correct (at least in the MuK tables); content is
one of the columns that are new or migrated.
To Reproduce
Expected behavior
Migration from muk_dms to dms should not fail.
Additional context
OpenUpgrade is run in a docker-container with OpenUpgrade 13 mounted as Odoo repository.
Some version information:
All errors from upgrade log:
Complete log attached.
elego-mig-v13-ou.log
The text was updated successfully, but these errors were encountered: