subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe-user']' returned non-zero exit status 2

Hi Community,
I am using ubuntu 18.04 and was trying to install erpnext using the commands below

sudo wget https://raw.githubusercontent.com/frappe/bench/develop/install.py

sudo python3 install.py --develop --user frappe-user
Results:

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=frappe-user']' returned non-zero exit status 2.

How can this be resolved?

1 Like

May we know the installation directions that were being used?

Hey,
I was referring to https://github.com/frappe/bench/blob/develop/docs/easy_install.md and followed as is:
i.e

  1. Created a non root user and equipped with sudo privileges.
    2.Switched to new user.
  2. wget https://raw.githubusercontent.com/frappe/bench/develop/install.py.
  3. sudo python3 install.py.

Also tried with

  1. sudo python3 install.py --develop --user [frappe-user]

How did you switch to the new user?

You did replace the [frappe-user] with the username you created in step 1 ?

Yes , i did replace
su - frappe-user(command used to switch to user)

Any workarounds here please?

Ansible status 2 apparently means.

*2* -- One or more hosts failed

If you search the forums for posts with that error there may be something that will help. I would retrace steps and try again, perhaps using a different user name other than frappe-user.

Okay.
The issue still persist on my end.

Hello, did you manage to solve the problem?

I’m facing the same issue

below as reference, part of the long list that i’ve used for successful production deployment on ubuntu 20.04

create a user and login

sudo adduser erp_administrator

sudo usermod -aG sudo erp_administrator

su - erp_administrator

create .cache folder to claim local .cache folder permission

mkdir .cache

export LC_ALL=C.UTF-8

install aptitude for package downgrade

sudo apt install aptitude

solve ldap lib dependency

pick n, Y and Y for libldap2 1.2 if prompted

sudo aptitude install libldap2-dev

solve launchpadlib dependency

sudo apt install python3-testresources

install production erp bench

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

sudo python3 install.py --production --verbose --user erp_administrator --frappe-branch version-12 --without-erpnext --mariadb-version 10.5 --bench-name erp_bench

cd erp_bench

solve erpnext numpy and pandas dependency

env/bin/pip install numpy==1.18.5

env/bin/pip install pandas==0.24.2

get erpnext

bench get-app --branch version-12 erpnext

bench --site site1.local install-app erpnext

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.