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/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/desk/link_preview.py”, line 27, in get_preview_data
}, fields=preview_fields, limit=1)
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/init.py”, 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/db_query.py”, line 95, in execute
result = self.build_and_run()
File “/home/frappe/frappe-bench-dev/apps/frappe/frappe/model/db_query.py”, 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/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/connections.py”, 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/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench-dev/env/lib/python3.6/site-packages/pymysql/err.py”, 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)

Hi,
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:
https://github.com/frappe/erpnext/issues/18724#issuecomment-521575759

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

Not sure, but this might be related:

@Mitchy25, @dasistwas

https://github.com/frappe/frappe/pull/8184

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

Best,
Suraj