Easy install fails on Ubuntu 16.04 in DigitalOcean at "python2 bench init for production"

I am trying to setup ERPNext in a DigitalOcean droplet. Previously I have tried and succeeded. But, from last two days I am getting this error when trying to create an ERPNext instance. Stack trace is given below:

TASK [bench : python2 bench init for production] *******************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “init”, “/home/frappe/frappe-bench”, “–frappe-path”, “https://github.com/frappe/frappe”, “–frappe-branch”, “master”], “delta”: “0:02:22.295205”, “end”: “2019-02-13 03:55:54.573739”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-02-13 03:53:32.278534”, “stderr”: “INFO:bench.utils:virtualenv -q env -p /usr/bin/python\nINFO:bench.utils:env/bin/pip -q install --upgrade pip\nDEPRECATION: 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.\nINFO:bench.utils:env/bin/pip -q install wheel\nDEPRECATION: 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.\nINFO:bench.utils:env/bin/pip -q install six\nDEPRECATION: 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.\nINFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit\nDEPRECATION: 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.\nINFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch master --origin upstream\nCloning into ‘frappe’…\nwarning: unable to access ‘/home/frappe/.config/git/attributes’: Permission denied\nINFO:bench.app:installing frappe\nINFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q -e /home/frappe/frappe-bench/apps/frappe \nDEPRECATION: 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.\nINFO:bench.utils:yarn install\nerror An unexpected error occurred: “EACCES: permission denied, scandir ‘/home/frappe/.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/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 764, in call\n return self.main(*args, **kwargs)\n File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main\n rv = self.invoke(ctx)\n File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, 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 956, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke\n return callback(*args, **kwargs)\n File “/home/frappe/.bench/bench/commands/make.py”, line 30, in init\n python \t\t = python)\n File “/home/frappe/.bench/bench/utils.py”, line 83, in init\n update_node_packages(bench_path=path)\n File “/home/frappe/.bench/bench/utils.py”, line 449, in update_node_packages\n update_yarn_packages(bench_path)\n File “/home/frappe/.bench/bench/utils.py”, line 462, in update_yarn_packages\n exec_cmd(‘yarn install’, cwd=app_path)\n File “/home/frappe/.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/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 --branch master --origin upstream”, “Cloning into ‘frappe’…”, “warning: unable to access ‘/home/frappe/.config/git/attributes’: Permission denied”, “INFO:bench.app:installing frappe”, “INFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q -e /home/frappe/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.”, “INFO:bench.utils:yarn install”, “error An unexpected error occurred: “EACCES: permission denied, scandir ‘/home/frappe/.config/yarn/link’”.”, “Traceback (most recent call last):”, " File “/usr/local/bin/bench”, line 11, in “, " 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”: “Already using interpreter /usr/bin/python\nwarning: unable to access ‘/home/frappe/.config/git/attributes’: Permission denied\nyarn install v1.13.0\ninfo 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”.\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n(‘installing’, u’frappe’)\nUpdating node packages…”, “stdout_lines”: [“Already using interpreter /usr/bin/python”, “warning: unable to access ‘/home/frappe/.config/git/attributes’: Permission denied”, “yarn install v1.13.0”, “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.”, “(‘installing’, u’frappe’)”, “Updating node packages…”]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost : ok=72 changed=46 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 425, 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.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

Hi welcome to ERPNext

This appears to be a permission issue -

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

Here’s a similar problem fixed Update from 10 to 11 error

Thanks a heap. I am new to ERPNext. Maybe question was a bit naive. But, your answer was to the point.

I am also stuck on V10 and seem to be running into an issue with the fact that my DigitalOcean droplet is running Python 2.7. I tried following the solution referenced above by @clarkej but still am not able to get over the hump.
Anyone have step by step instructions on how to resolve the migration issues from 10 to 11 on 16.04 droplets? I’m reverting back to my last snapshot until we can figure this out…

You can create a new droplet and then install Erpnext version 11 and install the backup on it.

Every attempt I have made to restore a v10 backup to a v11 install has resulted in a broken system. Evidently there were changes to the database structure in v11 that just do not fit with the old v10 data.

BKM

I can’t imagine you can restore a V10 database to a V11 install. There are new tables in V11 and I’m sure the import process would error out as a result.