Disruptive apps changes frappe, erpnext, frappe_io, foundation, frappe_theme and frappe-client

Hi Community,

It’s really good idea to segregate the functionality of Frappe and ERPNext into sub apps. but there are lot’s of issues as well with sub apps due to disruptive changes.

Now we have followings apps:

Frappe

Further divided into frappe_io
frappe_client
frappe_theme

ERPNext

Further divided into foundation
accounting (coming soon)

Please don’t try update the erpnext for production/master branch.

I tried to update & upgrade the ERPNext and I came across too many issues :

Issue with vue while login:
I tried to fix it using bench setup requirements but I failed.

Issue frappe and frappe_io:

Issue with foundation app

Failed to update the uwsgi
Traceback:

Traceback (most recent call last):
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local.py", line 228, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 301, in application
    return f(*args[:-2] + (request,))(*args[-2:])
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/app.py", line 88, in application
    response = handle_exception(e)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/app.py", line 136, in handle_exception
    if frappe.local.is_ajax or 'application/json' in frappe.get_request_header('Accept'):
TypeError: argument of type 'NoneType' is not iterable

Issue with socketio

SyntaxError: Unexpected end of JSON input
09:23:35 watch.1          |     at Object.parse (native)
09:23:35 watch.1          |     at make_build_map (/home/navdeep/frappe-bench/apps/frappe/frappe/build.js:193:22)
09:23:35 watch.1          |     at Object.<anonymous> (/home/navdeep/frappe-bench/apps/frappe/frappe/build.js:22:17)
09:23:35 watch.1          |     at Module._compile (module.js:577:32)
09:23:35 watch.1          |     at Object.Module._extensions..js (module.js:586:10)
09:23:35 watch.1          |     at Module.load (module.js:494:32)
09:23:35 watch.1          |     at tryModuleLoad (module.js:453:12)
09:23:35 watch.1          |     at Function.Module._load (module.js:445:3)
09:23:35 watch.1          |     at Module.runMain (module.js:611:10)
09:23:35 watch.1          |     at run (bootstrap_node.js:394:7)

foundation app error

Installing foundation...
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/navdeep/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/navdeep/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/navdeep/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/navdeep/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/navdeep/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/navdeep/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/navdeep/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/commands/site.py", line 165, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/installer.py", line 141, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/sync.py", line 45, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 132, in import_doc
    doc.insert()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 248, in insert
    self.run_post_save_methods()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_post_save_methods
    self.run_method("on_update")
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 758, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1027, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1010, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 752, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 212, in on_update
    make_module_and_roles(self)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 809, in make_module_and_roles
    r.insert()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 242, in insert
    self.run_method("after_insert")
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 758, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1027, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1010, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 752, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/role/role.py", line 19, in after_insert
    user.add_roles(self.name)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 383, in add_roles
    self.save()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in save
    return self._save(*args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 310, in _save
    self.run_post_save_methods()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 890, in run_post_save_methods
    self.run_method("on_update")
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 758, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1027, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 1010, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 752, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 92, in on_update
    self.share_with_self()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 180, in share_with_self
    flags={"ignore_share_permission": True})
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/share.py", line 42, in add
    notify_assignment(user, doctype, name, description=None, notify=notify)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/share.py", line 154, in notify_assignment
    chat.post(**arg)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/desk/page/chat/chat.py", line 103, in post
    d = frappe.new_doc('Communication')
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/__init__.py", line 614, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/create_new.py", line 20, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/create_new.py", line 38, in make_new_doc
    "docstatus": 0
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/__init__.py", line 638, in get_doc
    return frappe.model.document.get_doc(*args, **kwargs)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/document.py", line 66, in get_doc
    controller = get_controller(doctype)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/model/base_document.py", line 36, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/modules/utils.py", line 187, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Communication (frappe.core.doctype.communication.communication Error: No module named pdfkit)

uwsgi Issue:

After upgrading 9V to 10V and while installing ERPNext
Compile errors on ubuntu 16.04 · Issue #1262 · unbit/uwsgi · GitHub

For non-technical person it would be very difficult to fix all these issues.

Thanks
Navdeep

Can you explain the exact set of commands you executed to reach this

What happens when you do bench update ?

1 Like

Previously I have installed version 9 of ERPNext, before two days when I tried to update the 9 to 10 using ** bench update command**

It’s stuck at below error while installation of erpnext app:

uwsgi Issue:
Compile errors on ubuntu 16.04 · Issue #1262 · unbit/uwsgi · GitHub

After facing this error again I tried to update the erpnext then It’s start giving new error(in click module):
tuple object has no attribute name
After that I wasn’t able to execute bench command, not even bench bench --help.

bench update command totally messed up the virtualenv env.

How I fixed it?

  1. I deleted my env folder and then I reinstalled the env folder.
  2. Re-installed the bench
  3. Re-installed the frappe and erpnext and my custom app.

while execution of 3 setup it’s starting giving pip error for req module(due to pip update).

  1. Again I deleted the frappe and erpnext and re-installed it using bench command.
  2. bench get-app frappe GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch master
  3. bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch --master

while execution of 5 step bench automatically installed frappe_io app and due to frappe_io I start getting error for communication.doctype.notification(not sure about error trace but it was related to notification module) module not found while migrations.

while execution of 6 step bench returned with pip error due to foundation app (pip.req module not found).

After I fixed all above errors manually then I start getting error for vue while login:

Issue with vue while login: I tried to fix it using bench setup requirements but I failed

Finally I removed the frappe_io and foundation app and my server start working perfectly(I faced the error while execution of patches also but I fixed all those erros manually).

** Now server is working fine with existing data but It was really exhausted process to fix these all errors.**

NOTE:

I didn’t execute the bench uninstall-app command for erpnext and frappe app otherwise it would have also washed out the mysql data, I just removed the apps using rm -rf ./app/frappe ./app/erpnext and then re-installed the app using bench get-app after removing entries from ./sites/apps.txt file.