Failure to update due to custom app

When I try to switch using
bench switch-to-branch version-12 --upgrade
I get error

subprocess.CalledProcessError: Command ‘[‘git’, ‘show’, ‘upstream/version-12:mycustomApp/init.py’]’ returned non-zero exit status 128

Should I remove mycustomApp before switching to branch but how to do that without loosing data

normally, this would work

  • Make a backup
  • Remove custom app
  • Install/upgrade
  • Reinstall custom app (if compatible)
1 Like

Thank you so much for your reply
I tried uninstall by command
bench --site mysite1 uninstall-app mycustomApp

but I get following error

[frappe@service frappe-bench]$ bench --site mysite1 uninstall-app mycustomApp
/usr/lib/python2.7/site-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.25.3) or chardet (2.2.1) doesn’t match a supported version!
RequestsDependencyWarning)
All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? y
Backing up…
removing DocType Transaction…
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 352, in uninstall
remove_app(app, dry_run, yes)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 142, in remove_app
frappe.delete_doc(“DocType”, doctype.name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 777, in delete_doc
ignore_permissions, flags, ignore_on_trash, ignore_missing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 108, in delete_doc
insert_feed(doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 318, in insert_feed
“full_name”: get_fullname(doc.owner)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 734, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 69, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 114, in init
self.init_valid_columns()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 251, in init_valid_columns
for key in self.get_valid_columns():
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 261, in get_valid_columns
valid = self.meta.get_valid_columns()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 69, in meta
self.meta = frappe.get_meta(self.doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 759, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37, in get_meta
meta = Meta(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 84, in init
super(Meta, self).init(“DocType”, doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 104, in init
self.load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 89, in load_from_db
super(Meta, self).load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 147, in load_from_db
frappe.throw(
("{0} {1} not found").format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: DocType Comment not found

I’ve made back ups and trying to solve errors as I try to up grade step by step. I have switched branches to version-11 now running
bench update patch
but I get error
pymysql.err.IntegrityError: (1048, u"Column ‘allow_auto_repeat’ cannot be null")