Try ERPNext Buy Support Partners Foundation

Erpnext install problem in ubuntu 18.04

My installation step

Error -----------------------------------------------------------------------------------------------

fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
“bench”,
“new-site”,
“site1.local”,
“–admin-password”,
“xyz”,
“–mariadb-root-password”,
“xyz”
],
“delta”: “0:00:02.951510”,
“end”: “2019-11-22 09:07:20.313419”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench new-site site1.local --admin-password ‘xyz’ --mariadb-root-password ‘xyz’”,
“_uses_shell”: false,
“argv”: null,
“chdir”: “/home/frappe/frappe-bench”,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2019-11-22 09:07:17.361909”,
“stderr”: “Traceback (most recent call last):\n File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main\n “main”, mod_spec)\n File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code\n exec(code, run_globals)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in \n main()\n File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main\n click.Group(commands=commands)(prog_name=‘bench’)\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call\n return self.main(*args, **kwargs)\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main\n rv = self.invoke(ctx)\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke\n return callback(*args, **kwargs)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 32, in new_site\n db_type=db_type)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 69, in _new_site\n source_sql=source_sql, force=force, reinstall=reinstall, db_type=db_type)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 34, in install_db\n setup_database(force, source_sql, verbose)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py”, line 16, in setup_database\n return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)\n File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 43, in setup_database\n raise Exception(“Database %s already exists” % (db_name,))\nException: Database _1bd3e0294da19198 already exists”,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main",
" “main”, mod_spec)",
" File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code",
" exec(code, run_globals)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in “,
" main()”,
" File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main",
" click.Group(commands=commands)(prog_name=‘bench’)",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call",
" return self.main(*args, **kwargs)",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main",
" rv = self.invoke(ctx)",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke",
" return _process_result(sub_ctx.command.invoke(sub_ctx))",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke",
" return _process_result(sub_ctx.command.invoke(sub_ctx))",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke",
" return ctx.invoke(self.callback, **ctx.params)",
" File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke",
" return callback(*args, **kwargs)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 32, in new_site",
" db_type=db_type)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 69, in _new_site",
" source_sql=source_sql, force=force, reinstall=reinstall, db_type=db_type)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 34, in install_db",
" setup_database(force, source_sql, verbose)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py”, line 16, in setup_database",
" return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)",
" File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 43, in setup_database",
" raise Exception(“Database %s already exists” % (db_name,))",
“Exception: Database _1bd3e0294da19198 already exists”
],
“stdout”: “”,
“stdout_lines”: []
}

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

Traceback (most recent call last):
File “install.py”, line 413, in
install_bench(args)
File “install.py”, line 135, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 327, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
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’]’ returned non-zero exit status 2.

You can create a new site eg: - (bench new-site new_site.com)
then, bench use new_site.com
then, bench install erpnext
then, bench install (custom_app.name)
this solution worked for me, hope this helps.