Easy Install Failed on Ubuntu 18.04 LTS

@authum after 1st install and got error just rerun the install command

you may also try to remove the script with admin password and mysql root. use the official install command if encountered error re run again

paste your command you run also to check

try to fresh install ubuntu and dont run the apt update and upgrade

@sinichi19
I have attempted to re-run the install command and got the same error. If I remove the password flags, the command is the same as what I was attempting above, and the error is the same.

Here is the output:

erpnext2@erpnext2-OptiPlex-360:~/.bench/playbooks$ sudo -H python3 install.py --production --site localhost --user erpnext2 --mysql-root-password 12345 --admin-password 12345 --bench-name testbench
[sudo] password for erpnext2: 
Logs are saved under /tmp/logs/easy-install__2020-02-17__15-23.log
Checking System Compatibility...
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Input MySQL and Frappe Administrator passwords:
Passwords saved at ~/passwords.txt
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
 [WARNING]: Could not find aptitude. Using apt-get instead
 [WARNING]: Consider using the get_url or uri module rather than running 'curl'.  If you need to use command because get_url or uri is insufficient you can add 'warn: false' to this command
task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
Traceback (most recent call last):
  File "install.py", line 414, in <module>
    install_bench(args)
  File "install.py", line 230, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 351, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'), stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.6/subprocess.py", line 311, 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=erpnext2']' returned non-zero exit status 2.

can you share the output of tail -50 /tmp/logs/easy-install__2020-02-17__15-23.log?

Hi Gavin,
Here is the output:

erpnext2@erpnext2-OptiPlex-360:~/.bench/playbooks$ tail -50 /tmp/logs/easy-install__2020-02-17__15-23.log
TASK [psutil : Install psutil] *****************************************************************************************************************************************************************
task path: /tmp/.bench/playbooks/roles/psutil/tasks/main.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460 `" && echo ansible-tmp-1581953463.7113538-121737153383460="` echo /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/packaging/language/pip.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-18953eonwjl1/tmpf3if05qb TO /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460/AnsiballZ_pip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460/ /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460/AnsiballZ_pip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460/AnsiballZ_pip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1581953463.7113538-121737153383460/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "cmd": [
        "/usr/local/bin/pip3",
        "install",
        "-U",
        "psutil"
    ],
    "invocation": {
        "module_args": {
            "chdir": null,
            "editable": false,
            "executable": null,
            "extra_args": null,
            "name": [
                "psutil"
            ],
            "requirements": null,
            "state": "latest",
            "umask": null,
            "use_mirrors": true,
            "version": null,
            "virtualenv": null,
            "virtualenv_command": "virtualenv",
            "virtualenv_python": null,
            "virtualenv_site_packages": false
        }
    },
    "msg": "stdout: Processing /root/.cache/pip/wheels/b2/b3/a3/551db06cebc9141c437c6b58aa751d3670471494e9f6d1428d/psutil-5.6.7-cp36-cp36m-linux_x86_64.whl\nInstalling collected packages: psutil\n  Attempting uninstall: psutil\n    Found existing installation: psutil 5.4.2\n\n:stderr: ERROR: Cannot uninstall 'psutil'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.\n"
}

RUNNING HANDLER [mariadb : restart mysql] ******************************************************************************************************************************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *************************************************************************************************************************************************************************************
localhost                  : ok=43   changed=9    unreachable=0    failed=1    skipped=35   rescued=0    ignored=0   

Install script run at 15:23 on 2020-02-17

I am tempted to try some of the ideas suggested in this thread of replies:
Error on ERPNext - Ubuntu 18.04 LTS Installation - #16 by Muzzy
or just forego the script altogether and follow the instructions here:
https://discuss.frappe.io/t/how-to-install-erpnext-from-a-z/54744/4

@authum follow the easy install steps here:

Easy Install Failed on Ubuntu 18.04 LTS - #18 by sinichi19

It works for me every time.

As posted above, I have attempted this and sent along my result. I can do a fresh install of Xubuntu on the other machine I have here and try it with that to see if I have a different outcome.

@Curt.Beck @jignesh_shah @Wili
Has there been a fix for this yet?

Seems like that’s the task that failed, can you checkout the output of /usr/local/bin/pip3 install -U psutil. We could get some leads off that.

So I brought up a fresh install of Ubuntu 16.04 on my other box here, as the ERPNext install was working but the ethernet driver was not.
My commands as executed so far have been:

sudo apt update
sudo apt upgrade
sudo apt-get install python3-minimal build-essential python3-setuptools
sudo useradd -g frappeuser 
sudo passwd frappeuser
sudo usermod -aG sudo frappeuser
su frappeuser
export LC_ALL=C.UTF-8
sudo python3 install.py 
erpnext@erpnext-OptiPlex-360:/home/frappeuser$ sudo python3 install.py
Logs are saved under /tmp/logs/easy-install__2020-03-02__20-54.log
Checking System Compatibility...
ubuntu 18 is compatible!

curl already installed!
wget already installed!
git already installed!
pip3 already installed!
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Input MySQL and Frappe Administrator passwords:
Please enter mysql root password: 
Re-enter mysql root password: 
Please enter the default Administrator user password: 
Re-enter Administrator password: 
Passwords saved at ~/passwords.txt
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
 [WARNING]: Could not find aptitude. Using apt-get instead
 [WARNING]: Consider using the get_url or uri module rather than running 'curl'.  If you need to use command because get_url or uri is insufficient you can add 'warn: false' to this command
task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
Traceback (most recent call last):
  File "install.py", line 437, in <module>
    install_bench(args)
  File "install.py", line 241, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 362, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'), stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.6/subprocess.py", line 311, 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.

then for fun I just tried to execute the command that failed:

erpnext@erpnext-OptiPlex-360:/home/frappeuser$ ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=erpnext
bash: ansible-playbook, -c, local, site.yml, -vvvv, -e, @/tmp/extra_vars.json, --become, --become-user=erpnext: No such file or directory

Remove all the punctuation marks

Ah ok, what a silly error. I did so, and this is what I found:

erpnext@erpnext-OptiPlex-360:~/.cache$ ansible-playbook -c local site.yml -vvvv -e @/tmp/extra_vars.json --become --become-user=erpnext
ansible-playbook 2.8.5
  config file = None
  configured module search path = ['/home/erpnext/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.9 (default, Nov  7 2019, 10:44:02) [GCC 8.3.0]
No config file found; using defaults
ERROR! the playbook: site.yml could not be found

Now, I see that site.yml is at ./tmp/.bench/playbooks/site.yml.
Should I go to that directory and try to re-run the command and then re-execute the install.py script?

Upon closer inspection I see I was running this under the erpnext user. When I su to frappeuser, the terminal no longer has the long prefix to the shell prompt, and tab, ctrl c, and other things no longer work. Why is that? Can I just run install.py for the default user?
In both cases the install script fails with the same result.

erpnext@erpnext-OptiPlex-360:/home/frappeuser$ su frappeuser 
Password: 
$ ls      
install.py  install.py.1

I rebooted afterwords to clear out .tmp and then switched to frappeuser, to then run the install script. Here is the result:

$ sudo python3 install.py
[sudo] password for frappeuser: 
Logs are saved under /tmp/logs/easy-install__2020-03-04__14-55.log
Checking System Compatibility...
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note
that the implicit localhost does not match 'all'
Traceback (most recent call last):
  File "install.py", line 437, in <module>
    install_bench(args)
  File "install.py", line 211, in install_bench
    run_playbook('create_user.yml', extra_vars=extra_vars)
  File "install.py", line 362, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'), stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'create_user.yml', '-vvvv', '-e', '@/tmp/extra_vars.json']' returned non-zero exit status 2.

check this https://github.com/frappe/bench/blob/master/docs/easy_install.md

I think you are missing this step:

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

Yes! I had not included it but had executed the task before, apparently. The .py script is in the home folder of both the default user (erpnext) and also that of the new user for the install (frappeuser)

I have ERPNext running follwing the Hitchhiker’s Guide to installing Frappe on Linux, and have not yet added in nginx support.
It seems to be working but I don’t think I can add myself as a user yet because the computer likely can’t send emails to my test email address and won’t allow me to log-in without a user…

For anyone who has issues with this. Try sudo apt uninstall python3-psutil and sudo apt uninstall python-psutil.

Looks like ubuntu installs its own psutil. That means apt is the one who owns psutil and it can’t be uninstalled by pip or pip3 hence the error

I also had that error message. Below commands resolved my issue.

sudo mkdir -p /run/dbus
sudo dbus-daemon --system

My real issue was localectl throwing “Connection timed out” error.

Had the same problem. sudo apt remove python3-psutil worked for me.