ERPNext Conference 2019* ERPNext.com Blog

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


#1

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: https://github.com/frappe/erpnext/issues/18724


#2

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


#3

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)


#4

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:

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


#5

Not sure, but this might be related:


#6

@Mitchy25, @dasistwas

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

Best,
Suraj


#7