Errors while creating demo


I was trying to setup a demo on a local instance , with staging version of erpnext (11.1.3 for both frappe and erpnext ) .

My default site is site1.local .

I ran

bench reinstall
bench make-demo

and I got the error

Simulating 2019-03-08: Day 0Traceback (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 “/opt/bench/erpnext/apps/frappe/frappe/utils/”, line 97, in
File “/opt/bench/erpnext/apps/frappe/frappe/utils/”, line 18, in main
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/”, line 25, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/commands/”, line 45, in make_demo
demo.make(domain, days)
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/”, line 44, in make
simulate(domain, days)
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/”, line 80, in simulate
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/user/”, line 17, in work
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/user/”, line 30, in make_purchase_receipt
pr = frappe.get_doc(make_purchase_receipt(po))
File “/opt/bench/erpnext/apps/erpnext/erpnext/buying/doctype/purchase_order/”, line 373, in make_purchase_receipt
}, target_doc, set_missing_values)
File “/opt/bench/erpnext/apps/frappe/frappe/model/”, line 56, in get_mapped_doc
source_doc = frappe.get_doc(from_doctype, from_docname)
File “/opt/bench/erpnext/apps/frappe/frappe/”, line 721, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/”, line 69, in get_doc
return controller(*args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/buying/doctype/purchase_order/”, line 27, in init
super(PurchaseOrder, self).init(*args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/controllers/”, line 23, in init
super(AccountsController, self).init(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/”, line 104, in init
File “/opt/bench/erpnext/apps/frappe/frappe/model/”, line 141, in load_from_db
(“{0} {1} not found”).format(
(self.doctype),, frappe.DoesNotExistError)
File “/opt/bench/erpnext/apps/frappe/frappe/”, line 351, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/opt/bench/erpnext/apps/frappe/frappe/”, line 337, in msgprint
File “/opt/bench/erpnext/apps/frappe/frappe/”, line 310, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Purchase Order Total not found

I also tried

bench execute erpnext.demo.demo.make
bench execute erpnext.demo.demo.simulate

and I got the same error there as well. Am I doing something wrong ? Is there an issue with the staging version ?



I’ve had the same issue while installing the developer version . I updated to the latest version yesterday and then tried both demo.make and demo.simulate and found both failed because of default company not being setup.

Any suggestions on how to fix it ?


Identified issue. The reason was the instance including the redis cache service was not running. It moved forward when I started the instance and then did the make demo . There was an exception “Error 111 connecting to localhost:11001. Connection refused” during setup_complete method called at the beginning of the demo instance creation . I’m still getting an error in asset creation - will debug that .

So a question - should the make-demo be tolerant to redis-cache not running or should make demo throw an error at the beginning indicating that instance should be running for creating a demo .