Sudo bench setup production ERROR: bench setup role nginx

[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’
ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks.

The error appears to be in ‘/usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml’: line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  • include: centos.yml
    ^ here
    ERROR: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘{“production”: true, “admin_emails”: “”, “mysql_root_password”: null, “container”: false}’, ‘-t’, ‘nginx’]’ returned non-zero exit status 1.
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 8, in
    sys.exit(cli())
    File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 132, in cli
    bench_command()
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1157, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1078, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 783, in invoke
    return __callback(*args, **kwargs)
    File “/usr/local/lib/python3.10/dist-packages/bench/commands/setup.py”, line 370, in setup_roles
    run_playbook(“site.yml”, extra_vars=extra_vars, tag=role)
    File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 345, in run_playbook
    subprocess.check_call(args, cwd=os.path.join(bench.path[0], “playbooks”))
    File “/usr/lib/python3.10/subprocess.py”, line 369, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘{“production”: true, “admin_emails”: “”, “mysql_root_password”: null, “container”: false}’, ‘-t’, ‘nginx’]’ returned non-zero exit status 1.
    ERROR: bench setup role nginx
    subprocess.CalledProcessError: Command ‘bench setup role nginx’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 132, in cli
bench_command()
File “/usr/local/lib/python3.10/dist-packages/bench/commands/setup.py”, line 110, in setup_production
setup_production(user=user, yes=yes)
File “/usr/local/lib/python3.10/dist-packages/bench/config/production_setup.py”, line 37, in setup_production
setup_production_prerequisites()
File “/usr/local/lib/python3.10/dist-packages/bench/config/production_setup.py”, line 30, in setup_production_prerequisites
exec_cmd(“bench setup role nginx”)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 178, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench setup role nginx

1 Like

Which ERPNext version? if v15…you need python 3.11+

Its Done already dear. Thanks
.yml file
edited inclued - include_tasks

1 Like