Install ERPNext to default site failed

Hello there, I’m trying to install ERPNext on my ubuntu 17.10 and i can’t just fix this error below:

TASK [bench : Check if ERPNext App exists] *************************************
ok: [localhost]

TASK [bench : Get the ERPNext app] *********************************************
skipping: [localhost]

TASK [bench : Check whether a site called site1.local exists] ******************
ok: [localhost]

TASK [bench : Create a new site] ***********************************************
skipping: [localhost]

TASK [bench : Install ERPNext to default site] *********************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "--site", "site1.local", "install-app", "erpnext"], "delta": "0:00:02.961569", "end": "2018-03-09 17:21:00.206327", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-03-09 17:20:57.244758", "stderr": "Traceback (most recent call last):\n  File \"/usr/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\n    \"__main__\", mod_spec)\n  File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 94, in <module>\n    main()\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py\", line 17, in new_func\n    return f(get_current_context(), *args, **kwargs)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func\n    ret = f(frappe._dict(ctx.obj), *args, **kwargs)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/commands/site.py\", line 165, in install_app\n    _install_app(app, verbose=context.verbose)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/installer.py\", line 111, in install_app\n    frappe.clear_cache()\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 517, in clear_cache\n    for fn in get_hooks(\"clear_cache\"):\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 833, in get_hooks\n    hooks = _dict(cache().get_value(\"app_hooks\", load_app_hooks))\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py\", line 73, in get_value\n    val = generator()\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 811, in load_app_hooks\n    for app in [app_name] if app_name else get_installed_apps(sort=True):\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 775, in get_installed_apps\n    installed = json.loads(db.get_global(\"installed_apps\") or \"[]\")\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 730, in get_global\n    return self.get_default(key, user)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 742, in get_default\n    d = self.get_defaults(key, parent)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 748, in get_defaults\n    defaults = frappe.defaults.get_defaults(parent)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/defaults.py\", line 57, in get_defaults\n    globald = get_defaults_for()\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/defaults.py\", line 177, in get_defaults_for\n    where parent = %s order by creation\"\"\", (parent,), as_dict=1)\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 143, in sql\n    self.connect()\n  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 93, in connect\n    charset='utf8mb4', use_unicode = True, conv = conversions, local_infile = self.local_infile)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/__init__.py\", line 90, in Connect\n    return Connection(*args, **kwargs)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 699, in __init__\n    self.connect()\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 936, in connect\n    self._request_authentication()\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in _request_authentication\n    auth_packet = self._read_packet()\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 1018, in _read_packet\n    packet.check_error()\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 384, in check_error\n    err.raise_mysql_exception(self._data)\n  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py\", line 107, in raise_mysql_exception\n    raise errorclass(errno, errval)\npymysql.err.InternalError: (1698, \"Access denied for user '1bd3e0294da19198'@'localhost'\")", "stderr_lines": ["Traceback (most recent call last):", "  File \"/usr/lib/python3.6/runpy.py\", line 193, in _run_module_as_main", "    \"__main__\", mod_spec)", "  File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code", "    exec(code, run_globals)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 94, in <module>", "    main()", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main", "    click.Group(commands=commands)(prog_name='bench')", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 722, in __call__", "    return self.main(*args, **kwargs)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 697, in main", "    rv = self.invoke(ctx)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 895, in invoke", "    return ctx.invoke(self.callback, **ctx.params)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 535, in invoke", "    return callback(*args, **kwargs)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py\", line 17, in new_func", "    return f(get_current_context(), *args, **kwargs)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func", "    ret = f(frappe._dict(ctx.obj), *args, **kwargs)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/commands/site.py\", line 165, in install_app", "    _install_app(app, verbose=context.verbose)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/installer.py\", line 111, in install_app", "    frappe.clear_cache()", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 517, in clear_cache", "    for fn in get_hooks(\"clear_cache\"):", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 833, in get_hooks", "    hooks = _dict(cache().get_value(\"app_hooks\", load_app_hooks))", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py\", line 73, in get_value", "    val = generator()", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 811, in load_app_hooks", "    for app in [app_name] if app_name else get_installed_apps(sort=True):", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/__init__.py\", line 775, in get_installed_apps", "    installed = json.loads(db.get_global(\"installed_apps\") or \"[]\")", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 730, in get_global", "    return self.get_default(key, user)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 742, in get_default", "    d = self.get_defaults(key, parent)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 748, in get_defaults", "    defaults = frappe.defaults.get_defaults(parent)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/defaults.py\", line 57, in get_defaults", "    globald = get_defaults_for()", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/defaults.py\", line 177, in get_defaults_for", "    where parent = %s order by creation\"\"\", (parent,), as_dict=1)", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 143, in sql", "    self.connect()", "  File \"/home/karbalavm/frappe-bench/apps/frappe/frappe/database.py\", line 93, in connect", "    charset='utf8mb4', use_unicode = True, conv = conversions, local_infile = self.local_infile)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/__init__.py\", line 90, in Connect", "    return Connection(*args, **kwargs)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 699, in __init__", "    self.connect()", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 936, in connect", "    self._request_authentication()", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 1156, in _request_authentication", "    auth_packet = self._read_packet()", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 1018, in _read_packet", "    packet.check_error()", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py\", line 384, in check_error", "    err.raise_mysql_exception(self._data)", "  File \"/home/karbalavm/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py\", line 107, in raise_mysql_exception", "    raise errorclass(errno, errval)", "pymysql.err.InternalError: (1698, \"Access denied for user '1bd3e0294da19198'@'localhost'\")"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=52   changed=9    unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 387, in <module>
    install_bench(args)
  File "install.py", line 109, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 325, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=karbalavm']' returned non-zero exit status 2

any help would be appreciated
thanks in advance

Hi,
which commands did u followed??

i suspect the ubuntu 17.10 is not supported yet
try ubuntu 16.04

You also seem to be using python 3.x (2.7 is recommended). I’m not sure if it’s relevent, but maybe downgrade that and try it again

I’m executing the install.py after I git clone the Frappe bench here is the command:

Python install.py --develop

I had installed all prequisits before that so i think it must work fine on 17.
Besides I have Python 2.7 installed not higher @trentmu

Sorry, i just saw this in your logs…

So I guessed it might be a version problem

No need to be sorry
Thanks for your reply !!

1 Like

Try.
sudo python install.py --develop --user username

@imushir i tried that too but still facing the same error
it seems that i have an authentication problem since at the last few lines of the error it says:
Access denied for user ‘1bd3e0294da19198’@‘localhost’

i think it is a MySql authentication issue but i just don’t know how to fix it.

Can post commands that you had tried??

I tried those commands:
sudo python install .py --develop --user frappe
sudo python install .py --develop --user karbalavm
sudo python install .py --develop
sudo python install .py --mysqlrootpassowrd = admin

And neither worked

Please note that there is no space in “install.py” it is not allowing me to post the reply without spaces

Hii,
Please go through

Link this

Thanks all for your answers although neither worked.

After some investigations, I’m now pretty sure that it is a mysql user’s permission issue i tried to add the new users with full privilege including (admin, root, karbalavm, administrator, frappe, username, 1bd3e0294da19198) but it just didn’t work.

I will just try to reinstall again on a fresh vm hope that this issue will be fixed soon.

Hello guys, after a lot of hours wasted on trying this run on my Ubuntu 17.10, nothing did work.

I solved the problem through installing a new fresh Ubuntu 16 and just reinstall the ERPNext + Frappe bench again and now everything is fine. I know this is not a solution however it might be a compatibility issue, i just have no idea what it was.

Thanks!!

If you desperately want to use ubuntu 17.10, you will probably have to do a manual install.
Guide: Manual Install ERPNext on Ubuntu 16.xx & Debian v8 & 9 is a very good article.

There are one or 2 things that you have to add, but the forum has a lot of links and tips