Easy Install Failed on Ubuntu 18.04 LTS

Should I upload the install logs? It seems that this site doesn’t allow me to upload a .log filetype…

The file is in bench-repo/playbooks/site.yml

OK, I was able to navigate to ~/.bench/playbooks and found site.yml; from there I tried to execute the command again and it exited with a different error:

~/.bench/playbooks$ 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/erpnext2/.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: –become could not be found

Also, I have a second computer with a hard drive that has a working version of ERPNext on it, the thing is that this is the HD I pulled out of my test computer, and when I switched it to the other chassis I could run the server locally but the ethernet drivers apparently broke, so I have no ability to put it on the network. I can see that I did not use the script to install this, but went through and installed all the Python3 modules and MariaDB stuff manually. I’m not sure if I should work to clone the disk, switch the disk into the machine it was in and see if it magically fixes the Ethernet driver issue, or just keep plugging on this fresh install. If worse comes to worse, I could execute the same sequence of commands I used to get the original server up as I can still see the entire history in that Bash prompt and do the same sequence of steps. Seems like a rather inelegant solution, though.

I think you have to use the formats correctly.
-become (single ‘-’ )
–become-user (double ‘-’ )

I tried the method and got the same error.

This is just a cut-and-paste of the failed command; does this mean that the .py script has the same syntax error? I changed the double hyphen to a single hyphen and it failed, but in a different way. Before changing the hyphens I got this result:

erpnext2@erpnext2-OptiPlex-360:~/.bench/playbooks$ 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/erpnext2/.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: –become could not be found

Then, after the change you suggested I got this more lengthy result:

erpnext2@erpnext2-OptiPlex-360:~/.bench/playbooks$ 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/erpnext2/.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
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
 [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'

statically imported: /home/erpnext2/.bench/playbooks/roles/mariadb/tasks/centos.yml
statically imported: /home/erpnext2/.bench/playbooks/roles/mariadb/tasks/ubuntu-trusty.yml
statically imported: /home/erpnext2/.bench/playbooks/roles/mariadb/tasks/ubuntu-xenial_bionic.yml
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: site.yml *****************************************************************************************************************************************************************************
Positional arguments: site.yml
verbosity: 4
connection: local
timeout: 10
become: True
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
extra_vars: ('@/tmp/extra_vars.json', 'come', 'come-user=erpnext')
forks: 5
2 plays in site.yml

PLAY [localhost] *******************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************
task path: /home/erpnext2/.bench/playbooks/site.yml:4
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: erpnext2
<127.0.0.1> EXEC /bin/sh -c 'echo ~erpnext2 && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955 `" && echo ansible-tmp-1581609245.9631436-16810903869955="` echo /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/system/setup.py
<127.0.0.1> PUT /home/erpnext2/.ansible/tmp/ansible-local-19912_7le1gca/tmpfe876cdp TO /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955/ /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-pldcatqatcuzndwamgmujyiultokilzu ; /usr/bin/python3 /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955/AnsiballZ_setup.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/erpnext2/.ansible/tmp/ansible-tmp-1581609245.9631436-16810903869955/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "setup": {
            "failed": true,
            "module_stderr": "sudo: a password is required\n",
            "module_stdout": "",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1
        }
    },
    "msg": "The following modules failed to execute: setup\n"
}

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

@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
or just forego the script altogether and follow the instructions here:
https://discuss.erpnext.com/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

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.