ERROR installing ERPNEXT in ubuntu 18.04

install erpnext in ubuntu18.04

ERROR

TASK [bench : Install ERPNext to default site] ************************************************************************************************
task path: /tmp/.bench/playbooks/roles/bench/tasks/setup_erpnext.yml:23
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/tmp/ansible-tmp-1572034341.741801-64249705100216 `" && echo ansible-tmp-1572034341.741801-64249705100216="` echo /var/tmp/ansible-tmp-1572034341.741801-64249705100216 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-32034z5or0j05/tmpj88shqxp TO /var/tmp/ansible-tmp-1572034341.741801-64249705100216/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1572034341.741801-64249705100216/ /var/tmp/ansible-tmp-1572034341.741801-64249705100216/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/tmp/ansible-tmp-1572034341.741801-64249705100216/ /var/tmp/ansible-tmp-1572034341.741801-64249705100216/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chown frappe /var/tmp/ansible-tmp-1572034341.741801-64249705100216/ /var/tmp/ansible-tmp-1572034341.741801-64249705100216/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u frappe /bin/sh -c '"'"'echo BECOME-SUCCESS-fzrogmqopkccgffgwtexftnbqfiphpnr ; /usr/bin/python3 /var/tmp/ansible-tmp-1572034341.741801-64249705100216/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1572034341.741801-64249705100216/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": [
        "bench",
        "--site",
        "site1.local",
        "install-app",
        "erpnext"
    ],
    "delta": "0:01:28.086967",
    "end": "2019-10-25 22:13:50.033347",
    "invocation": {
        "module_args": {
            "_raw_params": "bench --site site1.local install-app erpnext",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/home/frappe/frappe-bench",
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2019-10-25 22:12:21.946380",
    "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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 97, in <module>\n    main()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 764, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 717, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1137, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1137, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 956, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 555, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func\n    ret = f(frappe._dict(ctx.obj), *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 173, in install_app\n    _install_app(app, verbose=context.verbose)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 84, in install_app\n    add_to_installed_apps(name)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 108, in add_to_installed_apps\n    post_install(rebuild_website)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 169, in post_install\n    init_singles()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 190, in init_singles\n    doc.save()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 272, in save\n    return self._save(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 295, in _save\n    self.insert()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 223, in insert\n    self._validate_links()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 756, in _validate_links\n    frappe.LinkValidationError)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 360, in throw\n    msgprint(msg, raise_exception=exc, title=title, indicator='red')\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 346, in msgprint\n    _raise_exception()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 315, in _raise_exception\n    raise raise_exception(msg)\nfrappe.exceptions.LinkValidationError: Could not find Default Currency: INR",
    "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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 97, in <module>",
        "    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/lib/python3.6/site-packages/click/core.py\", line 764, in __call__",
        "    return self.main(*args, **kwargs)",
        "  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 717, in main",
        "    rv = self.invoke(ctx)",
        "  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1137, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 1137, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 956, in invoke",
        "    return ctx.invoke(self.callback, **ctx.params)",
        "  File \"/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py\", line 555, in invoke",
        "    return callback(*args, **kwargs)",
        "  File \"/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func",
        "    ret = f(frappe._dict(ctx.obj), *args, **kwargs)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 173, in install_app",
        "    _install_app(app, verbose=context.verbose)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 84, in install_app",
        "    add_to_installed_apps(name)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 108, in add_to_installed_apps",
        "    post_install(rebuild_website)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 169, in post_install",
        "    init_singles()",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 190, in init_singles",
        "    doc.save()",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 272, in save",
        "    return self._save(*args, **kwargs)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 295, in _save",
        "    self.insert()",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 223, in insert",
        "    self._validate_links()",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 756, in _validate_links",
        "    frappe.LinkValidationError)",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 360, in throw",
        "    msgprint(msg, raise_exception=exc, title=title, indicator='red')",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 346, in msgprint",
        "    _raise_exception()",
        "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 315, in _raise_exception",
        "    raise raise_exception(msg)",
        "frappe.exceptions.LinkValidationError: Could not find Default Currency: INR"
    ],
    "stdout": "\nInstalling erpnext...\n\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        
    ]
}

PLAY RECAP ************************************************************************************************************************************
localhost                  : ok=74   changed=13   unreachable=0    failed=1    skipped=57   rescued=0    ignored=0

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

I got this error message too when easy installation of erpnext on clean ubuntu server 18.04.3.

Maybe some VPS have issues with locales.
$ sudo apt install locales && sudo locale-gen en_US.UTF-8

And try erpnext installation again.

2 Likes

Me too, been getting that issue since 12.1.7 update. I thought I’d try again on Monday, because the errors are related to setting up an ERPNext site, and I think the devs would update their script or push a change :slight_smile:

I solved my problems in ubuntu 18.04
1- go to /etc/sysctl.conf
2- Remove or Hashing net.ipv6.conf.all.disable_ipv6 = 1
4- go to /etc/redis/redis.conf
5- remove bind 127.0.0.1 ::1 and ADD bind 127.0.0.1

After that getting error

subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

solved it by reset mysql root password

2 Likes

After that getting error

subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

solved it by reset mysql root password

1 Like

fixed this by:
sudo apt install locales && sudo locale-gen en_US.UTF-8
working now.

2 Likes

solved with this:

thanks man.

Trying to install ERPNext for 4 days now. after the fix in install.py to pin ansible it stil fails:

RUNNING HANDLER [mariadb : restart mysql] **************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *********************************************************************
localhost : ok=30 changed=19 unreachable=0 failed=1 skipped=21 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 413, in
install_bench(args)
File “install.py”, line 135, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 327, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=sem’]’ returned non-zero exit status 2
erp@erp:~$

It seems inpossible to use easy install at the moment.

frappe-bench$ bench --site erpnext-site install-app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench

Installing erpnext…
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/erpnext/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/erpnext/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/erpnext/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 165, in install_app
_install_app(app, verbose=context.verbose)
File “/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/installer.py”, line 131, in install_app
frappe.only_for(“System Manager”)

File “/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 480, in only_for
raise PermissionError
frappe.exceptions.PermissionError

any suggetions?
thanks all