Can't install ERPNext on Ubuntu 16.04 LTS (neither manually nor with easy install)

Thanks, @brian_pond! Before trying your suggestion I followed another route.

I removed everything related to ERPNext and tried again from the start, this time manually verifying the pre-requisites:

  • Python 2.7 (I already have 2.7.12)
  • MariaDB 10+
  • Nginx
  • Nodejs (I already have v6.9.5)
  • Redis (I already have 3.0.6)
  • wkhtmltopdf with patched Qt

The wkhtmltopdf from the universe repository is “not using wkhtmltopdf patched qt”, so instead of using apt-get one can download wkhtmltopdf from its official site . The Linux 0.12.4 64-bit binaries seem to work fine for me:

$ ./wkhtmltopdf --version
wkhtmltopdf 0.12.4 (with patched qt)

… but if anyone prefer to use the easy install, it will automatically install it for you.

Anyway, I found out that mariadb was not being installed correctly and nginx was not starting. I completely removed both as well as any mysql related package I could find, stopped Apache2 (duh! ) and tried again, installing the packages in this order:

sudo apt-get install mariadb-server
sudo apt-get install nginx

Now it worked!

sudo python install.py --develop

Well, kind of… I can start the test server with:

bench start

… and despite some Redis warnings, everything seems fine - that is, until I try to open http://localhost:8000/ or http://127.0.0.1:8000/

11:41:41 web.1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
11:45:17 web.1 | localhost does not exist
11:45:52 web.1 | 127.0.0.1 does not exist

I found this thread, stating that “easy install does not create the default site”. So I followed the instructions:

bench new-site localhost

So far, so good. Now, finally:

bench --site localhost install-app erpnext

… but it didn’t work as expected!

[details=“Table ‘334389048b872a53.tabDefaultValue’ doesn’t exist”]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/ric/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ric/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ric/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/ric/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/ric/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/ric/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/ric/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/ric/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/ric/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/ric/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ric/frappe-bench/apps/frappe/frappe/commands/site.py”, line 152, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ric/frappe-bench/apps/frappe/frappe/installer.py”, line 100, in install_app
frappe.clear_cache()
File “/home/ric/frappe-bench/apps/frappe/frappe/init.py”, line 480, in clear_cache
for fn in get_hooks(“clear_cache”):
File “/home/ric/frappe-bench/apps/frappe/frappe/init.py”, line 796, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/home/ric/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 70, in get_value
val = generator()
File “/home/ric/frappe-bench/apps/frappe/frappe/init.py”, line 774, in load_app_hooks
for app in [app_name] if app_name else get_installed_apps(sort=True):
File “/home/ric/frappe-bench/apps/frappe/frappe/init.py”, line 738, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “”)
File “/home/ric/frappe-bench/apps/frappe/frappe/database.py”, line 691, in get_global
return self.get_default(key, user)
File “/home/ric/frappe-bench/apps/frappe/frappe/database.py”, line 703, in get_default
d = self.get_defaults(key, parent)
File “/home/ric/frappe-bench/apps/frappe/frappe/database.py”, line 709, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/ric/frappe-bench/apps/frappe/frappe/defaults.py”, line 72, in get_defaults
globald = get_defaults_for()
File “/home/ric/frappe-bench/apps/frappe/frappe/defaults.py”, line 180, in get_defaults_for
where parent = %s order by creation"“”, (parent,), as_dict=1)
File “/home/ric/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sql
self._cursor.execute(query, values)
File “/home/ric/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ric/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘334389048b872a53.tabDefaultValue’ doesn’t exist”)
[/details]

OK, this is not working… So I removed ~/frappe-bench and tried the manual approach:

bench init frappe-bench && cd frappe-bench/
bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
bench new-site site1.local
bench start

I try again to open localhost:8000 and… it is still not working (“localhost does not exist”).

Well, I could not find a bench command to “delete” a site, so I removed the frappe-bench/sites/ folder to create a new one again, but it looks like it was a bad move:

OSError: [Errno 2] No such file or directory: ‘./sites’

So I nuked the frappe-bench/ and started again, this time creating the site “localhost” instead of “site1.local”. The result:

Exception: Database 334389048b872a53 already exists

If I try to access it with the browser anyway:

OperationalError: (1045, “Access denied for user ‘334389048b872a53’@‘localhost’ (using password: YES)”)

Sigh… This seems like a very brittle system. No matter which install instructions I follow, I’m finding problems at every corner.

I dropped the bench tables from mariadb, created the site again:

bench new-site localhost

And was received in the browser with the message:

ProgrammingError: (1146, “Table ‘334389048b872a53.tabDefaultValue’ doesn’t exist”)

I nuked everything - again. :unamused:
Let me give it one more try:

bench init frappe-bench && cd frappe-bench/
bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
bench new-site localhost
bench start

Same problem:

ProgrammingError: (1146, “Table ‘334389048b872a53.tabDefaultValue’ doesn’t exist”)

This thread recommends the command:

bench migrate

[details=but it fails!]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/ric/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ric/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ric/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/ric/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/ric/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/ric/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/ric/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/ric/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/ric/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/ric/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ric/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 204, in migrate
for site in context.sites:
TypeError: ‘NoneType’ object is not iterable
[/details]

Now, for something completely different:

bench set-default-site localhost

[details=“frappe app is not installed”! Why?]frappe app is not installed. Run the following command to install frappe
bench get-app GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
/bin/sh: 1: /home/ric/frappe/frappe-bench/env/bin/frappe: not found
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/ric/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/ric/.bench/bench/commands/utils.py”, line 71, in set_default_site
set_default_site(site)
File “/home/ric/.bench/bench/utils.py”, line 364, in set_default_site
cwd=os.path.join(bench_path, ‘sites’))
File “/home/ric/.bench/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: /home/ric/frappe/frappe-bench/env/bin/frappe --use localhost
[/details]

OK, I thought it was installed by any of the commands before… but let’s do it again:

bench get-app GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

[details=“fatal: destination path ‘frappe’ already exists and is not an empty directory”]INFO:bench.app:getting app frappe
fatal: destination path ‘frappe’ already exists and is not an empty directory.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/ric/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/ric/.bench/bench/commands/make.py”, line 30, in get_app
get_app(git_url, branch=branch)
File “/home/ric/.bench/bench/app.py”, line 62, in get_app
cwd=os.path.join(bench_path, ‘apps’))
File “/home/ric/.bench/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --depth 1 --origin upstream[/details]

Now I’m out of ideas. And tired. And hungry. Sorry for the long rant, but I was really excited about the idea of using ERPNext and contributing to the project, but I feel like the documentation and installation process need an overhaul, to say the least…

1 Like