Unable to Install ERPNext manually or via Script

I have been trying to install ERPNext on my Ubuntu 14.04 LTS server for two days but the errors/bugs make it impossible. I have tried the script install version from Frappe 's github and also the manual installation. Right now I am trying to install it via the script and fix all the errors all the way.

Here’s the code. I can’t remember what I did, but I passed through this NTPD Enable error. Then I got stuck on dns.
NOTE: I edited “install.py” below to “install. py” as I was unable to post this without it.

TASK [ntpd : Enable ntpd] ******************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to issue method call: Unit ntp.service failed to load: No such file or directory. See system logs and 'systemctl status ntp.service' for details.\n"}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost : ok=16 changed=5 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 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2
frappe@vmi120537:~$ sudo systemctl status ntp.service
ntp.service
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
frappe@vmi120537:~$ sudo service ntp restart
* Stopping NTP server ntpd [ OK ] 
* Starting NTP server ntpd
frappe@vmi120537:~$ python --version
Python 2.7.6
  1. Install using root user and not frappe user
  2. May I know the exact sequence of steps you followed, to arrive at this
  3. Can you give some more details about the server/host you’re using

Thanks for the reply.

I installed everything with root user. Only switched to frappe user to install bench as stated on github.com/frappe/bench

I followed all the steps from


to install the Prerequisites. And then after installing, went back to github.com/frappe/bench to install bench, adding site & apps.

Contabo VPS
Ubuntu 14.04 (64 Bit)
2 Cores,
6 GB Ram

This server already hosts Odoo. I am exploring ERPNext so that I can switch to it.
Also, I have 2 Odoo servers.
I have tried the manual installation of ERPNEXT and the scripted method about 3-4 times on each server. But failed. Tried with uninstalling bench and frappe-bench completely, and also by just reinstalling over the previous installation so that the missing files (if any) may be installed.

Automated install is for setting up ERPNext on a fresh server, and these steps can be followed:

cd ~
apt-get update && apt-get upgrade -y
apt-get install -y curl git wget python-dev gcc
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --user frappe --mysql-root-password mysql_password_you_want --admin-password admin_pass_you_want

If you face any errors in this process post the error log here.


For manual install please follow this guide,

2 Likes

Thanks, the Hitchhiker’s guide helped a little bit, but I had to resolve some errors on the way. Also, now I am stuck on the Sorry! We will be back soon. page.
I have been on this page on my previous installs. Tried to setup nginx, but no luck with it.
Also, I’ve tried all the solutions posted on these forums for the same Sorry! We will be back soon. page. But nothing seems to be working.

You are persistent - and after a failed install you best clean up?

Installation frappe/env/bin error on Ubuntu 14.04

1 Like

It worked for me after removing ntp (sudo apt purge ntp) and letting the script reinstall.

That aside, I’ve more bugs to report, where can I do so? For example, when it asks for administrator and DB password, it accepts blank entries but fail when configuring database. And of course even if installation succeeded, the login form doesn’t accept empty password box. Then there’s npm. When it’s installing yarn or something, it’ll fail because there’s no npm in the system. It should be one of the packages the script installs by itself.

1 Like

I resolved the npm issue a couple of days ago. I’ve faced every possible problem in installing ERPNext.
So frustating.
Your ntp solution looks good, lemme try that. Cheers

1 Like

Yeah, it’d be great if there was a proper manual installation guide, like what exactly and what version needs to be installed. The script’s too big to manually go through and see what’s going on, and the error messages aren’t the most helpful.

I’ve been trying to get ERPNext running on Raspberry Pi 3 for a week now, and I’ve faced unresolved dependency issues on Raspbian, CentOS and Ubuntu MATE. Ubuntu Server supports only RPi2, today I finally got it to work after some minor modifications on RPi2. I’m installing using the script as I write.

And here we go, I’m stuck at the last step again:

TASK [bench : Create a new site] ***********************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "0", "--mariadb-root-password", "0"], "delta": "0:00:02.611210", "end": "2018-03-24 16:51:25.486532", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-03-24 16:51:22.875322", "stderr": "INFO:bench.utils:creating new site site1.local\nINFO:bench.utils:/home/frappe/frappe-bench/env/bin/frappe site1.local --install 1bd3e0294d --root_password 0 --admin_password 0\n/bin/sh: 1: /home/frappe/frappe-bench/env/bin/frappe: not found\nTraceback (most recent call last):\n  File \"/usr/local/bin/bench\", line 11, in <module>\n    load_entry_point('bench', 'console_scripts', 'bench')()\n  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli\n    bench_command()\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/.bench/bench/commands/make.py\", line 64, in new_site\n    new_site(site, mariadb_root_password=mariadb_root_password, admin_password=admin_password)\n  File \"/home/frappe/.bench/bench/utils.py\", line 202, in new_site\n    ), cwd=os.path.join(bench_path, 'sites'))\n  File \"/home/frappe/.bench/bench/utils.py\", line 152, in exec_cmd\n    raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/frappe site1.local --install 1bd3e0294d --root_password 0 --admin_password 0", "stderr_lines": ["INFO:bench.utils:creating new site site1.local", "INFO:bench.utils:/home/frappe/frappe-bench/env/bin/frappe site1.local --install 1bd3e0294d --root_password 0 --admin_password 0", "/bin/sh: 1: /home/frappe/frappe-bench/env/bin/frappe: not found", "Traceback (most recent call last):", "  File \"/usr/local/bin/bench\", line 11, in <module>", "    load_entry_point('bench', 'console_scripts', 'bench')()", "  File \"/home/frappe/.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/frappe/.bench/bench/commands/make.py\", line 64, in new_site", "    new_site(site, mariadb_root_password=mariadb_root_password, admin_password=admin_password)", "  File \"/home/frappe/.bench/bench/utils.py\", line 202, in new_site", "    ), cwd=os.path.join(bench_path, 'sites'))", "  File \"/home/frappe/.bench/bench/utils.py\", line 152, in exec_cmd", "    raise CommandFailedError(cmd)", "bench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/frappe site1.local --install 1bd3e0294d --root_password 0 --admin_password 0"], "stdout": "frappe app is not installed. Run the following command to install frappe\nbench get-app https://github.com/frappe/frappe.git", "stdout_lines": ["frappe app is not installed. Run the following command to install frappe", "bench get-app https://github.com/frappe/frappe.git"]}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=75   changed=13   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 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Slightly different error this time: https://pastebin.com/QqZ5PRxF (Pastebin because message exceeds forum character limit.

EDIT Yet another variant:

TASK [bench : Get the ERPNext app] *********************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "get-app", "erpnext", "https://github.com/frappe/erpnext", "--branch", "master"], "delta": "0:06:25.535937", "end": "2018-03-24 18:44:05.777578", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-03-24 18:37:40.241641", "stderr": "INFO:bench.app:getting app erpnext\nINFO:bench.utils:git clone https://github.com/frappe/erpnext --branch master --depth 1 --origin upstream\nCloning into 'erpnext'...\nChecking out files:  17% (1107/6329)   \rChecking out files:  18% (1140/6329)   \rChecking out files:  19% (1203/6329)   \rChecking out files:  19% (1216/6329)   \rChecking out files:  20% (1266/6329)   \rChecking out files:  20% (1323/6329)   \rChecking out files:  21% (1330/6329)   \rChecking out files:  22% (1393/6329)   \rChecking out files:  22% (1432/6329)   \rChecking out files:  23% (1456/6329)   \rChecking out files:  23% (1486/6329)   \rChecking out files:  24% (1519/6329)   \rChecking out files:  24% (1545/6329)   \rChecking out files:  25% (1583/6329)   \rChecking out files:  25% (1604/6329)   \rChecking out files:  26% (1646/6329)   \rChecking out files:  27% (1709/6329)   \rChecking out files:  28% (1773/6329)   \rChecking out files:  29% (1836/6329)   \rChecking out files:  29% (1897/6329)   \rChecking out files:  30% (1899/6329)   \rChecking out files:  30% (1917/6329)   \rChecking out files:  30% (1919/6329)   \rChecking out files:  30% (1924/6329)   \rChecking out files:  31% (1962/6329)   \rChecking out files:  31% (1968/6329)   \rChecking out files:  32% (2026/6329)   \rChecking out files:  33% (2089/6329)   \rChecking out files:  33% (2135/6329)   \rChecking out files:  34% (2152/6329)   \rChecking out files:  34% (2203/6329)   \rChecking out files:  35% (2216/6329)   \rChecking out files:  36% (2279/6329)   \rChecking out files:  37% (2342/6329)   \rChecking out files:  38% (2406/6329)   \rChecking out files:  39% (2469/6329)   \rChecking out files:  40% (2532/6329)   \rChecking out files:  41% (2595/6329)   \rChecking out files:  42% (2659/6329)   \rChecking out files:  43% (2722/6329)   \rChecking out files:  44% (2785/6329)   \rChecking out files:  45% (2849/6329)   \rChecking out files:  46% (2912/6329)   \rChecking out files:  47% (2975/6329)   \rChecking out files:  48% (3038/6329)   \rChecking out files:  49% (3102/6329)   \rChecking out files:  50% (3165/6329)   \rChecking out files:  51% (3228/6329)   \rChecking out files:  52% (3292/6329)   \rChecking out files:  53% (3355/6329)   \rChecking out files:  54% (3418/6329)   \rChecking out files:  55% (3481/6329)   \rChecking out files:  56% (3545/6329)   \rChecking out files:  57% (3608/6329)   \rChecking out files:  58% (3671/6329)   \rChecking out files:  59% (3735/6329)   \rChecking out files:  60% (3798/6329)   \rChecking out files:  61% (3861/6329)   \rChecking out files:  62% (3924/6329)   \rChecking out files:  63% (3988/6329)   \rChecking out files:  64% (4051/6329)   \rChecking out files:  65% (4114/6329)   \rChecking out files:  66% (4178/6329)   \rChecking out files:  67% (4241/6329)   \rChecking out files:  68% (4304/6329)   \rChecking out files:  69% (4368/6329)   \rChecking out files:  70% (4431/6329)   \rChecking out files:  71% (4494/6329)   \rChecking out files:  72% (4557/6329)   \rChecking out files:  73% (4621/6329)   \rChecking out files:  74% (4684/6329)   \rChecking out files:  74% (4703/6329)   \rChecking out files:  75% (4747/6329)   \rChecking out files:  76% (4811/6329)   \rChecking out files:  77% (4874/6329)   \rChecking out files:  78% (4937/6329)   \rChecking out files:  79% (5000/6329)   \rChecking out files:  80% (5064/6329)   \rChecking out files:  81% (5127/6329)   \rChecking out files:  82% (5190/6329)   \rChecking out files:  83% (5254/6329)   \rChecking out files:  84% (5317/6329)   \rChecking out files:  85% (5380/6329)   \rChecking out files:  86% (5443/6329)   \rChecking out files:  87% (5507/6329)   \rChecking out files:  88% (5570/6329)   \rChecking out files:  89% (5633/6329)   \rChecking out files:  90% (5697/6329)   \rChecking out files:  91% (5760/6329)   \rChecking out files:  92% (5823/6329)   \rChecking out files:  93% (5886/6329)   \rChecking out files:  94% (5950/6329)   \rChecking out files:  95% (6013/6329)   \rChecking out files:  96% (6076/6329)   \rChecking out files:  97% (6140/6329)   \rChecking out files:  98% (6203/6329)   \rChecking out files:  98% (6241/6329)   \rChecking out files:  98% (6246/6329)   \rChecking out files:  98% (6258/6329)   \rChecking out files:  99% (6266/6329)   \rChecking out files: 100% (6329/6329)   \rChecking out files: 100% (6329/6329), done.\nINFO:bench.app:installing erpnext\nINFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext --no-cache-dir\nTraceback (most recent call last):\n  File \"/usr/lib/python2.7/runpy.py\", line 174, in _run_module_as_main\n    \"__main__\", fname, loader, pkg_name)\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 94, 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/local/lib/python2.7/site-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py\", line 20, in build\n    frappe.build.bundle(no_compress, make_copy=make_copy, restore = restore, verbose=verbose)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/build.py\", line 40, in bundle\n    subprocess.call(command.split(' '))\n  File \"/usr/lib/python2.7/subprocess.py\", line 523, in call\n    return Popen(*popenargs, **kwargs).wait()\n  File \"/usr/lib/python2.7/subprocess.py\", line 711, in __init__\n    errread, errwrite)\n  File \"/usr/lib/python2.7/subprocess.py\", line 1343, in _execute_child\n    raise child_exception\nOSError: [Errno 2] No such file or directory", "stderr_lines": ["INFO:bench.app:getting app erpnext", "INFO:bench.utils:git clone https://github.com/frappe/erpnext --branch master --depth 1 --origin upstream", "Cloning into 'erpnext'...", "Checking out files:  17% (1107/6329)   ", "Checking out files:  18% (1140/6329)   ", "Checking out files:  19% (1203/6329)   ", "Checking out files:  19% (1216/6329)   ", "Checking out files:  20% (1266/6329)   ", "Checking out files:  20% (1323/6329)   ", "Checking out files:  21% (1330/6329)   ", "Checking out files:  22% (1393/6329)   ", "Checking out files:  22% (1432/6329)   ", "Checking out files:  23% (1456/6329)   ", "Checking out files:  23% (1486/6329)   ", "Checking out files:  24% (1519/6329)   ", "Checking out files:  24% (1545/6329)   ", "Checking out files:  25% (1583/6329)   ", "Checking out files:  25% (1604/6329)   ", "Checking out files:  26% (1646/6329)   ", "Checking out files:  27% (1709/6329)   ", "Checking out files:  28% (1773/6329)   ", "Checking out files:  29% (1836/6329)   ", "Checking out files:  29% (1897/6329)   ", "Checking out files:  30% (1899/6329)   ", "Checking out files:  30% (1917/6329)   ", "Checking out files:  30% (1919/6329)   ", "Checking out files:  30% (1924/6329)   ", "Checking out files:  31% (1962/6329)   ", "Checking out files:  31% (1968/6329)   ", "Checking out files:  32% (2026/6329)   ", "Checking out files:  33% (2089/6329)   ", "Checking out files:  33% (2135/6329)   ", "Checking out files:  34% (2152/6329)   ", "Checking out files:  34% (2203/6329)   ", "Checking out files:  35% (2216/6329)   ", "Checking out files:  36% (2279/6329)   ", "Checking out files:  37% (2342/6329)   ", "Checking out files:  38% (2406/6329)   ", "Checking out files:  39% (2469/6329)   ", "Checking out files:  40% (2532/6329)   ", "Checking out files:  41% (2595/6329)   ", "Checking out files:  42% (2659/6329)   ", "Checking out files:  43% (2722/6329)   ", "Checking out files:  44% (2785/6329)   ", "Checking out files:  45% (2849/6329)   ", "Checking out files:  46% (2912/6329)   ", "Checking out files:  47% (2975/6329)   ", "Checking out files:  48% (3038/6329)   ", "Checking out files:  49% (3102/6329)   ", "Checking out files:  50% (3165/6329)   ", "Checking out files:  51% (3228/6329)   ", "Checking out files:  52% (3292/6329)   ", "Checking out files:  53% (3355/6329)   ", "Checking out files:  54% (3418/6329)   ", "Checking out files:  55% (3481/6329)   ", "Checking out files:  56% (3545/6329)   ", "Checking out files:  57% (3608/6329)   ", "Checking out files:  58% (3671/6329)   ", "Checking out files:  59% (3735/6329)   ", "Checking out files:  60% (3798/6329)   ", "Checking out files:  61% (3861/6329)   ", "Checking out files:  62% (3924/6329)   ", "Checking out files:  63% (3988/6329)   ", "Checking out files:  64% (4051/6329)   ", "Checking out files:  65% (4114/6329)   ", "Checking out files:  66% (4178/6329)   ", "Checking out files:  67% (4241/6329)   ", "Checking out files:  68% (4304/6329)   ", "Checking out files:  69% (4368/6329)   ", "Checking out files:  70% (4431/6329)   ", "Checking out files:  71% (4494/6329)   ", "Checking out files:  72% (4557/6329)   ", "Checking out files:  73% (4621/6329)   ", "Checking out files:  74% (4684/6329)   ", "Checking out files:  74% (4703/6329)   ", "Checking out files:  75% (4747/6329)   ", "Checking out files:  76% (4811/6329)   ", "Checking out files:  77% (4874/6329)   ", "Checking out files:  78% (4937/6329)   ", "Checking out files:  79% (5000/6329)   ", "Checking out files:  80% (5064/6329)   ", "Checking out files:  81% (5127/6329)   ", "Checking out files:  82% (5190/6329)   ", "Checking out files:  83% (5254/6329)   ", "Checking out files:  84% (5317/6329)   ", "Checking out files:  85% (5380/6329)   ", "Checking out files:  86% (5443/6329)   ", "Checking out files:  87% (5507/6329)   ", "Checking out files:  88% (5570/6329)   ", "Checking out files:  89% (5633/6329)   ", "Checking out files:  90% (5697/6329)   ", "Checking out files:  91% (5760/6329)   ", "Checking out files:  92% (5823/6329)   ", "Checking out files:  93% (5886/6329)   ", "Checking out files:  94% (5950/6329)   ", "Checking out files:  95% (6013/6329)   ", "Checking out files:  96% (6076/6329)   ", "Checking out files:  97% (6140/6329)   ", "Checking out files:  98% (6203/6329)   ", "Checking out files:  98% (6241/6329)   ", "Checking out files:  98% (6246/6329)   ", "Checking out files:  98% (6258/6329)   ", "Checking out files:  99% (6266/6329)   ", "Checking out files: 100% (6329/6329)   ", "Checking out files: 100% (6329/6329), done.", "INFO:bench.app:installing erpnext", "INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext --no-cache-dir", "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 <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/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/apps/frappe/frappe/commands/utils.py\", line 20, in build", "    frappe.build.bundle(no_compress, make_copy=make_copy, restore = restore, verbose=verbose)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/build.py\", line 40, in bundle", "    subprocess.call(command.split(' '))", "  File \"/usr/lib/python2.7/subprocess.py\", line 523, in call", "    return Popen(*popenargs, **kwargs).wait()", "  File \"/usr/lib/python2.7/subprocess.py\", line 711, in __init__", "    errread, errwrite)", "  File \"/usr/lib/python2.7/subprocess.py\", line 1343, in _execute_child", "    raise child_exception", "OSError: [Errno 2] No such file or directory"], "stdout": "('installing', u'erpnext')", "stdout_lines": ["('installing', u'erpnext')"]}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=74   changed=15   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 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

You’re having issues with creating apps and site. Try to manually download and install that. And then try running the script.

To do that, I need to switch user to frappe (I’m doing install.py --production), but I don’t know the sudo password the script set for the user. It’s not the administrator password I gave.

I tried it anyway:

$ sudo su frappe 
sudo: unable to resolve host ubuntu
frappe@ubuntu:/home/ubuntu$  cd ~/frappe-bench/
frappe@ubuntu:~/frappe-bench$  bench new-site site1.local --admin-password 0 --mariadb-root-password 0
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 <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/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/apps/frappe/frappe/commands/site.py", line 34, in new_site
    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 65, in _new_site
    admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 36, in install_db
    create_database_and_user(force, verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 60, in create_database_and_user
    if force or (db_name not in dbman.get_database_list()):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 549, in get_database_list
    return [d[0] for d in self.db.sql("SHOW DATABASES")]
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 136, in sql
    self.connect()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 86, in connect
    charset='utf8mb4', use_unicode = True, conv = conversions)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/__init__.py", line 90, in Connect
    return Connection(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 699, in __init__
    self.connect()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 936, in connect
    self._request_authentication()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1156, in _request_authentication
    auth_packet = self._read_packet()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.InternalError: (1698, u"Access denied for user 'root'@'localhost'")

It’s obvious I need sudo privilege on frappe, but I ain’t got password for that.

Try resetting MySql password.

Resetting didn’t help, so I went with fresh Ubuntu install:

RUNNING HANDLER [mariadb : restart mysql] **************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to restart service mysql: Job for mysql.service failed because the control process exited with error code. See \"systemctl status mysql.service\" and \"journalctl -xe\" for details.\n"}

RUNNING HANDLER [nginx : restart nginx] ****************************************

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=65   changed=41   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 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2