Error while installing ERPNext app on bench in dockerized development set up AttributeError: 'NoneType' object has no attribute 'options'

Fellow community members,

Can you please help in resolving my issue?


My environment:
OS: Windows 10 Pro
Docker: Docker Desktop
Editor/IDE: Visual Studio Code-Insiders
I followed all the steps diligently from this link : frappe_docker/ at main · frappe/frappe_docker · GitHub.
I also referred to : Frappe_docker Getting started OSError: setuptools pip wheel failed with error code 1 - #3 by Osam
and Test images on Windows · Issue #137 · frappe/frappe_docker · GitHub

All the steps perfect until the last step of installing custom app. I tried Erpnext app : bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) – Worked fine.
bench --site mysite.localhost install-app erpnext – This is where I got the errors.

frappe@d0badfa2ce18:/workspace/development/frappe-bench$ bench --site latsite.localhost install-app erpnext
Installing erpnext…
Updating DocTypes for erpnext : [======================= ]Traceback (most recent call last):
File “/usr/lib/python3.7/”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.7/”, line 85, in _run_code
exec(code, run_globals)
File “/workspace/development/frappe-bench/apps/frappe/frappe/utils/”, line 97, in
File “/workspace/development/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/workspace/development/frappe-bench/apps/frappe/frappe/commands/”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/workspace/development/frappe-bench/apps/frappe/frappe/commands/”, line 179, in install_app
_install_app(app, verbose=context.verbose)
File “/workspace/development/frappe-bench/apps/frappe/frappe/”, line 83, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/workspace/development/frappe-bench/apps/frappe/frappe/modules/”, line 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/workspace/development/frappe-bench/apps/frappe/frappe/modules/”, line 106, in import_doc
doc = frappe.get_doc(docdict)
File “/workspace/development/frappe-bench/apps/frappe/frappe/”, line 753, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 71, in get_doc
return controller(*args, **kwargs)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 115, in init
super(Document, self).init(kwargs)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 65, in init
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 88, in update
self.set(key, value)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 135, in set
self.extend(key, value)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 172, in extend
self.append(key, v)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 149, in append
value = self._init_child(value, key)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 184, in _init_child
value[“doctype”] = self.get_table_field_doctype(key)
File “/workspace/development/frappe-bench/apps/frappe/frappe/model/”, line 298, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: ‘NoneType’ object has no attribute ‘options’

Needless to say, I’m Frappe/ERPNext newbee :slight_smile:

I checked tabDocField table, and I see some values. Also, see there is a column name “Options”.
On side note, can someone please suggest how to connect to mysql instance inside this container from mysql workbench? I tried, localhost and also tried to set host as % as root as well as new user. But, failed to connect from mysql work bench.

I’m not able to replicate this.

  • if bench is init without specifying --frappe-branch it installs frappe on develop branch. refer: bench init --help
  • if get-app doesn’t specify --branch it gets develop branch. refer bench get-app --help
  • both frappe and erpnext must be on branch with same name. e.g. version-12

edit .devcontainers/docker-compose.yml. you need to publish mariadb ports to host.
If on windows and using docker-machine, you will need to find out how to connect mysql workbench to docker machine instead of localhost

1 Like

Thanks alot, @revant_one for your reply.

Your suggestion on how to connect from mysql workbench worked like a charm!

Blockquote edit .devcontainers/docker-compose.yml . you need to publish mariadb ports to host.
If on windows and using docker-machine, you will need to find out how to connect mysql workbench to docker machine instead of localhost

As you suggested, after I published mariadb ports to host, it worked perfectly . I’m on windows 10 pro and using docker desktop. Effectively, everything points to localhost. There was no need to find docker-machine ip.

Thanks a lot @revant_one

This pointer too nailed the problem precisely. I’m not sure why there is mismatch of branch versions in instructions at : frappe_docker/ at main · frappe/frappe_docker · GitHub

I’ve put pull request suggesting the change in user guide. Request you to check.

1 Like

PR is merged.
Thanks for the fix!