Easy install setup guide for erpnext installation on Ubuntu 20.04 LTS. With some modification of course

@mwrsa Glad that this helped you to install ERPNEXT on 20.4

Please give some time to ERPNEXT before you evaluate it. There are many combinations of settings to perform almost any job in ERP system so be patient and always ask on forum if you have any doubts.

Welcome !!

Thank you!

Yes, you are absolutely right. What I learned so far (two things):

ERPNext and the underlying frappe framework are very particular concerning versions of their dependencies. That’s probably what stopped me short in some of my previous attempts.

I know no other system that offers such a plentitude of options and functionality. To be honest: I will probably have more work with removing stuff that’s not used in our company than with adding what we are missing.

Anyway, this is not about that, but about the great work of yours, @Nikunj_Patel, that can be found in the first post of this thread. I ran into some of the issues mentioned there plus the one with psutils which I mentioned in my previous post - and that’s it.

One small thing though - under issue 5 and 6, regarding numpy and pandas: For me, the order of the commands had to be reversed: First downgrade numpy to 1.18.5, then install pandas in the mentioned version.

@mwrsa Yes that is why we called ERPNEXT solution BATTERIES INCLUDED. It is one of the only ERP system which has all the modules available in FOSS model. If you like it, please don’t forget to contribute back to the community. Don’t forget to push any issues you face on Github, community is very active to respond.

And if you code some new feature please be free to show it… there will lots of people interested.

Since you were using MATE numpy version was higher then required 1.18.5 because of this you had conflict with panda. In this case you had to what you did.

@mwrsa while setting it up install only those modules which you will use.

  1. You can always enable this module later on if you need them. I would suggest you to go slow.
  2. First plan your strategy to upgrade to ERPNEXT.
  3. Get hands on the module which you are going to use.
  4. Set up your company charts of accounts.
  5. Set up your taxes.
  6. Set up your stock items.
  7. Set up you bank details.
  8. Plan the your User roles.
  9. Setup a demo site to run atleast few full entries with your accounts / purchase / manufacturing team to understand the workflow and fine tune it if needed.

Rest will follow with time.

@Nikunj_Patel Tried all the methods still facing problem.
Please guide me with framework installation on 20.04 focal.
Thank you.

@tharun, instead of Easy Install script install.py approach, try manual steps to install erpnext.

See list of links providing the steps to install erpnext on Ubuntu Server 20.04 LTS

Refer the link

I am doing the installation for the first time and i am getting the below error.

ERROR! Unexpected Exception, this is probably a bug: cannot import name ‘AnsibleCollectionLoader’ from ‘ansible.utils.collection_loader’ (/usr/local/lib/python3.8/dist-packages/ansible/utils/collection_loader/init.py)
the full traceback was:

Traceback (most recent call last):
File “/usr/local/bin/ansible-playbook”, line 90, in
mycli = getattr(import(“ansible.cli.%s” % sub, fromlist=[myclass]), myclass)
File “/usr/local/lib/python3.8/dist-packages/ansible/cli/init.py”, line 22, in
from ansible.inventory.manager import InventoryManager
File “/usr/local/lib/python3.8/dist-packages/ansible/inventory/manager.py”, line 38, in
from ansible.plugins.loader import inventory_loader
File “/usr/local/lib/python3.8/dist-packages/ansible/plugins/loader.py”, line 26, in
from ansible.utils.collection_loader import AnsibleCollectionLoader, AnsibleFlatMapLoader, is_collection_ref
ImportError: cannot import name ‘AnsibleCollectionLoader’ from ‘ansible.utils.collection_loader’ (/usr/local/lib/python3.8/dist-packages/ansible/utils/collection_loader/init.py)
Traceback (most recent call last):
File “install.py”, line 633, in
install_bench(args)
File “install.py”, line 264, in install_bench
run_playbook(“create_user.yml”, extra_vars=extra_vars)
File “install.py”, line 440, in run_playbook
success = subprocess.check_call(
File “/usr/lib/python3.8/subprocess.py”, line 364, 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 250.

Regards,

@Bungei Please run the installation command with --Verbose

This will give you more detailed logs. The logs you shared are not enough to troubleshoot.

Hi @Nikunj_Patel,
I executed below and output.

udo python3 install.py --production --verbose --user erpnext --mariadb-version 10.5 --verbose
Checking System Compatibility…
ubuntu 20 is compatible!

Fetched 333 kB in 4s (81.2 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
libffi-dev is already the newest version (3.3-4).
python3-dev is already the newest version (3.8.2-0ubuntu2).
python3-setuptools is already the newest version (45.2.0-1).
build-essential is already the newest version (12.8ubuntu1.1).
git is already the newest version (1:2.25.1-1ubuntu3.1).
The following packages were automatically installed and are no longer required:
galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl
libdbi-perl libdouble-conversion3 libfcgi-perl libhtml-template-perl
libpcre2-16-0 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5
libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5
libqt5sensors5 libqt5svg5 libqt5webchannel5 libqt5webkit5 libqt5widgets5
libreadline5 libsnappy1v5 libterm-readkey-perl libxcb-xinerama0
libxcb-xinput0 python3-cliapp python3-markdown python3-packaging
python3-pygments python3-pyparsing python3-ttystatus qt5-gtk-platformtheme
qttranslations5-l10n socat
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (56.0.0)
Requirement already satisfied: cryptography in /usr/local/lib/python3.8/dist-packages (3.4.7)
Requirement already satisfied: ansible==2.8.5 in /usr/local/lib/python3.8/dist-packages (2.8.5)
Requirement already satisfied: pip in /usr/local/lib/python3.8/dist-packages (21.0.1)
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from ansible==2.8.5) (5.3.1)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from ansible==2.8.5) (2.11.2)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.8/dist-packages (from cryptography) (1.14.5)
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi>=1.12->cryptography) (2.20)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->ansible==2.8.5) (1.1.1)
ERROR! Unexpected Exception, this is probably a bug: cannot import name ‘AnsibleCollectionLoader’ from ‘ansible.utils.collection_loader’ (/usr/local/lib/python3.8/dist-packages/ansible/utils/collection_loader/init.py)
the full traceback was:

Traceback (most recent call last):
File “/usr/local/bin/ansible-playbook”, line 90, in
mycli = getattr(import(“ansible.cli.%s” % sub, fromlist=[myclass]), myclass)
File “/usr/local/lib/python3.8/dist-packages/ansible/cli/init.py”, line 22, in
from ansible.inventory.manager import InventoryManager
File “/usr/local/lib/python3.8/dist-packages/ansible/inventory/manager.py”, line 38, in
from ansible.plugins.loader import inventory_loader
File “/usr/local/lib/python3.8/dist-packages/ansible/plugins/loader.py”, line 26, in
from ansible.utils.collection_loader import AnsibleCollectionLoader, AnsibleFlatMapLoader, is_collection_ref
ImportError: cannot import name ‘AnsibleCollectionLoader’ from ‘ansible.utils.collection_loader’ (/usr/local/lib/python3.8/dist-packages/ansible/utils/collection_loader/init.py)
Traceback (most recent call last):
File “install.py”, line 633, in
install_bench(args)
File “install.py”, line 264, in install_bench
run_playbook(“create_user.yml”, extra_vars=extra_vars)
File “install.py”, line 440, in run_playbook
success = subprocess.check_call(
File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
raise CalledProcessError(retcode, cmd)

This issue is caused by the ansible bug.

Please upgrade you Ansible if you can.

adam

ansible-base: updated to 2.10.7

https://github.com/ansible-collections/community.kubernetes/issues/135

@Bungei

you can do the following and try installing again.

  1. pip3 uninstall ansible
  2. rm -rf /usr/local/lib/python3.7/site-packages/ansible (things that weren’t automatically removed)
  3. pip3 install ansible

@Nikunj_Patel, Thank you. I have that hurdle. I am now getting below error.

TASK [Set home folder perms] ******************************************************************************************************************************************************************************
task path: /tmp/.bench/playbooks/create_user.yml:12
<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-1618326777.393776-97698778851095” && echo ansible-tmp-1618326777.393776-97698778851095=“echo /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095” ) && sleep 0’
Using module file /usr/lib/python3/dist-packages/ansible/modules/files/file.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-46969dqgvy7s1/tmp48lmex81 TO /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095/AnsiballZ_file.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095/ /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095/AnsiballZ_file.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095/AnsiballZ_file.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1618326777.393776-97698778851095/ > /dev/null 2>&1 && sleep 0’
The full traceback is:
File “/tmp/ansible_file_payload_51dtapqv/ansible_file_payload.zip/ansible/module_utils/basic.py”, line 1010, in set_owner_if_different
os.lchown(b_path, uid, -1)
fatal: [localhost]: FAILED! => {
“changed”: false,
“gid”: 0,
“group”: “root”,
“invocation”: {
“module_args”: {
“_diff_peek”: null,
“_original_basename”: null,
“access_time”: null,
“access_time_format”: “%Y%m%d%H%M.%S”,
“attributes”: null,
“backup”: null,
“content”: null,
“delimiter”: null,
“directory_mode”: null,
“follow”: true,
“force”: false,
“group”: “erpnext”,
“mode”: “o+rx”,
“modification_time”: null,
“modification_time_format”: “%Y%m%d%H%M.%S”,
“owner”: “erpnext”,
“path”: “/home/erpnext”,
“recurse”: true,
“regexp”: null,
“remote_src”: null,
“selevel”: null,
“serole”: null,
“setype”: null,
“seuser”: null,
“src”: null,
“state”: “directory”,
“unsafe_writes”: null
}
},
“mode”: “0755”,
“msg”: “chown failed: [Errno 30] Read-only file system: b’/snap/snap-store/518/data-dir/themes’”,
“owner”: “root”,
“path”: “/snap/snap-store/518/data-dir/themes”,
“size”: 3,
“state”: “directory”,
“uid”: 0
}

how can i grant the permisions

Did you assign the New user you have created to have SUDO rights ?

This happens because the current user through which you are trying to install the ERPNext does not have sudo rights.

Did you do as follows :slight_smile:

  1. Creations of user with sudo rights.
     sudo adduser *Your_USERNAME* 
     sudo usermod -aG sudo *Your_USERNAME*

Hello, i’m trying to install Erpnext in Ubuntu 20.04 on WSL2.
I’ve this error:

TASK [locale : Check current locale] ***********************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/locale/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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614 && echo ansible-tmp-1618566741.3289557-1059-44033456298614="` echo /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-846wzvz0vy8/tmp4g14lzc7 TO /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614/ /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618566741.3289557-1059-44033456298614/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "localectl",
    "delta": "0:00:00.022772",
    "end": "2021-04-16 11:52:21.677940",
    "invocation": {
        "module_args": {
            "_raw_params": "localectl",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "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": "2021-04-16 11:52:21.655168",
    "stderr": "\u001b[0;1;31mSystem has not been booted with systemd as init system (PID 1). Can't operate.\u001b[0m\n\u001b[0;1;31mFailed to create bus connection: Host is down\u001b[0m",
    "stderr_lines": [
        "\u001b[0;1;31mSystem has not been booted with systemd as init system (PID 1). Can't operate.\u001b[0m",
        "\u001b[0;1;31mFailed to create bus connection: Host is down\u001b[0m"
    ],
    "stdout": "",
    "stdout_lines": []
}

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

Traceback (most recent call last):
  File "install.py", line 498, in <module>
    install_bench(args)
  File "install.py", line 279, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 414, in run_playbook
    success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.8/subprocess.py", line 364, 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=erpuser']' returned non-zero exit status 2.

and i didn’t find solution. Can you help me?
Seems in wsl2 are there problems with localhost?

also I found the redhat_family file to edit in to /tmp/.bench/bench/… so I don’t know if there are problems also for that

@Ido_Traini Please run the installation command with --Verbose

This will give you more detailed logs. The logs you shared are not enough to troubleshoot.

Creations of user with sudo rights.

     sudo adduser *Your_USERNAME* 
     sudo usermod -aG sudo *Your_USERNAME*

sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Naming the user as ERPNEXT is not an issue, just it is not safe, since lots of attackers would try to attack this username.

@Nikunj_Patel
I’ve lanched the installation as verbose and maked again installation with different username
Here the complete log (i had to remove initial part due limitation of the reply character space)

 TASK [Create user] *****************************************************************************************************
task path: /tmp/.bench/bench/playbooks/create_user.yml:7
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521 && echo ansible-tmp-1618568860.670085-730-57053080077521="` echo /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/system/user.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-6228vgx985g/tmpq_2kv7ir TO /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521/AnsiballZ_user.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521/ /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521/AnsiballZ_user.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568860.670085-730-57053080077521/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "append": false,
    "changed": false,
    "comment": ",,,",
    "group": 1002,
    "home": "/home/erpuser",
    "invocation": {
        "module_args": {
            "append": false,
            "authorization": null,
            "comment": null,
            "create_home": true,
            "expires": null,
            "force": false,
            "generate_ssh_key": true,
            "group": null,
            "groups": null,
            "hidden": null,
            "home": null,
            "local": null,
            "login_class": null,
            "move_home": false,
            "name": "erpuser",
            "non_unique": false,
            "password": null,
            "password_lock": null,
            "profile": null,
            "remove": false,
            "role": null,
            "seuser": null,
            "shell": null,
            "skeleton": null,
            "ssh_key_bits": 0,
            "ssh_key_comment": "ansible-generated on DESKTOP-HTVK6TE",
            "ssh_key_file": null,
            "ssh_key_passphrase": null,
            "ssh_key_type": "rsa",
            "state": "present",
            "system": false,
            "uid": null,
            "update_password": "always"
        }
    },
    "move_home": false,
    "name": "erpuser",
    "shell": "/usr/bin/bash",
    "ssh_fingerprint": "3072 SHA256:JS1idyhAe0SAutVkp4EJtv63pC4gyIwK3Ld0e8aw/i4 ansible-generated on DESKTOP-HTVK6TE (RSA)",
    "ssh_key_file": "/home/erpuser/.ssh/id_rsa",
    "ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCufMBQJAVluT00i2mNdsY62Gy7nUKv+vftrD+z9XhbEFxyjnJ0GpxyzFs2Rk+ctY5OVYS6SOPgZDWmWTsKhGUK+9E1Xl7d5zddrwEUdsfJVLf3yFW4chGqVF5pK0LSeqPWd4ErSzfThAHiG4MD+Y6zlf0eIGoSlAQtR5lXqKi6fnuWjcD3lj2L8id0Gn9e81A+sbpZval5Mr6pUUP8rYmavouz2132HapiELpJ8uogGk8iU2M9jDfD71xNCqJ7di4ZIKpz39FjYaGij3TkdY7/2tqvY7B6xAKaZVs/h2kjgR6Vq2JdV+fdd89pKpZPXxaudfHNRFH49wpQmdTFDzFsV7q9EW48kt1/DVMhD6q1FscrZ4rI3z9+yaDz+hzespBbvr+yNncH5Cx2xbffi4kd/Hv6BzHtkGQuX7RMhHHD7+UjxoyeFw/rlgCBZqkgTjSaXz8hdYxJ2K8hGlQTqzZ8Y7MbCIClRuzt90o8QwY0kydgIJGdS5wqr/358oIQv8E= ansible-generated on DESKTOP-HTVK6TE",
    "state": "present",
    "uid": 1002
}

TASK [Set home folder perms] *******************************************************************************************
task path: /tmp/.bench/bench/playbooks/create_user.yml:12
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604 && echo ansible-tmp-1618568861.1370845-758-178887914403604="` echo /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/files/file.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-6228vgx985g/tmpav013puf TO /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604/AnsiballZ_file.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604/ /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604/AnsiballZ_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604/AnsiballZ_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568861.1370845-758-178887914403604/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
    "changed": true,
    "diff": {
        "after": {
            "path": "/home/erpuser"
        },
        "before": {
            "path": "/home/erpuser"
        }
    },
    "gid": 1002,
    "group": "erpuser",
    "invocation": {
        "module_args": {
            "_diff_peek": null,
            "_original_basename": null,
            "access_time": null,
            "access_time_format": "%Y%m%d%H%M.%S",
            "attributes": null,
            "backup": null,
            "content": null,
            "delimiter": null,
            "directory_mode": null,
            "follow": true,
            "force": false,
            "group": "erpuser",
            "mode": "o+rx",
            "modification_time": null,
            "modification_time_format": "%Y%m%d%H%M.%S",
            "owner": "erpuser",
            "path": "/home/erpuser",
            "recurse": true,
            "regexp": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": null,
            "state": "directory",
            "unsafe_writes": null
        }
    },
    "mode": "0755",
    "owner": "erpuser",
    "path": "/home/erpuser",
    "size": 4096,
    "state": "directory",
    "uid": 1002
}

TASK [Set /tmp/.bench folder perms] ************************************************************************************
task path: /tmp/.bench/bench/playbooks/create_user.yml:20
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510 && echo ansible-tmp-1618568861.5241907-784-30969913869510="` echo /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/files/file.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-6228vgx985g/tmpvjxhgd9z TO /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510/AnsiballZ_file.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510/ /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510/AnsiballZ_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510/AnsiballZ_file.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568861.5241907-784-30969913869510/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "changed": false,
    "diff": {
        "after": {
            "path": "/tmp/.bench"
        },
        "before": {
            "path": "/tmp/.bench"
        }
    },
    "gid": 1002,
    "group": "erpuser",
    "invocation": {
        "module_args": {
            "_diff_peek": null,
            "_original_basename": null,
            "access_time": null,
            "access_time_format": "%Y%m%d%H%M.%S",
            "attributes": null,
            "backup": null,
            "content": null,
            "delimiter": null,
            "directory_mode": null,
            "follow": true,
            "force": false,
            "group": "erpuser",
            "mode": null,
            "modification_time": null,
            "modification_time_format": "%Y%m%d%H%M.%S",
            "owner": "erpuser",
            "path": "/tmp/.bench",
            "recurse": true,
            "regexp": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": null,
            "state": "directory",
            "unsafe_writes": null
        }
    },
    "mode": "0755",
    "owner": "erpuser",
    "path": "/tmp/.bench",
    "size": 4096,
    "state": "directory",
    "uid": 1002
}

TASK [Change default shell to bash] ************************************************************************************
task path: /tmp/.bench/bench/playbooks/create_user.yml:27
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152 && echo ansible-tmp-1618568861.822526-810-178651747013152="` echo /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-6228vgx985g/tmpb68qtksa TO /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152/ /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568861.822526-810-178651747013152/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
    "changed": true,
    "cmd": "chsh erpuser -s $(which bash)",
    "delta": "0:00:00.032339",
    "end": "2021-04-16 12:27:42.147259",
    "invocation": {
        "module_args": {
            "_raw_params": "chsh erpuser -s $(which bash)",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "rc": 0,
    "start": "2021-04-16 12:27:42.114920",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "",
    "stdout_lines": []
}
META: ran handlers
META: ran handlers

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

Input MySQL and Frappe Administrator passwords:
Passwords saved at ~/passwords.txt
Initializing bench frappe-bench:
        Frappe Branch: version-12
        ERPNext Branch: version-12
ansible-playbook 2.8.20
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.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: /tmp/.bench/bench/playbooks/roles/mariadb/tasks/centos.yml
statically imported: /tmp/.bench/bench/playbooks/roles/mariadb/tasks/ubuntu-trusty.yml
statically imported: /tmp/.bench/bench/playbooks/roles/mariadb/tasks/ubuntu-xenial_bionic.yml
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.8/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
become_user: erpuser
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
extra_vars: ('@/tmp/extra_vars.json',)
forks: 5
2 plays in site.yml

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

TASK [Gathering Facts] *************************************************************************************************
task path: /tmp/.bench/bench/playbooks/site.yml:4
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595 && echo ansible-tmp-1618568863.1860757-849-32637732877595="` echo /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/system/setup.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8456m1tsiul/tmpt069xvpt TO /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595/ /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568863.1860757-849-32637732877595/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [common : include_tasks] ******************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/main.yml:4
included: /tmp/.bench/bench/playbooks/roles/common/tasks/debian_family.yml for localhost

TASK [common : Install prerequisites using apt-get] ********************************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/debian_family.yml:3
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879 && echo ansible-tmp-1618568864.8589525-955-94683159051879="` echo /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8456m1tsiul/tmpk046gwfy TO /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879/ /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568864.8589525-955-94683159051879/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "cache_update_time": 1618568850,
    "cache_updated": false,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": true,
            "force_apt_get": false,
            "install_recommends": null,
            "only_upgrade": false,
            "package": [
                "dnsmasq",
                "fontconfig",
                "git",
                "htop",
                "libcrypto++-dev",
                "libfreetype6-dev",
                "liblcms2-dev",
                "libwebp-dev",
                "libxext6",
                "libxrender1",
                "libxslt1-dev",
                "libxslt1.1",
                "libffi-dev",
                "ntp",
                "postfix",
                "python3-dev",
                "python-tk",
                "screen",
                "vim",
                "xfonts-75dpi",
                "xfonts-base",
                "zlib1g-dev",
                "apt-transport-https",
                "libsasl2-dev",
                "libldap2-dev",
                "libcups2-dev",
                "pv"
            ],
            "pkg": [
                "dnsmasq",
                "fontconfig",
                "git",
                "htop",
                "libcrypto++-dev",
                "libfreetype6-dev",
                "liblcms2-dev",
                "libwebp-dev",
                "libxext6",
                "libxrender1",
                "libxslt1-dev",
                "libxslt1.1",
                "libffi-dev",
                "ntp",
                "postfix",
                "python3-dev",
                "python-tk",
                "screen",
                "vim",
                "xfonts-75dpi",
                "xfonts-base",
                "zlib1g-dev",
                "apt-transport-https",
                "libsasl2-dev",
                "libldap2-dev",
                "libcups2-dev",
                "pv"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "upgrade": null
        }
    }
}

TASK [common : include_tasks] ******************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/debian_family.yml:38
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [common : include_tasks] ******************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/debian_family.yml:41
included: /tmp/.bench/bench/playbooks/roles/common/tasks/ubuntu.yml for localhost

TASK [common : install pillow prerequisites for Ubuntu < 14.04] ********************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/ubuntu.yml:3
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [common : install pillow prerequisites for Ubuntu >= 14.04] *******************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/ubuntu.yml:14
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762 && echo ansible-tmp-1618568866.1582403-992-220782343264762="` echo /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8456m1tsiul/tmp97udzwc_ TO /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762/ /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568866.1582403-992-220782343264762/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "cache_update_time": 1618568850,
    "cache_updated": false,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": true,
            "force_apt_get": false,
            "install_recommends": null,
            "only_upgrade": false,
            "package": [
                "libjpeg8-dev",
                "libtiff5-dev",
                "tcl8.6-dev",
                "tk8.6-dev"
            ],
            "pkg": [
                "libjpeg8-dev",
                "libtiff5-dev",
                "tcl8.6-dev",
                "tk8.6-dev"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "upgrade": null
        }
    }
}

TASK [common : install pdf prerequisites for Ubuntu < 18.04] ***********************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/ubuntu.yml:25
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [common : install pdf prerequisites for Ubuntu >= 18.04] **********************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/ubuntu.yml:33
<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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742 && echo ansible-tmp-1618568867.149341-1025-105335266971742="` echo /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8456m1tsiul/tmp4zwm8d7k TO /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742/ /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742/AnsiballZ_apt.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568867.149341-1025-105335266971742/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "cache_update_time": 1618568850,
    "cache_updated": false,
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": true,
            "force_apt_get": false,
            "install_recommends": null,
            "only_upgrade": false,
            "package": [
                "libssl1.1"
            ],
            "pkg": [
                "libssl1.1"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": null,
            "upgrade": null
        }
    }
}

TASK [common : include_tasks] ******************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/common/tasks/main.yml:7
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [locale : Check current locale] ***********************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/locale/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 `"&& mkdir /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827 && echo ansible-tmp-1618568868.1509638-1058-236315416933827="` echo /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8456m1tsiul/tmpv52rgfum TO /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827/ /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1618568868.1509638-1058-236315416933827/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "localectl",
    "delta": "0:00:00.024092",
    "end": "2021-04-16 12:27:48.507740",
    "invocation": {
        "module_args": {
            "_raw_params": "localectl",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "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": "2021-04-16 12:27:48.483648",
    "stderr": "\u001b[0;1;31mSystem has not been booted with systemd as init system (PID 1). Can't operate.\u001b[0m\n\u001b[0;1;31mFailed to create bus connection: Host is down\u001b[0m",
    "stderr_lines": [
        "\u001b[0;1;31mSystem has not been booted with systemd as init system (PID 1). Can't operate.\u001b[0m",
        "\u001b[0;1;31mFailed to create bus connection: Host is down\u001b[0m"
    ],
    "stdout": "",
    "stdout_lines": []
}

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

Traceback (most recent call last):
  File "install.py", line 498, in <module>
    install_bench(args)
  File "install.py", line 279, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 414, in run_playbook
    success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.8/subprocess.py", line 364, 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=erpuser']' returned non-zero exit status 2.

Hi @Ido_Traini
I guess you should follow the step below.

1) open file install.py 
2) find "mariadb_version" then change default to "10.5".

Hi @signail thanks for you effort, but this don’t help. Also, in the suggested command it is specified that you will use mariadb-version 10.5 and this overwrite the default setting.

Problem is that in wsl2 the systemd is not active, so it cannot create a bus connection: no host, no installation (sorry, my english is rugged and my knowledge of linux is not enough to use the right terms).
I’ve found this script: GitHub - DamionGans/ubuntu-wsl2-systemd-script: [Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images

that resolve the problem. Tomorrow I will try with a fresh Ubuntu WSL2 installation, with the script and without manipulating at all the install.py.

Now the new error (i’ve reported the “red” part):

TASK [bench : Check whether the site already exists] *******************************************************************
task path: /tmp/.bench/bench/playbooks/roles/bench/tasks/setup_erpnext.yml:13
<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 /var/tmp `"&& mkdir /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269 && echo ansible-tmp-1618768836.6817203-11144-41838006679269="` echo /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/files/stat.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1184iaunm3d2/tmpoyv52ve6 TO /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/AnsiballZ_stat.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:erper:r-x /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/ /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/AnsiballZ_stat.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/ /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/AnsiballZ_stat.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chown erper /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/ /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/AnsiballZ_stat.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u erper /bin/sh -c '"'"'echo BECOME-SUCCESS-zdhztkrjviewylzfesmshvcvivhvbqqj ; /usr/bin/python3 /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/AnsiballZ_stat.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1618768836.6817203-11144-41838006679269/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "checksum_algorithm": "sha1",
            "follow": false,
            "get_attributes": true,
            "get_checksum": true,
            "get_md5": null,
            "get_mime": true,
            "path": "/home/erper/frappe-bench/sites/site1.local"
        }
    },
    "stat": {
        "exists": false
    }
}

TASK [bench : Create a new site] ***************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/bench/tasks/setup_erpnext.yml:18
<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 /var/tmp `"&& mkdir /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660 && echo ansible-tmp-1618768836.8321133-11178-183899412082660="` echo /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660 `" ) && sleep 0'
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1184iaunm3d2/tmp1xrchzhw TO /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:erper:r-x /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/ /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/ /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'chown erper /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/ /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u erper /bin/sh -c '"'"'echo BECOME-SUCCESS-qrawovqqdcdannqyyrjhfksqzyosyzuw ; /usr/bin/python3 /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1618768836.8321133-11178-183899412082660/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": [
        "bench",
        "new-site",
        "site1.local",
        "--admin-password",
        "idumpsg7",
        "--mariadb-root-password",
        "idumpsg7"
    ],
    "delta": "0:00:00.415096",
    "end": "2021-04-18 20:00:37.355472",
    "invocation": {
        "module_args": {
            "_raw_params": "bench new-site site1.local --admin-password 'idumpsg7' --mariadb-root-password 'idumpsg7'",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/home/erper/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": "2021-04-18 20:00:36.940376",
    "stderr": "Traceback (most recent call last):\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 68, in get_app_commands\n    app_command_module = importlib.import_module(app + '.commands')\n  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 961, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked\nModuleNotFoundError: No module named 'erpnext'\nTraceback (most recent call last):\n  File \"/usr/lib/python3.8/runpy.py\", line 194, in _run_module_as_main\n    return _run_code(code, main_globals, None,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 99, in <module>\n    main()\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 764, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 717, in main\n    rv = self.invoke(ctx)\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 1137, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 1137, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 956, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 555, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/commands/site.py\", line 41, in new_site\n    frappe.init(site=site, new_site=True)\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 175, in init\n    setup_module_map()\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 1019, in setup_module_map\n    for module in get_module_list(app):\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 882, in get_module_list\n    return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), \"modules.txt\"))\n  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 840, in get_module\n    return importlib.import_module(modulename)\n  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked\nModuleNotFoundError: No module named 'erpnext'",
    "stderr_lines": [
        "Traceback (most recent call last):",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 68, in get_app_commands",
        "    app_command_module = importlib.import_module(app + '.commands')",
        "  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module",
        "    return _bootstrap._gcd_import(name[level:], package, level)",
        "  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import",
        "  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load",
        "  File \"<frozen importlib._bootstrap>\", line 961, in _find_and_load_unlocked",
        "  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed",
        "  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import",
        "  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load",
        "  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked",
        "ModuleNotFoundError: No module named 'erpnext'",
        "Traceback (most recent call last):",
        "  File \"/usr/lib/python3.8/runpy.py\", line 194, in _run_module_as_main",
        "    return _run_code(code, main_globals, None,",
        "  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code",
        "    exec(code, run_globals)",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 99, in <module>",
        "    main()",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main",
        "    click.Group(commands=commands)(prog_name='bench')",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 764, in __call__",
        "    return self.main(*args, **kwargs)",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 717, in main",
        "    rv = self.invoke(ctx)",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 1137, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 1137, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 956, in invoke",
        "    return ctx.invoke(self.callback, **ctx.params)",
        "  File \"/home/erper/frappe-bench/env/lib/python3.8/site-packages/click/core.py\", line 555, in invoke",
        "    return callback(*args, **kwargs)",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/commands/site.py\", line 41, in new_site",
        "    frappe.init(site=site, new_site=True)",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 175, in init",
        "    setup_module_map()",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 1019, in setup_module_map",
        "    for module in get_module_list(app):",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 882, in get_module_list",
        "    return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), \"modules.txt\"))",
        "  File \"/home/erper/frappe-bench/apps/frappe/frappe/__init__.py\", line 840, in get_module",
        "    return importlib.import_module(modulename)",
        "  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module",
        "    return _bootstrap._gcd_import(name[level:], package, level)",
        "  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import",
        "  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load",
        "  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked",
        "ModuleNotFoundError: No module named 'erpnext'"
    ],
    "stdout": "",
    "stdout_lines": []
}

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

Traceback (most recent call last):
  File "install.py", line 498, in <module>
    install_bench(args)
  File "install.py", line 279, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 414, in run_playbook
    success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
  File "/usr/lib/python3.8/subprocess.py", line 364, 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=erper']' returned non-zero exit status 2.