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/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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
    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/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/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/local/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/local/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/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 48, in new_site
    db_port=db_port, new_site=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 91, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", 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/sync.py", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 66, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 106, in import_doc
    doc = frappe.get_doc(docdict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 753, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 71, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 115, in __init__
    super(Document, self).__init__(kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 66, in __init__
    self.update(d)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 89, in update
    self.set(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 136, in set
    self.extend(key, value)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 173, in extend
    self.append(key, v)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 150, in append
    value = self._init_child(value, key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 185, in _init_child
    value["doctype"] = self.get_table_field_doctype(key)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", 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: