Error : Custom Application Installation

I am getting the following attached error while installing the application in a site.

frappe@erpnext:~/frappe-bench$ bench --site platina install-app ceramic_operations
Installing ceramic_operations…
Updating ceramic_operations : [==================================== ]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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 152, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 132, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 44, in sync_for
import_file_by_path(doc_path, force=force)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 93, in import_doc
doc = frappe.get_doc(docdict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 596, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 50, in get_doc
return controller(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 86, in init
super(Document, self).init(arg1)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 52, in init
self.update(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 75, in update
self.set(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 122, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 148, in extend
self.append(key, v)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 136, in append
value = self._init_child(value, key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 160, in _init_child
value[“doctype”] = self.get_table_field_doctype(key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 271, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: ‘NoneType’ object has no attribute ‘options’

My thoughts -

It seems the (custom?) doctype you are importing has no field ‘options’

Find out from github.com when ‘options’ was added to base_document.py and if what you are importing was created before or after that?

Then again some bench command may be the answer here to sync up the code for the import to succeed?

Thanks for the reply @clarkej . I tried you suggestions. The error still exists. I think This is the issue of migrating application.

I agree this points to a failed migration. So you will need to dig up info like when your DocType was created and when ‘options’ was added. With that, then identify the migration patch causing the problem. It may need work to handle you migration case.

I believe the patches are specified in JSON that may involve some additional manual code scripts.

That’s the general idea although I have no experience with ERPNext migrations.

Let us know how it goes and what you find out so the rest of us can learn.