ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

'bench run-tests' to make local instance like demo.erpnext.com?

erpnextversion7

#1

This ‘demo install’ below worked but I expected demo.erpnext.com result!?

Am I on the right track here? I get this and am puzzling this out…

Thanks!

frappe@erpnext:~/frappe-bench$ bench run-tests
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 319, in run_tests
force=context.force, profile=profile, junit_xml_output=junit_xml_output)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 60, in main
ret = run_all_tests(app, verbose, profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 100, in run_all_tests
_add_test(app, path, filename, verbose, test_suite=test_suite)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 194, in add_test
make_test_records(doctype, verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 210, in make_test_records
make_test_records(options, verbose, force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 211, in make_test_records
make_test_records_for_doctype(options, verbose, force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 256, in make_test_records_for_doctype
frappe.local.test_objects[doctype] += make_test_objects(doctype, test_module.test_records, verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 303, in make_test_objects
d.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 212, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 770, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 860, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 843, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 79, in on_update
self.send_password_notification(self.__new_password)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 208, in send_password_notification
self.send_welcome_mail_to_user()
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 276, in send_welcome_mail_to_user
site_url=get_url(),
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 306, in send_login_mail
delayed=(not now) if now!=None else self.flags.delay_emails, retry=3)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 412, in sendmail
communication=communication, now=now)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 53, in send
email_account = get_outgoing_email_account(True, append_to=reference_doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 62, in get_outgoing_email_account
email_account.password = email_account.get_password()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 660, in get_password
return get_decrypted_password(self.doctype, self.name, fieldname, raise_exception=raise_exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/password.py”, line 19, in get_decrypted_password
frappe.throw(
(‘Password not found’), frappe.AuthenticationError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 310, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 303, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 276, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.AuthenticationError: Password not found


Good quality demo data, eg. ''WIND POWER LLC'' download
Bench make-demo throws frappe.exceptions.DoesNotExistError: Company None not found?
Is there like place to download Testing data?
Sample data for demo.erpnext.com and own deployments
Trying to install demodata on new site
#2

Not sure why you wish to run demo on your local but this is how you do it.

Make a demo

Start with a fresh site, create new site and follow these steps

bench --site <site-name> reinstall

Install Demo

bench --site <site-name> execute erpnext.demo.demo.make

If Demo breaks, to continue

bench --site <site-name> execute erpnext.demo.demo.simulate


#3

Thank you Kanchan:

“Not sure why you wish to run demo on your local but this is how you do it.”

Well, demo.erpnext.com paints a nightmare any CEO would recognize - a Cash Flow problem, a questionable erp purchase - a fun plot any audience would warm to :wink:

But too bad no console access to demo.erpnext.com, correct? I sure like frappe user access to run bench commands - I want both worlds if that is possible, that demo works for me :wink:

After I run ‘bench execute erpnext.demo.demo.make’

That demo instance has 0 amounts in the Financial Statements and no ‘snapshot’ of Wind Power.

Then when I run this ‘bench execute erpnext.demo.demo.simulate’ I get this:

frappe@erpnext:~/frappe-bench$ bench execute erpnext.demo.demo.simulate
Simulating 2016-10-24: Day 0Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 111, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 71, in simulate
hr.work()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/hr.py”, line 16, in work
mark_attendance()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/hr.py”, line 196, in mark_attendance
attendance.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 242, in _save
self.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 178, in insert
self.check_permission(“create”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 145, in check_permission
self.raise_no_permission_to(permlabel or permtype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 160, in raise_no_permission_to
raise frappe.PermissionError(msg)
frappe.exceptions.PermissionError: No permission to create Attendance

I would love to get my hands on a local instance like demo.erpnext.com if that is possible, thanks…


#4

Hi Kanchan,

For me to get a demo instance, if an install does not work then alternatively do any the (version 8 beta?) development versions available for download possibly include the demo data in the instance?

Of maybe can you advise me what git branch and tag to fetch from github?

For a demo this Tuesday I would prefer to have a local instance to work with, thanks!


#5

@clarkej demo was fixed recently, can you check now?


#6

Thank you for this @rmehta

I downloaded the posted prod release VM (version 7.2.14) then did this as instructed:

bench switch-to-master --upgrade
bench update --patch

The above ran without error, then the demo install ran with the traceback here below:

Please would someone familiar with this demo setup ValuationError advice please fix this, thanks…

frappe@erpnext:~/frappe-bench$ bench --site erpnext.vm execute erpnext.demo.demo.make
Complete Setup…
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:334: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
…lots of these warnings snipped here…
/home/frappe/frappe-bench/env/local/lib/python2.7/site-
packages/requests/packages/urllib3/util/ssl_.py:132: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
Simulating 2016-11-17: Day 3Negative stock for PO-00001
Simulating 2016-11-24: Day 10Negative stock for PO-00002
Simulating 2016-11-28: Day 14Traceback (most recent call last):
1 File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 111, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 38, in make
simulate(domain)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 73, in simulate
stock.work()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/stock.py”, line 19, in work
submit_draft_stock_entries()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/stock.py”, line 98, in submit_draft_stock_entries
ste.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 741, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 730, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 281, in save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 793, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 875, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 61, in on_submit
self.make_gl_entries()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 28, in make_gl_entries
gl_entries = self.get_gl_entries(warehouse_account)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 423, in get_gl_entries
gl_entries = super(StockEntry, self).get_gl_entries(warehouse_account)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 66, in get_gl_entries
sle = self.update_stock_ledger_entries(sle)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 100, in update_stock_ledger_entries
self.doctype, self.name, currency=self.company_currency)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py”, line 455, in get_valuation_rate
frappe.throw(
(“Valuation rate not found for the Item {0}, which is required to do accounting entries for {1} {2}. If the item is transacting as a sample item in the {1}, please mention that in the {1} Item table. Otherwise, please create an incoming stock transaction for the item or mention valuation rate in the Item record, and then try submiting/cancelling this entry”).format(item_code, voucher_type, voucher_no))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 306, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 279, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Valuation rate not found for the Item Wind Turbine-S, which is required to do accounting entries for Stock Entry STE-00005. If the item is transacting as a sample item in the Stock Entry, please mention that in the Stock Entry Item table. Otherwise, please create an incoming stock transaction for the item or mention valuation rate in the Item record, and then try submiting/cancelling this entry


#7

I forgot to add I ran this too as recommended and got the same traceback…

frappe@erpnext:~/frappe-bench$ bench --site erpnext.vm execute erpnext.demo.demo.simulate

ok I spoke too soon!

Despite the frappe.exceptions.ValidationError, I can confirm the demo seems to work fine and is a gold mine to explore - excellent work for howto example learning purposes, thanks…


#8

Hello

I am getting an frappe exception error while upgrading to version 8

File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.ValidationError: Options must be a valid DocType for field Print Style in row 17


#9

Hmmm after the errors and running $ bench --site demo execute erpnext.demo.demo.simulate

I’m getting my demo site but have no permissions to view desk. Not even by loggin in as administrator. I even tried running –site migrate

I’m running this in VirtualBox with v6. Maybe thats the issue?

Here’s a full traceback:

frappe@erpnext:~/frappe-bench$ bench --site demo execute erpnext.demo.demo.make
Complete Setup…
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:334: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
[edit snip] same warnings as abovewarnings
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 111, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 28, in make
setup_data.setup(domain)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/setup_data.py”, line 35, in setup
setup_mode_of_payment()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/setup_data.py”, line 301, in setup_mode_of_payment
mop.save(ignore_permissions=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 223, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 252, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 750, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 841, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py”, line 13, in validate
self.validate_repeating_companies()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py”, line 22, in validate_repeating_companies
frappe.throw(
(“Same Company is entered more than once”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 302, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 275, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Same Company is entered more than once
frappe@erpnext:~/frappe-bench$ bench --site demo execute erpnext.demo.demo.simulate
Simulating 2017-05-26: Day 0Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 111, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 71, in simulate
hr.work()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/hr.py”, line 46, in work
make_timesheet_records()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/hr.py”, line 128, in make_timesheet_records
make_sales_invoice_for_timesheet(ts.name)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/hr.py”, line 147, in make_sales_invoice_for_timesheet
sales_invoice.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 189, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 750, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 651, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 841, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 645, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 82, in validate
self.set_against_income_account()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 366, in set_against_income_account
self.against_income_account = ‘,’.join(against_acc)
TypeError: sequence item 0: expected string or Unicode, NoneType found


#10

Have you tried

bench reset-perms


#11

Yeah. It did not work unfortunately.


#12

I just noticed you are on v6!?

The demo installed for me in April so v8.


#13

Correction, I’m running V7. Appears the permissions problem was with my bench. So I created a new VM.

Now I’m running into a frappe.exceptions.ValidationError: Same Company is entered more than once error. Following this guide:

I’ll try it on v8.

Last traceback:

frappe@erpnext:~/frappe-bench$ bench new-site demo --install-app erpnext
MySQL root password:
Installing frappe...
Updating frappe                     : [========================================]
Updating country info               : [========================================]
Set Administrator password:
Re-enter Administrator password:
Installing erpnext...
Updating erpnext                    : [========================================]
*** Scheduler is disabled ***

frappe@erpnext:~/frappe-bench$ bench --site demo execute erpnext.demo.demo.make
Complete Setup...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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 79, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, 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 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, 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 1066, 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 895, 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 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 111, in execute
    ret = frappe.get_attr(method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py", line 28, in make
    setup_data.setup(domain)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/setup_data.py", line 35, in setup
    setup_mode_of_payment()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/setup_data.py", line 301, in setup_mode_of_payment
    mop.save(ignore_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 223, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 252, in _save
    self.run_before_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 750, in run_before_save_methods
    self.run_method("validate")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 651, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 858, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 841, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 645, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py", line 13, in validate
    self.validate_repeating_companies()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py", line 22, in validate_repeating_companies
    frappe.throw(_("Same Company is entered more than once"))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 302, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 275, in _raise_exception
    raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Same Company is entered more than once

#14

I am not sure what to advise adam26d

These appear to constitute the demo setup code

/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/setup_data.py
/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py

I can’t say what the rule here is that this violates
frappe.exceptions.ValidationError: Same Company is entered more than once

What I especially like about having a local demo is that, unlike the online demo.erpnext.com, so one is in control of a known state.

Whereas the online demo routinely changes so data ‘scenarios’ go away one day to the next, not ideal when you need a known state to illustrate a case.


#15

Most appreciated @clarkej

I’ll continue digging. If you dont mind post my updates on your thread. I’m sure I’m close the the solution!


#16

I’m also trying to install the ERPNext demo modules on my local system:
MacBook Pro, High Sierra Version 10.13.2
frappe:10.0.10, erpnext: 10.0.9

This setup established a working ERPNext instance, unpopulated database established w/573 DocTypes installed and no errors up to this point.

Any suggestion/guidance?


#17

So the problem is erpnext.get_default_company() returns None.

In my same demo instance I get this:

frappe@erpnext:~/frappe-bench$ bench console
Python 2.7.6 (default, Oct 26 2016, 20:32:47)
Type “copyright”, “credits” or “license” for more information.

IPython 5.1.0 – An enhanced Interactive Python.
? -> Introduction and overview of IPython’s features.
%quickref -> Quick reference.
help -> Python’s own help system.
object? -> Details about ‘object’, use ‘object??’ for extra details.

In [1]: import erpnext

In [2]: erpnext.get_default_company()
Out[2]: u’Wind Power LLC’

The problem may be either to specify on not specify ‘Manufacturing’ for the domain?

Here’s the code in question


#18

Have you had any joy here Roland?

If you’re stuck don’t be shy to complain!


#19

I tried demo run on v10 master and have following error
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 94, in
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 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, 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 1066, 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 895, 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 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 117, in execute
ret = frappe.get_attr(method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 65, in simulate
fixed_asset.work()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/fixed_asset.py”, line 15, in work
asset_list = make_asset_purchase_entry()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/user/fixed_asset.py”, line 45, in make_asset_purchase_entry
pi.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 279, in _save
self.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 218, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, line 72, in validate
self.validate_fixed_asset()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 618, in validate_fixed_asset
.format(d.idx, d.asset, asset.status))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.ValidationError: Row #1: Asset Chair 2 is already Fully Depreciated


#20

This suggests

  1. If Demo breaks, to continue

bench --site demo.erpnext.dev execute erpnext.demo.demo.simulate

Referring to the code, the demo setup is for a 100 day time period up to current and picks random dates for ‘business events’.

Inevitably some ‘business rule’ break sthe build - for eg Asset Chair 2 is already Fully Depreciated

So if you rerun the simulation, the next time the biz rule violation may fix itself?