ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

InternalError: (1054, u"Unknown column 'ref_type' in 'where clause'")

installation_problem

#1

Getting following error on fresh install of erpnext. tried updating bench but it didn’t work.I am new to erpnext. Kindly help me out.

Traceback (most recent call last):
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 259, in save
return self._save(*args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 282, in _save
self.insert()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 248, in insert
self.run_post_save_methods()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 915, in run_post_save_methods
self.run_method(“on_update”)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 780, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 774, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/crm/doctype/lead/lead.py”, line 60, in on_update
self.add_calendar_event()
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/crm/doctype/lead/lead.py”, line 70, in add_calendar_event
}, force)
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/utilities/transaction_base.py”, line 36, in add_calendar_event
self.delete_events()
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/utilities/transaction_base.py”, line 41, in delete_events
where ref_type=%s and ref_name=%s""", (self.doctype, self.name))
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/database/database.py”, line 221, in sql_list
return [r[0] for r in self.sql(query, values, debug=debug)]
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/database/database.py”, line 154, in sql
self._cursor.execute(query, values)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 516, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 727, in _read_query_result
result.read()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1066, in read
first_packet = self.connection._read_packet()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 683, in _read_packet
packet.check_error()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
InternalError: (1054, u"Unknown column ‘ref_type’ in ‘where clause’")

Traceback (most recent call last):
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/handler.py”, line 20, in handle
data = execute_cmd(cmd)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/handler.py”, line 55, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/init.py”, line 1007, in call
return fn(*args, **newargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 259, in save
return self._save(*args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 282, in _save
self.insert()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 248, in insert
self.run_post_save_methods()
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 915, in run_post_save_methods
self.run_method(“on_update”)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 780, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/model/document.py”, line 774, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/crm/doctype/lead/lead.py”, line 60, in on_update
self.add_calendar_event()
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/crm/doctype/lead/lead.py”, line 70, in add_calendar_event
}, force)
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/utilities/transaction_base.py”, line 36, in add_calendar_event
self.delete_events()
File “/home/guest/tutorial/python/erp_test/apps/erpnext/erpnext/utilities/transaction_base.py”, line 41, in delete_events
where ref_type=%s and ref_name=%s""", (self.doctype, self.name))
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/database/database.py”, line 221, in sql_list
return [r[0] for r in self.sql(query, values, debug=debug)]
File “/home/guest/tutorial/python/erp_test/apps/frappe/frappe/database/database.py”, line 154, in sql
self._cursor.execute(query, values)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 516, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 727, in _read_query_result
result.read()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1066, in read
first_packet = self.connection._read_packet()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 683, in _read_packet
packet.check_error()
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/guest/tutorial/python/erp_test/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
InternalError: (1054, u"Unknown column ‘ref_type’ in ‘where clause’")


#2

Try

bench update --reset

or

bench update --patch


#3

Didn’t work. There was error in the code i raised issue for it which got fixed issue #15627


#4