Errors while creating demo

Hi,

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/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 “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, 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/core.py”, 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/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/init.py”, line 25, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/commands/init.py”, line 45, in make_demo
demo.make(domain, days)
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/demo.py”, line 44, in make
simulate(domain, days)
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/demo.py”, line 80, in simulate
stock.work()
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/user/stock.py”, line 17, in work
make_purchase_receipt()
File “/opt/bench/erpnext/apps/erpnext/erpnext/demo/user/stock.py”, 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/purchase_order.py”, line 373, in make_purchase_receipt
}, target_doc, set_missing_values)
File “/opt/bench/erpnext/apps/frappe/frappe/model/mapper.py”, line 56, in get_mapped_doc
source_doc = frappe.get_doc(from_doctype, from_docname)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 721, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 69, in get_doc
return controller(*args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py”, line 27, in init
super(PurchaseOrder, self).init(*args, **kwargs)
File “/opt/bench/erpnext/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 23, in init
super(AccountsController, self).init(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 104, in init
self.load_from_db()
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 141, in load_from_db
frappe.throw(
(“{0} {1} not found”).format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 351, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, line 337, in msgprint
_raise_exception()
File “/opt/bench/erpnext/apps/frappe/frappe/init.py”, 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 ?

Usually…

Hi,

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 ?

Regards
Hari

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 .