Error on install ERPNext to new bench instance

I am getting the following error when trying to install erpnext on a new bench instance .

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/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/taher/latest_erp/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/taher/latest_erp/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/taher/latest_erp/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/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/taher/latest_erp/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/taher/latest_erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 161, in install_app
for site in context.sites:
TypeError: ‘NoneType’ object is not iterable

Bench version is 4.1.0

Not upgraded the erpnext on current instances in a while , so wanted to install a new instance with the latest version to try it out ,as i saw it has quite a few additions like foundation , frappe.io( whats this all about?) .

so i did the usual bench init frappe-bench in an another virtual env. and then get-app the latest
repo of erpenext , and along with it came foundation but not frappe.io(what was this for again?).
.
now when i am trying to do bench install-app erpnext
i got the above error while trying to install foundation ,

cant even start the bench

regards

seems site is not exits

create a new site and then try to install erpnext app

Thanks @saurabh6790
Yes , that was the issue for installing ,
dont know why the site did not get installed at first .
.
but even after installing erpnext , the bench does not start , goes down with error ,

17:06:31 redis_cache.1 | [4009] 21 Jun 17:06:31.692 # Server started, Redis version 2.8.4
17:06:31 redis_cache.1 | [4009] 21 Jun 17:06:31.692 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:06:31 redis_cache.1 | [4009] 21 Jun 17:06:31.692 * The server is now ready to accept connections on port 13000
17:06:32 socketio.1 | module.js:478
17:06:32 socketio.1 | throw err;
17:06:32 socketio.1 | ^
17:06:32 socketio.1 |
17:06:32 socketio.1 | Error: Cannot find module ‘express’
17:06:32 socketio.1 | at Function.Module._resolveFilename (module.js:476:15)
17:06:32 socketio.1 | at Function.Module._load (module.js:424:25)
17:06:32 socketio.1 | at Module.require (module.js:504:17)
17:06:32 socketio.1 | at require (internal/module.js:20:19)
17:06:32 socketio.1 | at Object. (/home/taher/latest_erp/frappe-bench/apps/frappe/socketio.js:1:91)
17:06:32 socketio.1 | at Module._compile (module.js:577:32)
17:06:32 socketio.1 | at Object.Module._extensions…js (module.js:586:10)
17:06:32 socketio.1 | at Module.load (module.js:494:32)
17:06:32 socketio.1 | at tryModuleLoad (module.js:453:12)
17:06:32 socketio.1 | at Function.Module._load (module.js:445:3)
17:06:32 system | socketio.1 stopped (rc=1)
17:06:32 system | sending SIGTERM to redis_socketio.1 (pid 3971)
17:06:32 system | sending SIGTERM to worker_long.1 (pid 3975)

now there is some express module missing , cant even start with bench serve (login page doesnt show up) .

So there are 3 apps in my local instant for the latest one , frappe , erpnext and foundation ,
.
bench does not start , please help

from frappe-bench run bench setup requirements

1 Like

@saurabh6790 ,
It seems when one error is solved another one pops up ,
now that error is solved but now another error says Frappe_theme module not there …
full trace below :

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/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/taher/latest_erp/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/taher/latest_erp/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/taher/latest_erp/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/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/taher/latest_erp/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/taher/latest_erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/migrate.py”, line 65, in migrate
frappe.utils.help.sync()
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/help.py”, line 27, in sync
help_db.sync_pages()
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/help.py”, line 182, in sync_pages
{‘docs_base_url’: ‘/assets/{docs_app}_docs’.format(docs_app=docs_app)})
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 69, in render_template
return get_jenv().from_string(template).render(context)
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 12, in get_jenv
jenv = Environment(loader = get_jloader(),
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 184, in get_jloader
(app, PackageLoader(app, “.”)) for app in apps
File “/home/taher/latest_erp/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 184, in
(app, PackageLoader(app, “.”)) for app in apps
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/loaders.py”, line 224, in init
provider = get_provider(package_name)
File “/home/taher/latest_erp/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 48, in get_provider
import(moduleOrReq)
ImportError: No module named frappe_theme

i did bench update , and still this error is coming while finishing updates as well ,

Thanks

@saurabh6790 , @rohit_w ,

Any possible reasons and solution to this please !

Thanks

1 Like

Error went away after i uninstalled foundation :
but now i cant complete the setup wizard !
it gets stuck after step 4 (company setup) with no errors anywhere…

man after setting up maybe 5-6 setups on previous versions , i have never had this much trouble , on each step !

Any help is appreciated .
thanks

Solved the stuck issue after updating bench .
.
please close the thread.

Hi,

If you want to keep the foundation app to be able to access/update documentation, install frappe_theme, like so:

bench get-app frappe_theme
bench --site [your-site-name] install-app frappe_theme