CommandFailedError Updating ERPNext

I’m trying to update using bench update command and I get the following error. How can I fix this?

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 develop -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    /home/rhinorck/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/rhinorck/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 site1.local
    Executing erpnext.patches.v7_0.update_home_page 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/rhinorck/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
    return self.main(*args, **kwargs)
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
    rv = self.invoke(ctx)
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/rhinorck/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
    return callback(*args, **kwargs)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/commands.py”, line 220, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/rhinorck/frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_home_page.py”, line 9, in execute
    homepage = frappe.get_doc(‘Homepage’, ‘Homepage’)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/init.py”, line 556, in get_doc
    return frappe.model.document.get_doc(arg1, arg2)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/model/document.py”, line 44, in get_doc
    controller = get_controller(doctype)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 31, in get_controller
    module = load_doctype_module(doctype, module_name)
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/modules/init.py”, line 64, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(get_module_name(doctype, module, prefix, suffix))
    File “/home/rhinorck/frappe-bench/apps/frappe/frappe/init.py”, line 621, in get_module
    return importlib.import_module(modulename)
    File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
    import(name)
    ImportError: No module named homepage.homepage
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/rhinorck/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 664, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 644, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 464, in invoke
    return callback(*args, **kwargs)
    File “/home/rhinorck/bench-repo/bench/commands/update.py”, line 61, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/rhinorck/bench-repo/bench/commands/update.py”, line 91, in _update
    patch_sites(bench=bench_path)
    File “/home/rhinorck/bench-repo/bench/utils.py”, line 131, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/rhinorck/bench-repo/bench/utils.py”, line 468, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

Install pyopenssl to your python

pip install pyopenssl ndg-httpsclient pyasn1

Make sure that you put the previous line in frappe virtual environment.
like /home/frappe/frappe-bench/env/bin/pip

/home/frappe/frappe-bench/env/bin/pip install pyopenssl ndg-httpsclient pyasn1

I’m still getting the same error. It looks like the error occurs when trying to run this patch:

Executing erpnext.patches.v7_0.update_home_page in site1.local (1bd3e0294d)

specifically here:

File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    import(name)
ImportError: No module named homepage.homepage

and here:

File "/home/rhinorck/bench-repo/bench/utils.py", line 468, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

Help! Someone. What can I do to fix this?