Error Migrating a Site after updating to v13

Please need help migrating a site after updating version to 13…Will appreciate an urgent fix

Updating DocTypes for erpnext : [=========== ] 55%

There was an issue while migrating the DocType: Stock Ledger Entry

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/opt/bench/fork/apps/frappe/frappe/utils/bench_helper.py”, line 99, in
main()
File “/opt/bench/fork/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/fork/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bench/fork/apps/frappe/frappe/commands/init.py”, line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/bench/fork/apps/frappe/frappe/commands/site.py”, line 287, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/opt/bench/fork/apps/frappe/frappe/migrate.py”, line 70, in migrate
frappe.model.sync.sync_all(verbose=verbose)
File “/opt/bench/fork/apps/frappe/frappe/model/sync.py”, line 19, in sync_all
sync_for(app, force, verbose=verbose, reset_permissions=reset_permissions)
File “/opt/bench/fork/apps/frappe/frappe/model/sync.py”, line 70, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/opt/bench/fork/apps/frappe/frappe/modules/import_file.py”, line 70, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/opt/bench/fork/apps/frappe/frappe/modules/import_file.py”, line 143, in import_doc
doc.insert()
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 264, in insert
self.run_post_save_methods()
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 960, in run_post_save_methods
self.run_method(“on_update”)
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 827, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 1119, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 1102, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bench/fork/apps/frappe/frappe/model/document.py”, line 821, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/opt/bench/fork/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 273, in on_update
raise e
File “/opt/bench/fork/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 270, in on_update
frappe.db.updatedb(self.name, Meta(self))
File “/opt/bench/fork/apps/frappe/frappe/database/mariadb/database.py”, line 292, in updatedb
db_table.sync()
File “/opt/bench/fork/apps/frappe/frappe/database/schema.py”, line 37, in sync
self.alter()
File “/opt/bench/fork/apps/frappe/frappe/database/mariadb/schema.py”, line 88, in alter
raise e
File “/opt/bench/fork/apps/frappe/frappe/database/mariadb/schema.py”, line 75, in alter
frappe.db.sql(query)
File “/opt/bench/fork/apps/frappe/frappe/database/database.py”, line 173, in sql
self._cursor.execute(query)
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/opt/bench/fork/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1292, “Truncated incorrect INTEGER value: ‘No’”)

It may help to say the commands that were used to attempt the upgrade. Have you tried bench update --reset ?

Yes i have …it get stuck when its gets to migrating the site

Try switching back to 12 ?

bench switch-to-branch version-12

Hellow, Did you manage to solve this

i have the same issue

I resolved the issue with the follow steps:

#Connet to Mariadb
bench --site mydomain.gsoftinnovation.net mariadb

#Select the erpnext db
show databases;
user _32a16936adc59731;

#Eliminate the value STRICT_TRANS_TABLES in “sql_mode” variable
SHOW VARIABLES LIKE ‘sql_mode’;
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SET GLOBAL sql_mode = ‘ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;

#Continue the intallation with the command
bench update --patch

1 Like