pymysql.err.InternalError: (1054, "Unknown column '6693f1d3a6' in 'field list'")

Error occurs when you roll over an Item code and the new V-12 Item Preview attempts to display.

pymysql.err.InternalError: (1054, “Unknown column ‘6693f1d3a6’ in ‘field list’”)

Traceback (most recent call last):
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 56, in execute_cmd
return, **frappe.form_dict)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/desk/”, line 27, in get_preview_data
}, fields=preview_fields, limit=1)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/”, line 1264, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/model/”, line 95, in execute
result = self.build_and_run()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/model/”, line 129, in build_and_run
return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug, update=self.update)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/database/”, line 171, in sql
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 328, in _query
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 732, in _read_query_result
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 684, in _read_packet
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 220, in check_error
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘6693f1d3a6’ in ‘field list’”)

I can confirm that the column it is referring to is the ‘item_code’ column (Verified by checking the meta data from tabItem).

Any ideas?

Github Issue Link: pymysql.err.InternalError: (1054, "Unknown column '6693f1d3a6' in 'field list'") · Issue #18724 · frappe/erpnext · GitHub

Is this an example of the Preview Data (from the online demo) that is the problem context?

Hi @clarkej. Yes thats the popup that is causing the issue. On our side, the popup doesn’t show, we instead get this error message.

Our apps:

Installed Apps
Bench Manager: v0.0.1 (develop)
ERPNext: v12.0.6 (version-12)
Frappe Framework: v12.0.6 (version-12)

I do encounter the same error, but on another page:

  1. Create a Sales Quotation
  2. Add an item, create a new item when adding the item
  3. Try to click in the item field again.

Also posted details about request and error message on github:

Installed Apps
ERPNext: v12.0.5 (version-12)
Frappe Framework: v12.0.5 (version-12)

Not sure, but this might be related:

@Mitchy25, @dasistwas

This should fix the issue. Will get it merged soon.