Error creating new site

Any suggestions?
Other weird thing. Everytime I do a bench update, I need to do a bench upgrade --reset if not I have “local changes”. But I dont.
ERPNext: v12.11.2 (version-12)

Frappe Framework: v12.9.1 (version-12)

Creating Database...
9.52KiB 0:00:00 [ 934KiB/s] [===============================================================================>] 100%

Installing frappe...
Updating DocTypes for frappe        : [=======                                 ]Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 99, in <module>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 48, in new_site
    db_port=db_port, new_site=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 91, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 84, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 66, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 106, in import_doc
    doc = frappe.get_doc(docdict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 753, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 71, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 115, in __init__
    super(Document, self).__init__(kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 66, in __init__
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 89, in update
    self.set(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 136, in set
    self.extend(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 173, in extend
    self.append(key, v)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 150, in append
    value = self._init_child(value, key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 185, in _init_child
    value["doctype"] = self.get_table_field_doctype(key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 299, in get_table_field_doctype
    return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'

Somewhere in your frappe app, you have a Table field without a table doctype mentioned in it’s options property. Do you have local changes in the app?

Yes I made new changes regarding the doctypes and few new doctypes. Hard to tell which one is causing this?

Filter DocType list with following filters:

  • Type = “Table”
  • Options is not set

Fix the relevant DocTypes from that list.

can’t find with the “Options is not set”. I’m not able to apply a filter that do that.

v12 requires Python 3 to run, you best migrate-env to that to avoid spurious errors.

1 Like

ok. But everything I try to upgrade to python 3 I have a lot of
errors and I need to revert back to 2.7 if not my erp stop
working… :frowning: