ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Fatal Error Installing ERPNext V11 Develop Branch on GCP Using Easy Install Script

installation_problem

#1

Hello, I encountered this error when installing develop branch on GCP

TASK [bench : python3 bench init for develop] *********************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “init”, “/home/alvinetstore/frappe-bench”, “–fra
ppe-path”, “https://github.com/frappe/frappe”, “–frappe-branch”, “develop”, “–python”, “python3”], “delta”: “0:01
:28.753495”, “end”: “2018-07-30 10:48:14.570820”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-07-30 10:4
6:45.817325”, “stderr”: “INFO:bench.utils:virtualenv -q env -p /usr/bin/python3\nINFO:bench.utils:./env/bin/pip -q
install --upgrade pip==9.0.3\nINFO:bench.utils:./env/bin/pip -q install wheel\nINFO:bench.utils:./env/bin/pip -q in
stall six\nINFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
nINFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop -
-origin upstream\nCloning into ‘frappe’…\nwarning: unable to access ‘/home/alvinetstore/.config/git/attributes’:
Permission denied\nINFO:bench.app:installing frappe\nINFO:bench.utils:/home/alvinetstore/frappe-bench/env/bin/pip i
nstall -q -e /home/alvinetstore/frappe-bench/apps/frappe --no-cache-dir\nINFO:bench.app:getting app frappe_io\nINF
O:bench.utils:git clone https://github.com/frappe/frappe_io --branch master --origin upstream\nCloning into ‘frapp
e_io’…\nwarning: unable to access ‘/home/alvinetstore/.config/git/attributes’: Permission denied\nINFO:bench.app:
installing frappe_io\nINFO:bench.utils:/home/alvinetstore/frappe-bench/env/bin/pip install -q -e /home/alvinetstor
e/frappe-bench/apps/frappe_io --no-cache-dir\nINFO:bench.utils:yarn install\nerror An unexpected error occurred: "
EACCES: permission denied, scandir ‘/home/alvinetstore/.config/yarn/link’”.\nTraceback (most recent call last):\n
File “/usr/local/bin/bench”, line 11, in \n load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()\n
File “/home/alvinetstore/.bench/bench/cli.py”, line 40, in cli\n bench_command()\n File “/usr/local/lib/py
thon2.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/loca
l/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke\n return _process_result(sub_ctx.command.inv
oke(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/alvinetstore/.bench/bench/commands/make.py”, line 30
, in init\n python \t\t = python)\n File “/home/alvinetstore/.bench/bench/utils.py”, line 83, in init\n up
date_node_packages(bench_path=path)\n File “/home/alvinetstore/.bench/bench/utils.py”, line 449, in update_node_packages\n update_yarn_packages(bench_path)\n File “/home/alvinetstore/.bench/bench/utils.py”, line 462, in u
pdate_yarn_packages\n exec_cmd(‘yarn install’, cwd=app_path)\n File “/home/alvinetstore/.bench/bench/utils.py
“, line 159, in exec_cmd\n raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: yarn install”, “stderr
_lines”: [“INFO:bench.utils:virtualenv -q env -p /usr/bin/python3”, “INFO:bench.utils:./env/bin/pip -q install --up
grade pip==9.0.3”, “INFO:bench.utils:./env/bin/pip -q install wheel”, “INFO:bench.utils:./env/bin/pip -q install si
x”, “INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit”, “INF
O:bench.app:getting app frappe”, “INFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop --o
rigin upstream”, “Cloning into ‘frappe’…”, “warning: unable to access ‘/home/alvinetstore/.config/git/attributes’
: Permission denied”, “INFO:bench.app:installing frappe”, “INFO:bench.utils:/home/alvinetstore/frappe-bench/env/bin
/pip install -q -e /home/alvinetstore/frappe-bench/apps/frappe --no-cache-dir”, “INFO:bench.app:getting app frappe
_io”, “INFO:bench.utils:git clone https://github.com/frappe/frappe_io --branch master --origin upstream”, “Cloning
into ‘frappe_io’…”, “warning: unable to access ‘/home/alvinetstore/.config/git/attributes’: Permission denied”,
“INFO:bench.app:installing frappe_io”, “INFO:bench.utils:/home/alvinetstore/frappe-bench/env/bin/pip install -q -e
/home/alvinetstore/frappe-bench/apps/frappe_io --no-cache-dir”, “INFO:bench.utils:yarn install”, “error An unexpec
ted error occurred: “EACCES: permission denied, scandir ‘/home/alvinetstore/.config/yarn/link’”.”, “Traceback (mo
st recent call last):”, " File “/usr/local/bin/bench”, line 11, in “, " load_entry_point(‘bench’, ‘co
nsole_scripts’, ‘bench’)()”, " File “/home/alvinetstore/.bench/bench/cli.py”, line 40, in cli”, " bench_comma
nd()", " File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call", " return self.m
ain(*args, **kwargs)", " File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main", " r
v = 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/pyt
hon2.7/dist-packages/click/core.py”, line 535, in invoke", " return callback(*args, **kwargs)", " File “/home
/alvinetstore/.bench/bench/commands/make.py”, line 30, in init", " python \t\t = python)", " File “/home/alvi
netstore/.bench/bench/utils.py”, line 83, in init", " update_node_packages(bench_path=path)", " File “/home/a
lvinetstore/.bench/bench/utils.py”, line 449, in update_node_packages", " update_yarn_packages(bench_path)", "
File “/home/alvinetstore/.bench/bench/utils.py”, line 462, in update_yarn_packages", " exec_cmd(‘yarn install
‘, cwd=app_path)", " File “/home/alvinetstore/.bench/bench/utils.py”, line 159, in exec_cmd", " raise Command
FailedError(cmd)", “bench.utils.CommandFailedError: yarn install”], “stdout”: "warning: unable to access ‘/home/alv
inetstore/.config/git/attributes’: Permission denied\nyarn install v1.9.2\ninfo If you think this is a bug, please
open a bug report with the information provided in “/home/alvinetstore/frappe-bench/apps/frappe/yarn-error.log”.
ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n(‘installing’, u’frappe’
)\n(‘installing’, u’frappe_io’)\nUpdating node packages…", “stdout_lines”: [“warning: unable to access ‘/home/alvinetstore/.config/git/attributes’: Permission denied”, “yarn install v1.9.2”, "info If you think this is a bug, ple
ase open a bug report with the information provided in "/home/alvinetstore/frappe-bench/apps/frappe/yarn-error.log
“.”, “info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.”, “(‘installing’, u
‘frappe’)”, “(‘installing’, u’frappe_io’)”, “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 420, in
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.jso
n’, ‘–become’, ‘–become-user=alvinetstore’]’ returned non-zero exit status 2

what could have caused it?


#2

"
INFO:bench.utils:yarn install”, “error An unexpected error occurred: “EACCES: permission denied, scandir ‘/home/alvinetstore/.config/yarn/link
"

If alvinetstore does not have sudo privileges that would explain your permission denied error?

Edit: The references to python3 but also to this /usr/local/lib/python2.7 suggests your python environment is broken?

bench.utils:virtualenv -q env -p /usr/bin/python3\nINFO:bench.utils:./env/bin/pip -q
install --upgrade pip==9.0.3


#3

Possibly so but i found that in GCP, you’re restricted from raising permission level for the default user so i used python install.py --develop --user frappe and the installation completed successfully. However, starting bench is proving impossible at the moment. It gets stuck here:

15:02:45 socketio.1 | listening on *: 9000
15:02:55 web.1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
15:02:55 web.1 | * Restarting with inotify reloader
15:02:56 watch.1 | yarn run v1.9.2
15:02:56 watch.1 | $ node rollup/watch.js
15:02:56 web.1 | * Debugger is active!
15:02:57 web.1 | * Debugger PIN: 277-742-846
15:02:57 watch.1 |
15:02:57 watch.1 | Rollup Watcher Started
15:02:57 watch.1 |
15:02:57 watch.1 | Watching…
15:02:58 watch.1 | Rebuilding frappe-web.css
15:02:58 watch.1 | Rebuilding chat.js
15:03:00 watch.1 | Rebuilding frappe-web.min.js
15:03:03 watch.1 | Rebuilding control.min.js
15:03:06 watch.1 | Rebuilding dialog.min.js
15:03:06 watch.1 | Rebuilding desk.min.css
15:03:06 watch.1 | Rebuilding frappe-rtl.css
15:03:06 watch.1 | Rebuilding desk.min.js
15:03:11 watch.1 | Rebuilding module.min.css
15:03:11 watch.1 | Rebuilding form.min.css
15:03:11 watch.1 | Rebuilding form.min.js
15:03:12 watch.1 | Rebuilding list.min.css
15:03:12 watch.1 | Rebuilding list.min.js
15:03:13 watch.1 | Rebuilding report.min.css
15:03:13 watch.1 | Rebuilding report.min.js
15:03:16 watch.1 | Rebuilding web_form.min.js
15:03:17 watch.1 | Rebuilding web_form.css
15:03:17 watch.1 | Rebuilding print_format_v3.min.js
15:03:18 watch.1 | Rebuilding email.css
15:03:18 watch.1 | Rebuilding docs.js
15:03:21 watch.1 | Rebuilding erpnext.css
15:03:21 watch.1 | Rebuilding erpnext-web.min.js
15:03:21 watch.1 | Rebuilding erpnext.min.js
15:03:21 watch.1 | Rebuilding item-dashboard.min.js


#4

“i found that in GCP, you’re restricted from raising permission level for the default user”

So rather than ERPNext user account ‘frappe’

python install.py --develop --user frappe

better to install ERPNext to your default GCP user account, say this

python install.py --develop --user alvinetstore

BKM advises so here [Solved] Bench Update Permission Error v10


#5

Installing on the default GCP user account throws back the same error reported at the beginning of this thread. Somewhere within the error log i see permission issues with the default user even though during install i elevated the user with the sudo command.

Update: Looking at the first few lines on the error log i see that the script defaults to cloning into the frappe user directory which doesn’t exist:

fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “init”, “/home/alvinetstore/frappe-bench”, “–fra
ppe-path”, “https://github.com/frappe/frappe”, “–frappe-branch”, “develop”, “–python”, “python3”], “delta”: “0:01
:30.729477”, “end”: “2018-07-30 15:56:01.033943”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-07-30 15:5
4:30.304466”, “stderr”: "INFO:bench.utils:virtualenv -q env -p /usr/bin/python3\nINFO:bench.utils:./env/bin/pip -q
install --upgrade pip==9.0.3\nINFO:bench.utils:./env/bin/pip -q install wheel\nINFO:bench.utils:./env/bin/pip -q in
stall six\nINFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
nINFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop -
-origin upstream\nCloning into 'frappe’

So i think the script couldn’t continue as it coudn’t find the resources in the frappe directory it ought to have created earlier. I may be wrong but that’s what i have deduced so far.


#6

"
INFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch develop -
-origin upstream\nCloning into ‘frappe’…\nwarning: unable to access ‘/home/alvinetstore/.config/git/attributes’:
Permission denied
"
Your setup environment is suspect from the start. The first error occurs accessing .config (as part the got clone into frappe process step) so best to do a clean install: delete /home/alvinetstore/.config .bench .yarn, .cache .npm .ansible and so on; also delete /home/alvinetstore/frappe-bench


#7

Well the beauty of GCP is that with a few clicks you can get a fresh setup environment ready. Running a fresh setup however didn’t give me a different result. I believe therefore that something in the easy setup script does not jive with GCP as far as user creation, permissions and directory is concerned. I don’t know if manual install will provide a different result but i will look out for any manual install guide and try again.


#8

If production and/or master branch installs problem free - can you confirm this? That would mean your develop branch install problem lies with changes to support V11, not too surprising here I think.

Scripts, lib dependencies and so on are fast evolving, to run on myriad platforms and environments requires maintenance etc.

Perhaps BKM is available, or other GCP guru will chime in.

I myself rarely do a fresh install but instead clone a VM - that skips an easy or manual install(!) - and update that…


#9

I tried installing the V11 develop branch using manual install guide i found here:

But bench fails to complete the startup process as it gets stuck while trying to rebuild item-dashboard.min.js. I therefore abandoned the develop branch and installed supervisor and production installed and is running normally.

Having embarked on more explorations over the last few hours, here are my findings and possibly conclusions on this problem:

  1. The easy install script will not install develop branch on GCP due to specific permission issues which are not granted by default.
  2. Even if you are successful in completing the installation, bench will fail to start. Whether this is due to resources or failure of a script or command, i can’t tell. But either way, this has to be checked out.

#10

I had similar problem, it’s caused by my vps had 1Gb ram.


#11

The VPS has 3.75GB Ram so in this case i don’t think the RAM is the problem.


#12

For this error case above, is the owner and group the default user!?

What do you get when you run this - here’s mine for eg

frappe@ubuntu:~$ ls -al . | grep -e .npm -e .config
drwx------ 4 frappe frappe 4096 May 31 14:12 .config
drwxr-xr-x 488 frappe frappe 20480 May 31 14:13 .npm

This case is similar, and uses chown to fix ownership

This suggests [FIXED] Yarn error on bench update

the fix below:

sudo npm install -g yarn
bench update --requirements
bench setup socketio
bench build


How to test v11? VM, Docker, Easy Install & even manual install producing errors on develop branch!
How to test v11? VM, Docker, Easy Install & even manual install producing errors on develop branch!
#13

Tried that it didn’t work.