Problems using "Easy Install" to install Frappe

Hello, by using this command sudo python install.py --production --user frappe mentioned in GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps page, I got several deprecation warnings and finally, installation failed with the following final text:

-------------------------------------------------------START MESSAGES-------------------------------------------
TASK [mariadb : Install MariaDB] **********************************************************************************************************************************************
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying name: "{{ item }}", please use name: ['MariaDB-server', 'MariaDB-client'] and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost] => (item=[u’MariaDB-server’, u’MariaDB-client’])

TASK [mariadb : Install MySQLdb Python package for secure installations.] *****************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “No package matching ‘MySQL-python’ found available, installed or updated”, “rc”: 126, “results”: [“No package matching ‘MySQL-python’ found available, installed or updated”]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP ********************************************************************************************************************************************************************
localhost : ok=7 changed=1 unreachable=0 failed=1

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

This is a fresh new server with CentOS 7 and all pre-requisites are installed.

As you can also see in the above text, there is a deprecation warning. This kind of warnings appears during all installation.

What may be causing the error? I think I can ignore the warnings, however installation is being aborted due to “No package matching ‘MySQL-python’ found available, installed or updated” error.

How can I solve this so that installation can continue?

Regards
Jaime

sudo yum install MySQL-python

or

pip install mysql-python

That package could not be installed using yum, but with pip it was installed, however, the same error is still appearing. I think this is because I cannot install it using yum:

root@vps [/var/frappe]# yum install MySQL-python
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile

If I use PIP, this is the result now:

root@vps [/var/frappe]# pip install mysql-python
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: mysql-python in /usr/lib64/python2.7/site-packages (1.2.5)

Regards
Jaime

This is the user name error as per best of my knowledge. What is the user name you are logged in to server ( for example on your window computer you have user by name to log in and use the computer) same way at the end of this command {sudo python install.py --production --user frappe} instead of frappe use the user name by which you logged in and this will work fine.

Hello… this is linux and I am logged in using root user.

According to Frappe instructions I need to use frappe user. Is it safe if I use root access to install it instead of frappe user?

Regards
Jaime

If you are root user then you can go with this code (python install.py --develop --user frappe) as guided in the instruction.

If you are using this code (sudo python install.py --production --user frappe) for this you can create a user in you Linux first and then use the command with the user name you created.

The same happened :frowning:

TASK [mariadb : Install MySQLdb Python package for secure installations.] *****************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “No package matching ‘MySQL-python’ found available, installed or updated”, “rc”: 126, “results”: [“No package matching ‘MySQL-python’ found available, installed or updated”]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

From your ROOT login type without quotes " sudo -i -u frappe" . Now you will be logged on to your Linux system as the FRAPPE user that was previously setup. When you’ve completed the tasks simply use the exit command and return to ROOT.

I did it, but when I run “python install.py --production”, I am required to enter “frappe” password… I don’t know it and I have never set it before :frowning:

As ROOT type in “sudo passwd frappe” without the quotes of course. It will ask you to enter a NEW password that you wish to set for the FRAPPE user account. Enter the new password, re-enter to verify. You’re done, type “exit” to return to ROOT. WRITE THE NEW PASSWORD DOWN. Try your installation script again with the newly set FRAPPE user password.

Now installer runs at leastm but I got the same error as before:

fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “No package matching ‘MySQL-python’ found available, installed or updated”, “rc”: 126, “results”: [“No package matching ‘MySQL-python’ found available, installed or updated”]}

I think the script has a problem… it tries to install a package named MySQL-python which idoes not exists. So, no workaround on this? is there a different way to install ERPNext automatically?

By doing it manually, I think I can only install development branch.

Regards

Try to finish the development branch installation Jaime, I can help you get it to production branch once all required dependencies are present. Am I correct that your are using a current version of CentOS?

This is reported by /etc/centos-release file:

CentOS Linux release 7.6.1810 (Core)

You mean me to install development branch manually instead of production?

Regards
Jaime

Hello… I could finally continue with installation, however, there was a lot of errors of files not found… installer was searching for files in different folders, not the folders where the installer was. I copied all the files to the locations where they were searched and installer continued… but I am stuck now with the following error:

fatal: [localhost]: FAILED! => {"changed": true, "cmd": "echo 1 | tee /proc/sys/vm/swappiness", "delta": "0:00:00.078206", "end": "2019-03-06 08:12:53.034101", "msg": "non-zero return code", "rc": 1, "start": "2019-03-06 08:12:52.955895", "stderr": "tee: /proc/sys/vm/swappiness: Permission denied", "stderr_lines": ["tee: /proc/sys/vm/swappiness: Permission denied"], "stdout": "1", "stdout_lines": ["1"]}

Is there a way to solve this? I have searched “/swappiness” in install.py file but it was not found.

Regards
Jaime

“echo 1 | tee /proc/sys/vm/swappiness” is likely to fail for a non-privileged user.
“echo 1 | sudo tee /proc/sys/vm/swappiness” should work better

the same happened:

root@vps [/var/frappe]# echo 1 | sudo tee /proc/sys/vm/swappiness
tee: /proc/sys/vm/swappiness: Permission denied
1

However, it seems this cannot be solved by modifying the command, since this is called somewhere in the frappe installer.

This is the traceback of the call:

TASK [swap : Set swapiness] ***************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "echo 1 | tee /proc/sys/vm/swappiness", "delta": "0:00:00.072399", "end": "2019-03-06 09:16:37.174463", "msg": "non-zero return code", "rc": 1, "start": "2019-03-06 09:16:37.102064", "stderr": "tee: /proc/sys/vm/swappiness: Permission denied", "stderr_lines": ["tee: /proc/sys/vm/swappiness: Permission denied"], "stdout": "1", "stdout_lines": ["1"]}
        to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost                  : ok=22   changed=4    unreachable=0    failed=1

Traceback (most recent call last):
  File "install.py", line 425, in <module>
    install_bench(args)
  File "install.py", line 122, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 338, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Regards
Jaime