Sudo python install.py --develop error on AWS Lightsail

  1. Create AWS Lightsail Ubuntu 16 Instance
    image

image

  1. Connect using SSH
    image

  2. su root
    image

  3. apt update
    image

  4. apt-get update
    image

  5. apt-get install python-minimal
    image

  6. apt-get install build-essential python-setuptools
    image

  7. wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
    image

  8. python install.py --develop --user frappe
    image

  9. Enter mysql and Administrator password
    image

TASK [bench : python3 bench init for develop] **********************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "init", "/home/frappe/frappe-bench", "--frappe-path", "https://github.com/frappe/frappe", "--frappe-branch", "develop", "--python", "python3"], "delta": "0:03:41.444370", "end": "2019-02-18 06:28:35.879458", "msg": "non-zero return code", "rc": 1, "start": "2019-02-18 06:24:54.435088", "stderr": "INFO:bench.utils:virtualenv -q env -p /usr/bin/python3
INFO:bench.utils:env/bin/pip -q install --upgrade pip
INFO:bench.utils:env/bin/pip -q install wheel
INFO:bench.utils:env/bin/pip -q install six
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop  --origin upstream
Cloning into 'frappe'...
INFO:bench.app:installing frappe
INFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe 
INFO:bench.utils:yarn install
warning \"rollup-plugin-vue > @vue/component-compiler@3.4.4\" has unmet peer dependency \"postcss@>=6.0\".
error An unexpected error occurred: \"/home/frappe/frappe-bench/apps/frappe/node_modules/cypress: spawn ENOMEM\".
warning Error running install script for optional dependency: \"/home/frappe/frappe-bench/apps/frappe/node_modules/uws: spawn ENOMEM\"
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 764, in __call__
    return self.main(*args, **kwargs)
  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 717, in main
    rv = self.invoke(ctx)
  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 555, in invoke
    return callback(*args, **kwargs)
  File \"/home/frappe/.bench/bench/commands/make.py\", line 30, in init
    python \t\t = python)
  File \"/home/frappe/.bench/bench/utils.py\", line 83, in init
    update_node_packages(bench_path=path)
  File \"/home/frappe/.bench/bench/utils.py\", line 449, in update_node_packages
    update_yarn_packages(bench_path)
  File \"/home/frappe/.bench/bench/utils.py\", line 462, in update_yarn_packages
    exec_cmd('yarn install', cwd=app_path)
  File \"/home/frappe/.bench/bench/utils.py\", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install", "stderr_lines": [
	"INFO:bench.utils:virtualenv -q env -p /usr/bin/python3",
	"INFO:bench.utils:env/bin/pip -q install --upgrade pip",
	"INFO:bench.utils:env/bin/pip -q install wheel",
	"INFO:bench.utils:env/bin/pip -q install six",
	"INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit",
	"INFO:bench.app:getting app frappe",
	"INFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop  --origin upstream",
	"Cloning into 'frappe'...",
	"INFO:bench.app:installing frappe",
	"INFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe ",
	"INFO:bench.utils:yarn install",
	"warning \"rollup-plugin-vue > @vue/component-compiler@3.4.4\" has unmet peer dependency \"postcss@>=6.0\".",
	"error An unexpected error occurred: \"/home/frappe/frappe-bench/apps/frappe/node_modules/cypress: spawn ENOMEM\".",
	"warning Error running install script for optional dependency: \"/home/frappe/frappe-bench/apps/frappe/node_modules/uws: spawn ENOMEM\"",
	"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 764, in __call__",
	"    return self.main(*args, **kwargs)",
	"  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 717, in main",
	"    rv = self.invoke(ctx)",
	"  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1137, in invoke",
	"    return _process_result(sub_ctx.command.invoke(sub_ctx))",
	"  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 956, in invoke",
	"    return ctx.invoke(self.callback, **ctx.params)",
	"  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 555, in invoke",
	"    return callback(*args, **kwargs)",
	"  File \"/home/frappe/.bench/bench/commands/make.py\", line 30, in init",
	"    python \t\t = python)",
	"  File \"/home/frappe/.bench/bench/utils.py\", line 83, in init",
	"    update_node_packages(bench_path=path)",
	"  File \"/home/frappe/.bench/bench/utils.py\", line 449, in update_node_packages",
	"    update_yarn_packages(bench_path)",
	"  File \"/home/frappe/.bench/bench/utils.py\", line 462, in update_yarn_packages",
	"    exec_cmd('yarn install', cwd=app_path)",
	"  File \"/home/frappe/.bench/bench/utils.py\", line 159, in exec_cmd",
	"    raise CommandFailedError(cmd)",
	"bench.utils.CommandFailedError: yarn install"
], "stdout": "yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info If you think this is a bug, please open a bug report with the information provided in \"/home/frappe/frappe-bench/apps/frappe/yarn-error.log\".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info This module is OPTIONAL, you can safely ignore this error
('installing', u'frappe')
Updating node packages...", "stdout_lines": [
	"yarn install v1.13.0",
	"[1/4] Resolving packages...",
	"[2/4] Fetching packages...",
	"[3/4] Linking dependencies...",
	"[4/4] Building fresh packages...",
	"info If you think this is a bug, please open a bug report with the information provided in \"/home/frappe/frappe-bench/apps/frappe/yarn-error.log\".",
	"info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.",
	"info This module is OPTIONAL, you can safely ignore this error",
	"('installing', u'frappe')",
	"Updating node packages..."
]}
        to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=44   changed=29   unreachable=0    failed=1

Traceback (most recent call last):
  File "install.py", line 425, in <module>
    install_bench(args)
  File "install.py", line 122, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 338, 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

Hi welcome to ERPNext!

It seems the error lies in one the 3 last screens, please copy and paste them here.

If you enclose that traceback output in leading and trailing ``` ‘markup’ that may keep the linefeeds intact to more readily spot what went wrong

thanks

Hi John,

I updated the post based on your recommendation.

These refer to a memory problem - I suggest 2G?

frappe/node_modules/cypress: spawn ENOMEM
frappe/node_modules/uws: spawn ENOMEM

A ‘spawn ENOMEM’ search here gives this Nodejs install issues while installing ERPNext using Bench

Google ‘spawn ENOMEM’ turns up notes like ensure swap memory is enabled.

Few reports here pro or con from Lightsail users.

Hi John,
Thank you! It worked when I set the swap memory to 4GB as in this article.

I have successfully installed erpnext and switched to master. Though I am not able to reach - “This site can’t be reached. IP took too long to respond” - the static IP with 8000 port. Any leads as to what I should check?

1 Like

It worked after I allowed all ports in the firewall. Thank you again @clarkej. Your response here really helped a lot as well.