Totally unable to install on Ubuntu 18.04

Following the instructions here

and they aren’t working. The install.py script seems to go wrong (tail below)

This is a 16Gb VM with 160Gb HDD

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-1647020190.1213863-21301-67799470681135 && echo ansible-tmp-1647020190.1213863-21301-67799470681135=“echo /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135” ) && sleep 0’
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-17773237b22_2/tmpo0uxl233 TO /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135/ /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘sudo -H -S -n -u frappe /bin/sh -c ‘"’“‘echo BECOME-SUCCESS-hpxziotuntojglmlizkdsnqtwzztdajc ; /usr/bin/python3 /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135/AnsiballZ_command.py’”’"’ && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1647020190.1213863-21301-67799470681135/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
“bench”,
“new-site”,
“site1.local”,
“–admin-password”,
“admin”,
“–mariadb-root-password”,
“mysql”
],
“delta”: “0:00:02.172395”,
“end”: “2022-03-11 17:36:32.837291”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench new-site site1.local --admin-password ‘admin’ --mariadb-root-password ‘mysql’”,
“_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”: 2,
“start”: “2022-03-11 17:36:30.664896”,
“stderr”: “Usage: bench [OPTIONS] COMMAND [ARGS]…\nTry ‘bench --help’ for help.\n\nError: No such command ‘new-site’.”,
“stderr_lines”: [
“Usage: bench [OPTIONS] COMMAND [ARGS]…”,
“Try ‘bench --help’ for help.”,
“”,
“Error: No such command ‘new-site’.”
],
“stdout”: “WARN: bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench\n\n/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for ‘frappe.utils.bench_helper’ (ModuleNotFoundError: No module named ‘frappe’)”,
“stdout_lines”: [
“WARN: bench is installed in editable mode!”,
“”,
“This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench”,
“”,
“/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for ‘frappe.utils.bench_helper’ (ModuleNotFoundError: No module named ‘frappe’)”
]
}

PLAY RECAP *******************************************************************************************************************************************************************************************************
localhost : ok=72 changed=15 unreachable=0 failed=1 skipped=67 rescued=0 ignored=0

Install script run at 17:33 on 2022-03-11

Hi,

May we know the command you used to execute the script and as what user?

I setup a fresh Ununtu Server 18.04.
Only one user - with sudo privileges
I run an apt udate && apt upgrade

I then follow the guide I linked to.

and it’s “sudo -H python3 install.py --production”

The install methods on the page you linked do not have that install invocation. The setup for the Easy Install method does not have sudo , have you tried it without sudo?

Here’s what I am seeing

erpnext@erpnext-v12:~$ python3 install.py --production
Please run this script as a non-root user with sudo privileges
erpnext@erpnext-v12:~$ sudo python3 install.py --production
[sudo] password for erpnext:
Logs are saved under /tmp/logs/easy-install__2022-03-13__15-59.log
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
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.1 documentation
/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
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.1 documentation
pip3 already installed!
Checking System Compatibility…
ubuntu 18 is compatible!
Not cloning already existing Bench repository at /tmp/.bench
[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’
Input MySQL and Frappe Administrator passwords:
Passwords saved at ~/passwords.txt
Initializing bench frappe-bench:
Frappe Branch: version-13
ERPNext Branch: version-13
[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’
[WARNING]: Consider using the get_url or uri module rather than running ‘curl’. If you need to use command because get_url or uri is insufficient you can add ‘warn: false’ to this command task or set
‘command_warnings=False’ in ansible.cfg to get rid of this message.
[DEPRECATION WARNING]: evaluating as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle… This
feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Consider using the file module with owner rather than running ‘chown’. If you need to use command because file is insufficient you can add ‘warn: false’ to this command task or set
‘command_warnings=False’ in ansible.cfg to get rid of this message.
Traceback (most recent call last):
File “install.py”, line 497, in
install_bench(args)
File “install.py”, line 278, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 413, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, 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’]’ returned non-zero exit status 2.
erpnext@erpnext-v12:~$

and the last TASK in the logfile:

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-1647187354.315431-4962-174885956722966 && echo ansible-tmp-1647187354.315431-4962-174885956722966=“echo /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966” ) && sleep 0’
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /home/erpnext/.ansible/tmp/ansible-local-1423z7bp4kqx/tmpeonldh_1 TO /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966/ /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘sudo -H -S -n -u frappe /bin/sh -c ‘"’“‘echo BECOME-SUCCESS-drsevbxgdednaqomjpykrandrfnjhuox ; /usr/bin/python3 /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966/AnsiballZ_command.py’”’"’ && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1647187354.315431-4962-174885956722966/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
“bench”,
“new-site”,
“site1.local”,
“–admin-password”,
“admin”,
“–mariadb-root-password”,
“mysql”
],
“delta”: “0:00:03.253654”,
“end”: “2022-03-13 16:02:38.099954”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench new-site site1.local --admin-password ‘admin’ --mariadb-root-password ‘mysql’”,
“_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”: 2,
“start”: “2022-03-13 16:02:34.846300”,
“stderr”: “Usage: bench [OPTIONS] COMMAND [ARGS]…\nTry ‘bench --help’ for help.\n\nError: No such command ‘new-site’.”,
“stderr_lines”: [
“Usage: bench [OPTIONS] COMMAND [ARGS]…”,
“Try ‘bench --help’ for help.”,
“”,
“Error: No such command ‘new-site’.”
],
“stdout”: “WARN: bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench\n\n/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for ‘frappe.utils.bench_helper’ (ModuleNotFoundError: No module named ‘frappe’)”,
“stdout_lines”: [
“WARN: bench is installed in editable mode!”,
“”,
“This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench”,
“”,
“/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for ‘frappe.utils.bench_helper’ (ModuleNotFoundError: No module named ‘frappe’)”
]
}

PLAY RECAP *******************************************************************************************************************************************************************************************************
localhost : ok=72 changed=15 unreachable=0 failed=1 skipped=67 rescued=0 ignored=0

Install script run at 15:59 on 2022-03-13

erpnext@erpnext-v12:~$

It may be that the Easy Install script is not compatible with your environment for some reason. Have a look at these installation instruction, perhaps they will work better:

https://frappeframework.com/docs/v13/user/en/installation#debian-ubuntu

hi @Jason_LoCascio

The issue here is you are installing version 13 and not version 12… that is because the easy script by default install version 13.

Version 13 needs python 3.8 or above to install properly.

Easy install has been dropped in favour of Containerized Installation using Docker.

here are couple of things you can do

  1. trying to install Version 12 by specifically mentioning it if that is what you want

python3 install.py --verbose --production --frappe-branch version-12 --erpnext-branch version-12

  1. or use ubuntu 20.04 (which has python 3.8) and proceed with the default easy install which will install version 13 by default

python3 install.py --production

  1. If all else fails … I would highly recommend going with Ubuntu 20.04 and using the manual installation method to install Version 13 (unless you have some specific reason to stay at Version 12 or Ubuntu 18.04 ). There is less probability of failing.

Many thanks for the last couple of steers. I’ll see if I can work through them.

We’re trying to go from

ERPNext: v11.1.68 (version-11)

Frappe Framework: v11.1.62 (version-11)

to v12 in the first instance.

Is the existing version 11 instance in working order, where is it hosted and on what OS version?

Currently it’s on 16.04 - which is why we want to upgrade.

I will take note of the answers here and look at providing more details.

This ansible error could be resolved by the following link below.

I have faced issues recently trying to install using easy install script. You better do a manual installation.