I had migrated from an old server to a new one, using the bench backup method and in the new one using the bench restore --force, everything was fine, until a user was required to change password and role from the Administrator user, but this error occurred with the following message:
App Versions
{
"chat": "0.0.1",
"ecommerce_integrations": "1.19.6",
"education": "15.0.0",
"erpnext": "14.57.0",
"erpnext_shipping": "0.0.1",
"frappe": "14.61.0",
"frappe_whatsapp": "0.0.2",
"healthcare": "15.0.0-dev",
"helpdesk": "0.10.0",
"hospitality": "0.0.1",
"hr_addon": "0.0.1",
"hrms": "16.0.0-dev",
"mautic": "1.3.7",
"non_profit": "0.0.1",
"payments": "0.0.1",
"posawesome": "6.1.3"
}
Route
Form/User/Administrator
Traceback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 95, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 47, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1628, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs
doc.save()`your text`
File "apps/frappe/frappe/model/document.py", line 309, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 360, in _save
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1109, in run_post_save_methods
self.save_version()
File "apps/frappe/frappe/model/document.py", line 1233, in save_version
if is_useful_diff := version.update_version_info(doc_to_compare, self):
File "apps/frappe/frappe/core/doctype/version/version.py", line 18, in update_version_info
return self.set_diff(old, new)
File "apps/frappe/frappe/core/doctype/version/version.py", line 22, in set_diff
diff = get_diff(old, new)
File "apps/frappe/frappe/core/doctype/version/version.py", line 111, in get_diff
diff = get_diff(old_rows_by_name[old_row_name], d, for_child=True)
File "apps/frappe/frappe/core/doctype/version/version.py", line 125, in get_diff
new_value = new.get_formatted(df.fieldname) if new_value else new_value
File "apps/frappe/frappe/model/base_document.py", line 1145, in get_formatted
return format_value(val, df=df, doc=doc, currency=currency, format=format)
File "apps/frappe/frappe/utils/formatters.py", line 102, in format_value
if not BLOCK_TAGS_PATTERN.search(value):
TypeError: expected string or bytes-like object
Response Data
{
"exception": "TypeError: expected string or bytes-like object"
}
I really tried to check if any database schema had changed during the migration but so far I have not been able to find a solution...
Migration from old to new versions:
- ERPNext: v14.34.0 > v14.57.0
- Frappe Framework: v14.44.0 > v14.61.0
- Frappe HR: v15.0.0-dev > v16.0.0-dev