Fresh Installation error

Hi all,
I am trying to install fresh copy of ERPnext on Google cloud server. Below are the last error log:

Edit: Trying on both Ubuntu 16.04 & 18.04 … no luck!

Edit-2: My user name is erp, not frappe. I update it in my below message.

Installation steps:
Frappe / ERPNext Installation 

usr: root
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-minimal
sudo apt-get install build-essential python-setuptools


 sudo adduser erp
sudo usermod -aG sudo erp


su - erp

usr: erp

3) cd && wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
Start the installation by issuing the command below:

4) sudo python install.py --production --user erp

Error--------------------------

"INFO:bench.utils:/home/erp/frappe-bench/env/bin/pip install -q  -e /home/erp/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/erp/.config/yarn/link'\".", "Traceback (most recent call last):", "  File \"/usr/local/bin/bench\", line 11, in <module>", "    load_entry_point('bench', 'console_scripts', 'bench')()", "  File \"/home/erp/.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/erp/.bench/bench/commands/make.py\", line 30, in init", "    python \t\t = python)", "  File \"/home/erp/.bench/bench/utils.py\", line 83, in init", "    update_node_packages(bench_path=path)", "  File \"/home/erp/.bench/bench/utils.py\", line 449, in update_node_packages", "    update_yarn_packages(bench_path)", "  File \"/home/erp/.bench/bench/utils.py\", line 462, in update_yarn_packages", "    exec_cmd('yarn install', cwd=app_path)", "  File \"/home/erp/.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/erp/.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/erp/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/erp/.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/erp/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 <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 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=erp']' returned non-zero exit status 2

Any update in this regards,

1 Like

Your install path is /home/erp but your user is frappe (who would have /home/frappe as it’s home subdir unless you specifically set frappe’s homedir to /home/erp), so you probably have a permissions problem

Hi,
Today I try to install fresh ERPNext several time on my Google Cloud account. Every time my installation got failed (check my first message). Although this was permission issue, but why, I do not figure it out. Below are the steps I overcome to this issue:

  1. After getting the error, I change the user (root) and provide these command
    sudo chown -R $USER:$GROUP ~/.npm
    sudo chown -R $USER:$GROUP ~/.config
  1. With normal user, I reinstall ERPNext, this time with out error but incomplete modules and with out login form.
  1. Then, bench update --reset. This time everything installed and working.

-Thanks

1 Like

I had the same issue in Ubuntu 18.04, I run it and it worked, let me test it.!

Thanks

Follow these steps

  1. sudo python install.py --production --user erp
    2 .pip install -q -e /home/erp/frappe- bench/apps/frappe
1 Like

then bench update --reset?

Was there any error occurred after you use the command pip install -q -e /home/erp/frappe- bench/apps/frappe ?

Here is what I do and it works every time on Ubuntu 18.04 after of course using the apt-get update and apt-get upgrade.

To Install v12 on Ubuntu 18.04 (from def_user account)

sudo -H apt-get install python3-minimal
sudo -H apt-get install python3-setuptools
sudo -H apt-get install build-essential
sudo -H apt-get install redis-server
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo -H python3 install.py --production --user [def_user]
sudo nano /etc/hostname   (change hostname here to URL)
sudo nano /etc/hosts          (make sure hostname here is URL tied to ip address)
sudo nano /etc/cloud/cloud.cfg  (change line “preserve_hostname” from false to true)

after install – edit ~/.bench/bench/config/nginx.py  (change “Unicode” to “bytes”)

I installed this 2 times yesterday on 2 fresh VPS servers. I do all of this BEFORE I ever login to the Administrator and finish the setup wizard.

One of the installations was done to make an upgrade path from a v11 server. See this post to know how to also do that upgrade: (and yes, it was a success also :wink: )

Hope this helps. :grin:

BKM

5 Likes

I have same issue last few month.

fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
“bench”,
“init”,
“/home/erpnext/frappe-bench”,
“–frappe-path”,
https://github.com/frappe/frappe”,
“–frappe-branch”,
“version-13”,
“–python”,
“python3”
],
“delta”: “0:00:00.285062”,
“end”: “2022-02-06 12:57:47.283618”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench init /home/erpnext/frappe-bench --frappe-path https://github.com/frappe/frappe --frappe-branch version-13 --python python3”,
“_uses_shell”: false,
“argv”: null,
“chdir”: null,
“creates”: “/home/erpnext/frappe-bench”,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2022-02-06 12:57:46.998556”,
“stderr”: “Traceback (most recent call last):\n File “/usr/bin/bench”, line 33, in \n sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())\n File “/usr/bin/bench”, line 22, in importlib_load_entry_point\n for entry_point in distribution(dist_name).entry_points\n File “/usr/lib/python3.8/importlib/metadata.py”, line 503, in distribution\n return Distribution.from_name(distribution_name)\n File “/usr/lib/python3.8/importlib/metadata.py”, line 177, in from_name\n raise PackageNotFoundError(name)\nimportlib.metadata.PackageNotFoundError: frappe-bench”,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File “/usr/bin/bench”, line 33, in “,
" sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())”,
" File “/usr/bin/bench”, line 22, in importlib_load_entry_point",
" for entry_point in distribution(dist_name).entry_points",
" File “/usr/lib/python3.8/importlib/metadata.py”, line 503, in distribution",
" return Distribution.from_name(distribution_name)",
" File “/usr/lib/python3.8/importlib/metadata.py”, line 177, in from_name",
" raise PackageNotFoundError(name)",
“importlib.metadata.PackageNotFoundError: frappe-bench”
],
“stdout”: “”,
“stdout_lines”: []
}

PLAY RECAP *****************************************************************************************************************************************************************
localhost : ok=66 changed=15 unreachable=0 failed=1 skipped=63 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 497, in
install_bench(args)
File “install.py”, line 278, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 413, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnext’]’ returned non-zero exit status 2.

@Anzar_Ahmad

May this helps:

Unable to install ERPNext on Ubuntu 18.04