Error while running bench update - No module named dynamic_link.dynamic_link

Hi,

I restored a site on a new installation and am getting this error while running bench migrate and bench update. Can you please help?

bench update
INFO:bench.utils:updating bench
Already up-to-date.
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 5 (delta 4), reused 5 (delta 4), pack-reused 0
Unpacking objects: 100% (5/5), done.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
0a844d1…6bdb453 develop → upstream/develop
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling pppl
    From GitHub - umaepoch/pppl: Periyar
  • branch master → FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Migrating site1.local
    Executing erpnext.patches.v7_2.contact_address_links in site1.local (1bd3e0294da19198)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 174, 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/user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
    return self.main(*args, **kwargs)
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
    rv = self.invoke(ctx)
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/home/user/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/user/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/user/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/user/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/user/frappe-bench/apps/frappe/frappe/init.py”, line 877, in get_attr
    return getattr(get_module(modulename), methodname)
    File “/home/user/frappe-bench/apps/frappe/frappe/init.py”, line 662, 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/user/frappe-bench/apps/erpnext/erpnext/patches/v7_2/contact_address_links.py”, line 2, in
    from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links
    ImportError: No module named dynamic_link.dynamic_link

I somehow copied the modules dynamic_link from the previous installation to the new installation. But, I am getting these following errors now:

Executing erpnext.patches.v7_2.contact_address_links in site1.local (1bd3e0294da19198)
/home/user/frappe-bench/apps/frappe/frappe/email/doctype/contact/contact.json missing
/home/user/frappe-bench/apps/frappe/frappe/geo/doctype/address/address.json missing
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, 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/user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/user/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/user/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/user/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/user/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/user/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/user/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/user/frappe-bench/apps/erpnext/erpnext/patches/v7_2/contact_address_links.py”, line 19, in execute
doc = frappe.get_doc(doctype, doc.name)
File “/home/user/frappe-bench/apps/frappe/frappe/init.py”, line 596, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/user/frappe-bench/apps/frappe/frappe/model/document.py”, line 48, in get_doc
controller = get_controller(doctype)
File “/home/user/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 34, in get_controller
module = load_doctype_module(doctype, module_name)
File “/home/user/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 173, in load_doctype_module
raise ImportError, ‘Module import failed for {0} ({1})’.format(doctype, module_name)
ImportError: Module import failed for Contact (erpnext.utilities.doctype.contact