Back up restore and migration error on V12 pymysql.err.InternalError: (1054, "Unknown column X in 'field list'")


I tried to back up from my V11 server and restored to V12 server and got me below error on migrating the site.

Any idea?

sanath@vmi322732:~/frappe-bench$ bench --site 8200 migrate
Migrating 8200
Executing frappe.patches.v12_0.remove_deprecated_fields_from_doctype #3 in 8200 (_c618cc05e52f3bd8)
Success: Done in 1.055s
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘comment’) in 8200 (_c618 cc05e52f3bd8)
Success: Done in 0.319s
Executing execute:frappe.reload_doc(‘email’, ‘doctype’, ‘document_follow’) in 82 00 (_c618cc05e52f3bd8)
Traceback (most recent call last):
File “/usr/lib/python3.5/”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/”, line 85, in _run_code
exec(code, run_globals)
File “/home/sanath/frappe-bench/apps/frappe/frappe/utils/”, lin e 97, in
File “/home/sanath/frappe-bench/apps/frappe/frappe/utils/”, lin e 18, in main
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 764, in call
return self.main(*args, **kwargs)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 717, in main
rv = self.invoke(ctx)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/” , line 555, in invoke
return callback(*args, **kwargs)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/decorato”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/commands/”, line 25, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/commands/”, line 239 , in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip
File “/home/sanath/frappe-bench/apps/frappe/frappe/”, line 48, in mi grate
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, line 41, in run_all
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, line 89, in execute_patch
File “”, line 1, in
File “/home/sanath/frappe-bench/apps/frappe/frappe/”, line 817, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissi ons=reset_permissions)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, line 174 , in reload_doc
return import_files(module, dt, dn, force=force, reset_permissions=reset_per missions)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, li ne 27, in import_files
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, li ne 32, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process, reset_permis sions=reset_permissions)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, li ne 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/”, li ne 141, in import_doc
File “/home/sanath/frappe-bench/apps/frappe/frappe/model/”, line 24 5, in insert
File “/home/sanath/frappe-bench/apps/frappe/frappe/model/”, li ne 324, in db_insert
), list(d.values()))
File “/home/sanath/frappe-bench/apps/frappe/frappe/database/”, line 156, in sql
self._cursor.execute(query, values)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor”, line 170, in execute
result = self._query(query)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor”, line 328, in _query
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec”, line 732, in _read_query_result
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec”, line 684, in _read_packet
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/protoc”, line 220, in check_error
File "/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/ ", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, "Unknown column ‘hide_heading’ in ‘field list’ ")

I did get mine figured out. I found help on another post, the key for me was to run the following from the frappe-bench folder:
“bench --site site1.local execute frappe.model.sync.sync_all”
(site1.local happens to be my sitename)
After this, I had rebooted the vm and also cleared my browser cache. This command syncs the database or something.

I saw on another post that another method could be to simply run “bench update”, but making sure to STOP bench before running that command. I did not try this, but its another thing to try if the above doesn’t work for others.

Hope this helps someone out there. I was freaked out until I ran across this fix.

Many thanks for this learning

Perhaps this thread Bench update issue -error 1054 - #2 by MCD-50

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.