ERPNext Conference 2019* ERPNext.com Blog

Unknown column 'from_date' in 'field list' (update error, uh oh)


#1

I tried pulling the latest develop branch in hopes that a couple of issues that were posted on github had been fixed.

I got stuck with this error, and a site that shows the Updating screen

Migrating site1.local Executing erpnext.patches.v7_2.move_dates_from_salary_structure_to_employee in site1.local (1bd3e0294da19198) Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module> main() File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main click.Group(commands=commands)(prog_name='bench') File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate migrate(context.verbose, rebuild_website=rebuild_website) File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 30, in migrate frappe.modules.patch_handler.run_all() File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all if not run_single(patchmodule = patch): File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single return execute_patch(patchmodule, method, methodargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch frappe.get_attr(patchmodule.split()[0] + ".execute")() File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v7_2/move_dates_from_salary_structure_to_employee.py", line 9, in execute where parent = %s """, (salary_structure.from_date, salary_structure.to_date or 'null', salary_structure.name)) File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 138, in sql self._cursor.execute(query, values) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1054, "Unknown column 'from_date' in 'field list'")

bench update --patch, and bench migrate didn’t help the issue. Is this a problem with my database/customizations that requires something to be done through bench mysql? I did stash any small changes I had made… Or is it an issue in the patch?

Thank you!!


#2

I was reading that Bench export-fixtures Would remove any problem filters, seems not to be the fix for this one. Posting for future reference for myself or others experiencing similar issue


#3

Switch-to-master and then switch-to-develop seemed to work, however every document created for the last month has been showing the history as “a few seconds ago”. Is there actually something missing in my database? I’ve been on the dev branch since the beginning


#4

Pushed a fix, please try to update again.


#5

Faced same problem for Payment Entry when a debtor record from Journal Entry was in outstanding, Journal Entry was missing from_date and to_date for Auto Repeat in below version:

  • ERPNext: v12.1.1 (version-12)
  • Frappe Framework: v12.0.11 (version-12)

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

Added the two fields in customize form under the Auto Repeat section and it worked.


#6

Had the same problem on

ERPNext: v11.1.42 (master)
Frappe Framework: v11.1.37 (master)