Error ansible-playbook

error installing erpnext worked last week but today raise error

Traceback (most recent call last):
File “install.py”, line 388, in
install_bench(args)
File “install.py”, line 114, in install_bench
run_playbook(‘production/install.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 326, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘production/install.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

Any hepl its a serious problem

first if you bothered to search your error in the forum first you will find multiple topics for the same problem, even simple search term like

returned non-zero exit status 2

anyway you seem trying to run the script with previous run already done, you should run this script in vanilla OS

@saurabh6790 @achillesrasquinha

@ganas I ALREADY DONE AND TRIED ALL EVEN STACKOVERFLOW WHICH LEAD ME TO SOME PERMISSION ISSUES ON ANSIBLE PLAYBOOKS;

Well, did you try sudo?

already root

That may be part of your problem?

root is for experts - that is why best to run as sudo

Here’s a similar report
ERPNext 9.1.2 installation error - ansible-playbook install error - #4 by clarkej

already tried all solutions same error

this is where the error raise in install.py file:

def run_playbook(playbook_name, sudo=False, extra_vars=None):
args = [‘ansible-playbook’, ‘-c’, ‘local’, playbook_name]

if extra_vars:
	args.extend(['-e', get_extra_vars_json(extra_vars)])

	if extra_vars.get('verbosity'):
		args.append('-vvvv')

if sudo:
	user = extra_vars.get('user') or getpass.getuser()
	args.extend(['--become', '--become-user={0}'.format(user)])

if os.path.exists(tmp_bench_repo):
	cwd = tmp_bench_repo
else:
	cwd = os.path.join(os.path.expanduser('~'), 'bench')

success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
return success

can any one tell me where the playbook files exist after run install.py

regards

You mean these?

frappe@erpnext:~/frappe-bench$ find …/bench-repo/ -name install.yml
…/bench-repo/playbooks/production/install.yml
…/bench-repo/playbooks/develop/install.yml

Hmm, could you try this locally. Like @clarkej mentioned out, maybe change the permissions of your ansible scripts?

i ssh the server as root the same installation method i do many times this time failed.

regards

@rmehta i checked an old installation i found setup_mariadb.yml and other yml files are missing !!!
someone please confirm

https://github.com/frappe/bench/tree/master/playbooks/develop/includes

This is ill advised and may the the source of your problem, for example permissions?

1 Like

@clarkej i think coz of lots of missing files yml files to setup mariadb missing you can check ur self here
https://github.com/frappe/bench/tree/master/playbooks/develop/includes

and compare it with what u already have.
regards

I don’t follow you and am done here with your problem.

cheers