Closed rajwrdhn closed 3 years ago
It seems your deployment is not correct and gives an error that is not directly related to OpenUpgrade itself. You have to check your deployed libraries, and also the encoding settings that leads to be decoded as CP-1252.
Closing as no directly related. If you think you can improve the call to force an encoding, please open a PR.
I had to insert encoding = 'utf-8' in the pre_migration,py file while opening the .csv file (line number 587-588)
Your system seems to be configured in a way that doesn't recognize automatically the encoding. That's not usual and you should check, as there will be problems not only here, but in other parts of Odoo.
I did not have any other charmap or character encoding error. The other errors were totally different. I have migrated to Odoo13 , will check and test. if something is wrong will post again.
Edit: The installations of requirements were not the same versions as instructed, thats why i had the problem. Thank you for your help!
I have the same problem. The database is migrated from version10 to version 12. When I try the migration to the version 13 in the same way it gives me the error:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\encodi
ngs\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 6004: cha
racter maps to
I tried to make an openupgrade from version 12 to 12 and It don't give me any errors,.
Can you help me?
Thanks in advance.
The same explanation: incorrect character encoding in your end. Please use a virtualization layer like Docker, Doodba or similar for avoiding these problems.
But... If it is a problem in the character encoding, why openupgrade 12 in the same bbdd 12 don't give me any error?
Thanks
Because in that occasion, there's no CSV import. If you have an alternative for not depending on the encoding, please propose a PR.
Hola, las pruebas las he realizado en diversas máquina virtuales con diferentes sistemas operativos, Windows Server, y siempre obtengo el mismo resultado. Este mismo proceso lo realice hace unos meses sin problema con las mismas configuraciones y no tuve problemas. Se te ocurre alguna idea o algo que pueda hacer para solventarlo?
He visto mas arriba que rajwrdhn incluyó encoding = 'utf-8' en el archivo pre_migration, eso me lo puede solventar?
Gracias de nuevo
I did not have any other charmap or character encoding error. The other errors were totally different. I have migrated to Odoo13 , will check and test. if something is wrong will post again.
Edit: The installations of requirements were not the same versions as instructed, thats why i had the problem. Thank you for your help!
@rajwrdhn what did you do to fix the problem? I'm facing the same now migrating from 12 to 13, I checked the version of every package in requirements.txt file inside OpenUpgrade folder and still got the same problem you had
Impacted versions: OpenUpgrade: base: error in migration script base\migrations\13.0.1.3\pre-migration.py: 'charmap' codec can't decode byte 0x81 in position 6004 Steps to reproduce:
Current behavior:
Expected behavior:
Video/Screenshot link (optional): 2020-11-25 16:24:11,874 2436 ERROR test_first_12-to-13 OpenUpgrade: base: error in migration script base\migrations\13.0.1.3\pre-migration.py: 'charmap' codec can't decode byte 0x81 in position 6004: character maps to
2020-11-25 16:24:11,875 2436 ERROR test_first_12-to-13 OpenUpgrade: 'charmap' codec can't decode byte 0x81 in position 6004: character maps to
Traceback (most recent call last):
File "C:\Code\odoo-mig-13\Venv\lib\site-packages\openupgradelib\openupgrade.py", line 1796, in wrapped_function
if use_env2 else cr, version)
File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 790, in migrate
fix_country_state_xml_id_on_existing_records(env.cr)
File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 591, in fix_country_state_xml_id_on_existing_records
for row in states:
File "C:\Python37\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 6004: character maps to
2020-11-25 16:24:11,899 2436 WARNING test_first_12-to-13 odoo.modules.loading: Transient module states were reset
2020-11-25 16:24:11,900 2436 ERROR test_first_12-to-13 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "C:\Code\odoo-mig-13\Sources\odoo\modules\registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Code\odoo-mig-13\Sources\odoo\modules\loading.py", line 413, in load_modules
report=report, models_to_check=models_to_check, upg_registry=upg_registry)
File "C:\Code\odoo-mig-13\Sources\odoo\modules\loading.py", line 190, in load_module_graph
migrations.migrate_module(package, 'pre')
File "C:\Code\odoo-mig-13\Sources\odoo\modules\migration.py", line 185, in migrate_module
migrate(self.cr, installed_version)
File "C:\Code\odoo-mig-13\Venv\lib\site-packages\openupgradelib\openupgrade.py", line 1796, in wrapped_function
if use_env2 else cr, version)
File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 790, in migrate
fix_country_state_xml_id_on_existing_records(env.cr)
File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 591, in fix_country_state_xml_id_on_existing_records
for row in states:
File "C:\Python37\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 6004: character maps to
2020-11-25 16:24:11,917 2436 CRITICAL test_first_12-to-13 odoo.service.server: Failed to initialize database
test_first_12-to-13
. Traceback (most recent call last): File "C:\Code\odoo-mig-13\Sources\odoo\service\server.py", line 1190, in preload_registries registry = Registry.new(dbname, update_module=update_module) File "C:\Code\odoo-mig-13\Sources\odoo\modules\registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "C:\Code\odoo-mig-13\Sources\odoo\modules\loading.py", line 413, in load_modules report=report, models_to_check=models_to_check, upg_registry=upg_registry) File "C:\Code\odoo-mig-13\Sources\odoo\modules\loading.py", line 190, in load_module_graph migrations.migrate_module(package, 'pre') File "C:\Code\odoo-mig-13\Sources\odoo\modules\migration.py", line 185, in migrate_module migrate(self.cr, installed_version) File "C:\Code\odoo-mig-13\Venv\lib\site-packages\openupgradelib\openupgrade.py", line 1796, in wrapped_function if use_env2 else cr, version) File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 790, in migrate fix_country_state_xml_id_on_existing_records(env.cr) File "C:\Code\odoo-mig-13\Sources\odoo\addons\base\migrations\13.0.1.3\pre-migration.py", line 591, in fix_country_state_xml_id_on_existing_records for row in states: File "C:\Python37\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 6004: character maps to