Bench update on custom app failing

Hi Team,

When doing a bench update im getting this error, and I think its relating to a site I have that is a non-erpnext site. Just used frappe to write an app:

Executing frappe.patches.v7_1.sync_language_doctype in rounds.pema.co.za (950b1c474c)
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/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/hemant/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/hemant/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/hemant/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/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/hemant/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/hemant/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/hemant/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/hemant/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/hemant/frappe-bench/apps/frappe/frappe/patches/v7_1/sync_language_doctype.py”, line 5, in execute
frappe.reload_doc(‘core’, ‘doctype’, ‘language’)
File “/home/hemant/frappe-bench/apps/frappe/frappe/init.py”, line 645, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 141, in reload_doc
return import_files(module, dt, dn, force=force)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 17, in import_files
return import_file(module, dt, dn, force=force, pre_process=pre_process)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 22, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 54, in import_file_by_path
import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
doc.insert()
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_post_save_methods()
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods
self.run_method(“on_update”)
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 654, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 882, in composer
return composed(self, method, *args, **kwargs)
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 865, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 648, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/hemant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 142, in on_update
updatedb(self.name, self)
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 69, in updatedb
tab.sync()
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 146, in sync
self.create()
File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 181, in create
engine=self.meta.engine or ‘InnoDB’) % (self.name, add_text))
AttributeError: ‘DocType’ object has no attribute ‘engine’

Awaiting some feedback.

regards
Hemant

you need to set the engine in doctype …do bench update if field is not there

Hi @JoEz

I have this site on a multitenant setup and I dont need ‘engine’ doctype in this site. I see its trying to do the 7.1 update so I think there is an issue still with that update, cause the other updates did not break when I ran.

Maybe I should raise an issue on git?

regards
Hemant

Hi there,

I have same problem here!!

do u have the red highlighted field in the pic?

Oh I see what you mean by engine, but cannot log in to site cause of error after update, this is what shows on main page

Traceback (most recent call last):
File “/home/hemant/frappe-bench/apps/frappe/frappe/website/render.py”, line 32, in render
data = render_page_by_language(path)
File “/home/hemant/frappe-bench/apps/frappe/frappe/website/render.py”, line 88, in render_page_by_language
user_lang = guess_language(translated_languages)
File “/home/hemant/frappe-bench/apps/frappe/frappe/translate.py”, line 27, in guess_language
lang_list = get_all_languages() or []
File “/home/hemant/frappe-bench/apps/frappe/frappe/translate.py”, line 82, in get_all_languages
return frappe.cache().get_value(‘languages’, _get)
File “/home/hemant/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 68, in get_value
val = generator()
File “/home/hemant/frappe-bench/apps/frappe/frappe/translate.py”, line 81, in _get
return frappe.db.sql_list(‘select name from tabLanguage’)
File “/home/hemant/frappe-bench/apps/frappe/frappe/database.py”, line 205, in sql_list
return [r[0] for r in self.sql(query, values, debug=debug)]
File “/home/hemant/frappe-bench/apps/frappe/frappe/database.py”, line 148, in sql
self._cursor.execute(query)
File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, “Table ‘e7d1040a24.tabLanguage’ doesn’t exist”)

try bench migrate

nope, still get error regarding engine… there must be a way to go back to last best config, cause now site is down…

I think I have to figure out a better way to update, i have tried on my vm and it broke there but so slow so tought just to do it on production - my stupidity…

Im sure there will be a fix cause other will experience similar, unless you can help in the mean time to by pass this issue, cause all the sites on this server are not able to login

regards

can u post the log of the error?

I’m having the same issue today- I don’t have the “Database Engine” block in DocType. And getting a missing module xlwt, but I have installed it:

$ bench migrate
Migrating erp.agtonik.com
Updating frappe                     : [=======================                 ]Module import failed for Auto Email Report (frappe.email.doctype.auto_email_report.auto_email_report)
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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/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/ubuntu/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/ubuntu/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/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/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/ubuntu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 32, in migrate
    frappe.model.sync.sync_all(verbose=verbose)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/sync.py", line 19, in sync_all
    sync_for(app, force, verbose=verbose)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/sync.py", line 44, in sync_for
    import_file_by_path(doc_path, force=force)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 122, in import_doc
    doc.insert()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 222, in insert
    self.run_post_save_methods()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in run_post_save_methods
    self.run_method("on_update")
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 654, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 882, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 865, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 648, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 154, in on_update
    self.run_module_method("on_doctype_update")
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 163, in run_module_method
    module = load_doctype_module(self.name, self.module)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py", line 171, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(module_name)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 654, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 10, in <module>
    from frappe.utils.xlsutils import get_xls
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/xlsutils.py", line 3, in <module>
    import frappe, xlwt, StringIO, datetime
ImportError: No module named xlwt

Hi @JoEz

This is what I get when I do an update on production:
hemant@VarmaniHQ:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling varmani
    From https://github.com/Varmani/varmani
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling rounds
    From https://github.com/hpema/rounds
  • branch master -> FETCH_HEAD
    Already up-to-date.
    /home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Migrating erp.phmarketing.co.za
    Updating frappe : [========================================]
    Updating erpnext : [========================================]
    Syncing help database…
    Migrating rounds.pema.co.za
    Executing frappe.patches.v7_1.setup_integration_services #2016-09-16 in rounds.pema.co.za (950b1c474c)
    Module import failed for Dropbox Integration Settings (frappe.core.doctype.dropbox_integration_settings.dropbox_integration_settings)
    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/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/hemant/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/hemant/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/hemant/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/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/hemant/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/hemant/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe.dict(ctx.obj), *args, **kwargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/patches/v7_1/setup_integration_services.py”, line 21, in execute
    setup_integration_service(app_details)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/patches/v7_1/setup_integration_services.py”, line 33, in setup_integration_service
    settings = get_app_settings(app_details)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/patches/v7_1/setup_integration_services.py”, line 58, in get_app_settings
    controller = get_integration_controller(app_details[“service_name”])
    File “/home/hemant/frappe-bench/apps/frappe/frappe/integration_broker/doctype/integration_service/integration_service.py”, line 90, in get_integration_controller
    frappe.throw(
    (“Module {service} not found”.format(service=service_name)))
    File “/home/hemant/frappe-bench/apps/frappe/frappe/init.py”, line 300, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/init.py”, line 293, in msgprint
    _raise_exception()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/init.py”, line 266, in _raise_exception
    raise raise_exception, encode(msg)
    frappe.exceptions.ValidationError: Module Dropbox Integration not found
    hemant@VarmaniHQ:~/frappe-bench$

and this is on the VM:
hemant@ubuntu:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
remote: Counting objects: 232, done.
remote: Total 232 (delta 179), reused 179 (delta 179), pack-reused 53
Receiving objects: 100% (232/232), 52.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (193/193), completed with 88 local objects.
From https://github.com/frappe/frappe
25608cc…8f6d3d9 develop -> upstream/develop
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling varmani
    From https://github.com/Varmani/varmani
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling rounds
    From https://github.com/hpema/rounds
  • branch master -> FETCH_HEAD
    Already up-to-date.
    /home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Migrating rounds
    Executing frappe.patches.v7_1.sync_language_doctype in rounds (75a7b39524)
    Success
    Executing frappe.patches.v7_1.rename_chinese_language_codes in rounds (75a7b39524)
    Success
    Executing frappe.patches.v7_1.setup_integration_services #2016-09-16 in rounds (75a7b39524)
    Success
    Executing execute:frappe.core.doctype.language.language.update_language_names() in rounds (75a7b39524)
    Success
    Executing execute:frappe.db.set_default(‘language’, ‘’) in rounds (75a7b39524)
    Success
    Executing frappe.patches.v7_1.refactor_integration_broker in rounds (75a7b39524)
    Success
    Updating frappe : [========================================]
    Updating rounds : [========================================]
    Syncing help database…
    Migrating site1.local
    Executing frappe.patches.v7_1.rename_scheduler_log_to_error_log in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2016-10-17 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘user’) in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.clear_cache() in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v7_1.sync_language_doctype in site1.local (1bd3e0294d)
    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/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/hemant/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/hemant/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/hemant/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/hemant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/hemant/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/hemant/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/patches/v7_1/sync_language_doctype.py”, line 5, in execute
    frappe.reload_doc(‘core’, ‘doctype’, ‘language’)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/init.py”, line 645, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 141, in reload_doc
    return import_files(module, dt, dn, force=force)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 17, in import_files
    return import_file(module, dt, dn, force=force, pre_process=pre_process)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 22, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
    doc.insert()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
    self.run_post_save_methods()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 771, in run_post_save_methods
    self.run_method(“on_update”)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 654, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 882, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 865, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py”, line 648, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 142, in on_update
    updatedb(self.name, self)
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 69, in updatedb
    tab.sync()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 146, in sync
    self.create()
    File “/home/hemant/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 181, in create
    engine=self.meta.engine or ‘InnoDB’) % (self.name, add_text))
    AttributeError: ‘DocType’ object has no attribute ‘engine’
    hemant@ubuntu:~/frappe-bench$

This fixed it:

./env/bin/pip install -r -U ./apps/frappe/requirements.txt

and I could then:

bench migrate.

Then, due to locally modified files, i had to cd erpnext and

git stash

Then it worked!

bench update