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

Hi,

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/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/sanath/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 97, in
main()
File “/home/sanath/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 764, in call
return self.main(*args, **kwargs)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 717, in main
rv = self.invoke(ctx)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , 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/core.py” , 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/core.py” , line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 555, in invoke
return callback(*args, **kwargs)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/click/decorato rs.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/commands/site.py”, line 239 , in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip
failing)
File “/home/sanath/frappe-bench/apps/frappe/frappe/migrate.py”, line 48, in mi grate
frappe.modules.patch_handler.run_all(skip_failing)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 89, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/sanath/frappe-bench/apps/frappe/frappe/init.py”, 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/utils.py”, 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/import_file.py”, li ne 27, in import_files
reset_permissions=reset_permissions)
File “/home/sanath/frappe-bench/apps/frappe/frappe/modules/import_file.py”, 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/import_file.py”, 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/import_file.py”, li ne 141, in import_doc
doc.insert()
File “/home/sanath/frappe-bench/apps/frappe/frappe/model/document.py”, line 24 5, in insert
self.db_insert()
File “/home/sanath/frappe-bench/apps/frappe/frappe/model/base_document.py”, li ne 324, in db_insert
), list(d.values()))
File “/home/sanath/frappe-bench/apps/frappe/frappe/database/database.py”, line 156, in sql
self._cursor.execute(query, values)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor s.py”, line 170, in execute
result = self._query(query)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursor s.py”, line 328, in _query
conn.query(q)
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, 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 tions.py”, line 732, in _read_query_result
result.read()
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/connec tions.py”, line 684, in _read_packet
packet.check_error()
File “/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/protoc ol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File "/home/sanath/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py ", 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.