Fresh Install ERPNext on Ubuntu 16.04.4 LTS failed

I have never seen this one before. That looks like something missing in the OS. Maybe try a different linux OS like possibly Debian 8 to see if the same thing happens there.

BKM

I tried Debian once, and could not pass errors
Only passed on Ubuntu and Centos

Nothing is missing in the OS
I ran apt-get update and upgrade before
it’s just npm not installed while the script uses npm to install yarn
npm should be installed first

I

ok I will leave you to your install case.

Here’s some idea of my mine if that helps:

frappe@ubuntu:~/frappe-bench$ pwd
/home/frappe/frappe-bench
frappe@ubuntu:~/frappe-bench$ ls -al node_modules/.bin/rimraf
lrwxrwxrwx 1 frappe frappe 16 Mar 21 15:16 node_modules/.bin/rimraf → …/rimraf/bin.js

My only other tip - for a clean install after a ‘bad’ one, first delete your frappe-bench and bench-repo folders.

one question please @clarkej
from which folder npm should be installed?

the script looks at /frappe-bench while in this step frappe-bench folder is not created yet

problem solved

sudo apt-get install python-dev python-setuptools python-mysqldb python-pip
sudo apt-get update && sudo apt-get -y upgrade
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
python install.py --production --user frappe

“from which folder npm should be installed?”

Say existing install instance you have frappe user, then I suggest run npm install from /home/frappe/frappe-bench

Note from this Step 2. Run the install script here GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

So in the case of fresh install for frappe user, the command below you run from that user home directory /home/frappe:

python install.py --develop --user frappe

@hnaga
Can you please share how you got success? because i am getting same error,
please share it step by step.

i tried,

  1. sudo apt-get install python-dev python-setuptools python-mysqldb python-pip
  2. sudo apt-get update && sudo apt-get -y upgrade
  3. wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
  4. python install.py --production --user frappe

Got this error.

TASK [mariadb : Start and enable service] *******************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to start service mysql: Job for mysql.service failed because the control process exited with error code. See \"systemctl status mysql.service\" and \"journalctl -xe\" for details.\n"}

RUNNING HANDLER [mariadb : restart mysql] *******************************************************
        to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP **************************************************************************************
localhost                  : ok=25   changed=7    unreachable=0    failed=1

Traceback (most recent call last):
  File "install.py", line 417, 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
root@localhost:~#

This indicates that you are logged in as root - not recommended. Rather login as the frappe user, and use sudo - as is covered/recommended extensively in the setup instructions

@trentmu
I did with as frappe user using sudo,
and got this,

TASK [bench : install bench] ***************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/local/bin/pip2 install -e /home/frappe/.bench", "msg": "stdout: Obtaining file:///home/frappe/.bench\nRequirement already satisfied: Click in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: jinja2 in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: virtualenv in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: honcho in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: psutil in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: python-crontab in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: semantic_version in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: GitPython==0.3.2.1 in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)\nRequirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from jinja2->bench==4.1.0)\nRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)\nRequirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)\nRequirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)\nRequirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)\nRequirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from python-crontab->bench==4.1.0)\nRequirement already satisfied: gitdb>=0.6.0 in /usr/local/lib/python2.7/dist-packages (from GitPython==0.3.2.1->bench==4.1.0)\nRequirement already satisfied: six>=1.5 in /usr/local/lib/python2.7/dist-packages (from python-dateutil->python-crontab->bench==4.1.0)\nRequirement already satisfied: smmap>=0.8.5 in /usr/local/lib/python2.7/dist-packages (from gitdb>=0.6.0->GitPython==0.3.2.1->bench==4.1.0)\nInstalling collected packages: bench\n  Found existing installation: bench 4.1.0\n\n:stderr: The directory '/home/frappe/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\nThe directory '/home/frappe/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\nException:\nTraceback (most recent call last):\n  File \"/usr/local/lib/python2.7/dist-packages/pip/basecommand.py\", line 215, in main\n    status = self.run(options, args)\n  File \"/usr/local/lib/python2.7/dist-packages/pip/commands/install.py\", line 342, in run\n    prefix=options.prefix_path,\n  File \"/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py\", line 778, in install\n    requirement.uninstall(auto_confirm=True)\n  File \"/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py\", line 703, in uninstall\n    '(at %s)' % (link_pointer, self.name, dist.location)\nAssertionError: Egg-link /home/frappe/bench-repo does not match installed location of bench (at /home/frappe/.bench)\nYou are using pip version 9.0.3, however version 10.0.1 is available.\nYou should consider upgrading via the 'pip install --upgrade pip' command.\n"}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=68   changed=13   unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 417, 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
frappe@localhost:~$