Erron while upgrading ERPNext

Hi,
I am getting below error while upgrading.

itwork@ERP:~$ bench retry-upgrade
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 knowledge_base
From https://github.com/frappe/knowledge_base
 * branch            master     -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling fleet_management
From https://github.com/dalwadani/fleet_management
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Migrating erp.itwork.co
Updating frappe                     : [========================================]
Updating erpnext                    : [===========                             ]Module import failed for Vehicle Service (fleet_management.fleet_management.doctype.vehicle_service.vehicle_service)
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/itwork/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/itwork/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/itwork/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/itwork/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/itwork/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/itwork/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/itwork/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/itwork/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/itwork/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/itwork/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/commands/site.py", line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/migrate.py", line 32, in migrate
    frappe.model.sync.sync_all(verbose=verbose)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/sync.py", line 19, in sync_all
    sync_for(app, force, verbose=verbose)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/sync.py", line 44, in sync_for
    import_file_by_path(doc_path, force=force)
  File "/home/itwork/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/itwork/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 122, in import_doc
    doc.insert()
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 222, in insert
    self.run_post_save_methods()
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in run_post_save_methods
    self.run_method("on_update")
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 654, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 882, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 865, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/itwork/frappe-bench/apps/frappe/frappe/model/document.py", line 648, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/itwork/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 154, in on_update
    self.run_module_method("on_doctype_update")
  File "/home/itwork/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/itwork/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/itwork/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)
ImportError: No module named vehicle_service.vehicle_service

Thanks…

@soae786 your problem is fleet management module.
Just take full backup (files, directories and databases) and then use bench to remove or uninstall fleet management app from site erp.itwork.co
Then perform upgrade again

Hi… @yashodhan
Yes. You are right. I remove the app from site and delete the folder as well as change the apps.txt. it’s working perfect. But how can I use fleet management without any issue. It’s good option.

Thanks…

I believe fleet management will be merged in to ERPNext, as it was decided by core team to go monolithic software design which will incorporate almost everything you can imagine, so any generic feature which might be useful to set number of users, it will become part and shipped with ERPNext to better maintain code and upgrades to better serve less skilled users to get best out of ERPNext.