Hitchhikers Guide to Install Frappe now fails with a yarn error

OK, So I was trying to use the recommended guide to get a manual install going on my newest server and (following the instructions exactly) I get to the point of installing bench using ‘git’ and it fails to start in the next command. This is on a fresh Ubuntu 18.04 server and I did not skip any steps.

Is there a missing instruction in the guide, or did something else change?

Here is the link to the guide I used:

https://github.com/frappe/frappe/wiki/The-Hitchhiker%27s-Guide-to-Installing-Frappe-on-Linux

Here is the full trace of installing bench and then trying to get it to work exactly as the instructions said:

erp_jmi@la:~$ pip install -e ./bench
Obtaining file:///home/erp_jmi/bench
Collecting Click (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
    100% |████████████████████████████████| 81kB 6.6MB/s
Collecting GitPython==2.1.11 (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/fe/e5/fafe827507644c32d6dc553a1c435cdf882e0c28918a5bab29f7fbebfb70/GitPython-2.1.11-py2.py3-none-any.whl (448kB)
    100% |████████████████████████████████| 450kB 3.0MB/s
Collecting honcho (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/12/c2/95faf9e062e37f50fb685972692395bef019a554c08447282a81e35bf031/honcho-1.0.1-py2.py3-none-any.whl
Collecting jinja2 (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
    100% |████████████████████████████████| 133kB 8.4MB/s
Collecting python-crontab (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/2c/4f/60b3481b00af6cb91eb19bfb14ac518aebd268fa2a0cd3e21ba1687c4816/python-crontab-2.3.6.tar.gz (44kB)
    100% |████████████████████████████████| 51kB 12.2MB/s
Collecting requests (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 10.8MB/s
Collecting semantic_version (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/72/83/f76958017f3094b072d8e3a72d25c3ed65f754cc607fdb6a7b33d84ab1d5/semantic_version-2.6.0.tar.gz
Collecting virtualenv (from bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/ca/ee/8375c01412abe6ff462ec80970e6bb1c4308724d4366d7519627c98691ab/virtualenv-16.6.0-py2.py3-none-any.whl (2.0MB)
    100% |████████████████████████████████| 2.0MB 752kB/s
Collecting gitdb2>=2.0.0 (from GitPython==2.1.11->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/da/30/a407568aa8d8f25db817cf50121a958722f3fc5f87e3a6fba1f40c0633e3/gitdb2-2.0.5-py2.py3-none-any.whl (62kB)
    100% |████████████████████████████████| 71kB 12.2MB/s
Collecting MarkupSafe>=0.23 (from jinja2->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting python-dateutil (from python-crontab->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
    100% |████████████████████████████████| 235kB 6.1MB/s
Collecting idna<2.9,>=2.5 (from requests->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 11.0MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 9.0MB/s
Collecting certifi>=2017.4.17 (from requests->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl (158kB)
    100% |████████████████████████████████| 163kB 7.9MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl (150kB)
    100% |████████████████████████████████| 153kB 8.5MB/s
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython==2.1.11->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/55/d2/866d45e3a121ee15a1dc013824d58072fd5c7799c9c34d01378eb262ca8f/smmap2-2.0.5-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->python-crontab->bench==4.1.0)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Building wheels for collected packages: python-crontab, semantic-version
  Running setup.py bdist_wheel for python-crontab ... done
  Stored in directory: /home/erp_jmi/.cache/pip/wheels/45/c2/12/4f9e435a355df948f562120991107677bf2dce1bb86b18e751
  Running setup.py bdist_wheel for semantic-version ... done
  Stored in directory: /home/erp_jmi/.cache/pip/wheels/60/bb/50/215d669d31f992767f5dd8d3c974e79261707ee7f898f0dc10
Successfully built python-crontab semantic-version
Installing collected packages: Click, smmap2, gitdb2, GitPython, honcho, MarkupSafe, jinja2, six, python-dateutil, python-crontab, idna, chardet, certifi, urllib3, requests, semantic-version, virtualenv, bench
  Running setup.py develop for bench
Successfully installed Click-7.0 GitPython-2.1.11 MarkupSafe-1.1.1 bench certifi-2019.3.9 chardet-3.0.4 gitdb2-2.0.5 honcho-1.0.1 idna-2.8 jinja2-2.10.1 python-crontab-2.3.6 python-dateutil-2.8.0 requests-2.22.0 semantic-version-2.6.0 six-1.12.0 smmap2-2.0.5 urllib3-1.25.3 virtualenv-16.6.0
erp_jmi@la:~$ bench --version

Command 'bench' not found, but can be installed with:

sudo apt install ruby-active-model-serializers

erp_jmi@la:~$ sudo reboot

.
.
After the reboot to get the environment reset, I logged in again, checked the bench version, and ran the recommended command to create a new bench. The result was a yarn error. Here is the full trace of that part of the process:

erp_jmi@la:~$ bench --version
4.1.0
erp_jmi@la:~$ bench init --frappe-branch master frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install wheel
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install six
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git --branch master  --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 179274 (delta 11), reused 12 (delta 5), pack-reused 179246
Receiving objects: 100% (179274/179274), 201.35 MiB | 9.61 MiB/s, done.
Resolving deltas: 100% (137192/137192), done.
warning: unable to access '/home/erp_jmi/.config/git/attributes': Permission denied
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Updating node packages...
INFO:bench.utils:yarn install
yarn install v1.16.0
error An unexpected error occurred: "EACCES: permission denied, scandir '/home/erp_jmi/.config/yarn/link'".
info If you think this is a bug, please open a bug report with the information provided in "/home/erp_jmi/frappe-bench/apps/frappe/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Traceback (most recent call last):
  File "/home/erp_jmi/.local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/erp_jmi/bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/home/erp_jmi/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/erp_jmi/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/erp_jmi/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erp_jmi/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erp_jmi/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/erp_jmi/bench/bench/commands/make.py", line 30, in init
    python               = python)
  File "/home/erp_jmi/bench/bench/utils.py", line 83, in init
    update_node_packages(bench_path=path)
  File "/home/erp_jmi/bench/bench/utils.py", line 452, in update_node_packages
    update_yarn_packages(bench_path)
  File "/home/erp_jmi/bench/bench/utils.py", line 465, in update_yarn_packages
    exec_cmd('yarn install', cwd=app_path)
  File "/home/erp_jmi/bench/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install
erp_jmi@la:~$

I would very much appreciate any pointers in where I need to tweak this process. Clearly something is not working properly.

Thank you,

BKM

@bkm

honestly I tried this instructions and failed on the same command. And then I followed the frappe github instructions to install bench from where I left over. pip install --user -e bench-repo
so its a mix of both instructions…

Then I could install both Develop and Master version separately…

I don’t really know why that was happening as on both cases bench is cloning from the same location…

@M27

Thanks for the update, but you replied at the same time that I was updating the post. The initial failure of the bench command was due to the host needing to be rebooted (or log off and back on again) to reset the environment. Once that was done I expected everything else to work properly, but got a yarn error instead (as posted in the second trace above).

So the title of the thread was changed to reflect the yarn issue.

BKM

1 Like

@bkm

had that error too when Installing… for yarn pkg… not having enough read/write permissions… I could fix with giving enough permission level 751 for yarn and yarnpkg… removed all other old modules…

Ok, but I am not sure how to do that.

How do I give yarn the 7,5,1 permissions? Where is it located?
Do I need to find the directory and chmod the whole thing, or just one file?

An what other modules did you remove?

BKM

@bkm

The official repository in OS was giving errors. so I did a manual install by downloading the packages… so had to remove all node_modules and dependencies… then gave chmod 751 to the downloaded packages… and also gave chown to the .config and .npm folders to the default user… usually the .config folder fails on permissions…

See this page: this is what I was referring to

Thank you! I will try that when I get back to my desk.

BKM

1 Like