Install of production version bench on ubuntu did not go through

Hello ,

I am trying to install erpnext on ubuntu server.
I followed the following easy install instructions on this website

ran the following command
sudo python2.7 install.py --production --user [frappe-user]

the bench directory was not there in the /home/frappe-user directory .
i found a bench directory under /tmp as /tmp/.bench/bench.

the database got installed and the passwords were also set. but felt the bench did not get installed.

have i missed something

regards

Please clarify,
Are you using local physical or virtual machine?
Are you using VPS? if so, what’s the virtualization platform?
Which version of Ubuntu? 16.04? 18.04?

sudo python2.7 install.py --production --user [frappe-user]

I think this command is not correct
just

sudo python install.py --production --user USER

i am using a virtual machine

sudo python install.py --production --user USER

when i use the following command i can see it is using Python 3 to install.
The following is where it quit

TASK [nodejs : Install yarn] ***************************************************
task path: /tmp/.bench/playbooks/roles/nodejs/tasks/main.yml:8
<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-1571814543.373622-49986997888123” && echo ansible-tmp-1571814543.373622-49986997888123="echo /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123" ) && sleep 0’
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /home/gudurerp/.ansible/tmp/ansible-local-72827gjqwowz/tmp1yx75g2e TO /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123/ /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1571814543.373622-49986997888123/ > /dev/null 2>&1 && sleep 0’
The full traceback is:
File “/tmp/ansible_command_payload__22xb4s_/ansible_command_payload.zip/ansible/module_utils/basic.py”, line 2564, in run_command
cmd = subprocess.Popen(args, **kwargs)
File “/usr/lib/python3.6/subprocess.py”, line 729, in init
restore_signals, start_new_session)
File “/usr/lib/python3.6/subprocess.py”, line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)

fatal: [localhost]: FAILED! => {
“changed”: false,
“cmd”: “npm install -g yarn”,
“invocation”: {
“module_args”: {
“_raw_params”: “npm install -g yarn”,
“_uses_shell”: false,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “[Errno 2] No such file or directory: ‘npm’: ‘npm’”,
“rc”: 2
}

RUNNING HANDLER [mariadb : restart mysql] **************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *********************************************************************
localhost : ok=28 changed=6 unreachable=0 failed=1 skipped=22 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/python2.7/subprocess.py”, line 190, 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=gudurerp’]’ returned non-zero exit status 2

build-essential is already the newest version (12.4ubuntu1).
libffi-dev is already the newest version (3.2.1-8).
python3-setuptools is already the newest version (39.0.1-2).
git is already the newest version (1:2.17.1-1ubuntu0.4).
python3-dev is already the newest version (3.6.7-1~18.04).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgr

thank you

well, I can suggest that, go with this guide here but don’t continue as manual.

just make sure that all dependencies are there in particular nodejs, npm and yarn before you run the script.

ok …
just an after thought i have python 3.6 installed. do i uninstall and install the 2.7 version.

my ubuntu version is 18.04

no, as I got informed here, both versions are required 2.7 and 3.6 for Ubuntu 18.04
It’s preferred to use fresh VM, else you have to delete the created USER and it’s home directory before you try again or use different USER name.

oh ok
wondering why a new vm or a new user …
will try with a new user. if any error will install with a new VM.

Thank you

yeah, you can try anyway, good luck, welcome

when i ran the following command

as a new user
$ git clone https://github.com/frappe/bench
$ pip install -e ./bench

i got the following errors
Running setup.py develop for bench
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/home/erpg/bench/setup.py’"’"’; file=’"’"’/home/erpg/bench/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ develop --no-deps
cwd: /home/erpg/bench/
Complete output (27 lines):
running develop
error: can’t create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/test-easy-install-16232.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python3.6/dist-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://setuptools.readthedocs.io/en/latest/easy_install.html

Please make the appropriate changes for your system and try again.

----------------------------------------

ERROR: Command errored out with exit status 1: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/home/erpg/bench/setup.py’"’"’; file=’"’"’/home/erpg/bench/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ develop --no-deps Check the logs for full command output.

I told you,

just run the script after you install nodejs and yarn.

oh yes ok

ok installed all the prerequisites and then ran the

following script :-
sudo python install.py --production --user USER

but following error

TASK [mariadb : Set root Password] *********************************************
task path: /tmp/.bench/playbooks/roles/mariadb/tasks/mysql_secure_installation.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/ansible-tmp-1571823910.63-80579351008753” && echo ansible-tmp-1571823910.63-80579351008753="echo /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753" ) && sleep 0’
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/database/mysql/mysql_user.py
<127.0.0.1> PUT /home/gudur/.ansible/tmp/ansible-local-22952kNKL_k/tmpMzj4YC TO /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753/AnsiballZ_mysql_user.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753/ /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1571823910.63-80579351008753/ > /dev/null 2>&1 && sleep 0’
failed: [localhost] (item=localhost) => {
“ansible_loop_var”: “item”,
“changed”: false,
“invocation”: {
“module_args”: {
“append_privs”: false,
“ca_cert”: null,
“check_implicit_admin”: true,
“client_cert”: null,
“client_key”: null,
“config_file”: “/home/gudur/.my.cnf”,
“connect_timeout”: 30,
“encrypted”: false,
“host”: “localhost”,
“host_all”: false,
“login_host”: “localhost”,
“login_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“login_port”: 3306,
“login_unix_socket”: null,
“login_user”: null,
“name”: “root”,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“priv”: null,
“sql_log_bin”: true,
“state”: “present”,
“update_password”: “always”,
“user”: “root”
}
},
“item”: “localhost”,
“msg”: “The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required.”
}
<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-1571823911.07-233716681793795” && echo ansible-tmp-1571823911.07-233716681793795="echo /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795" ) && sleep 0’
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/database/mysql/mysql_user.py
<127.0.0.1> PUT /home/gudur/.ansible/tmp/ansible-local-22952kNKL_k/tmpjfYwIb TO /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795/AnsiballZ_mysql_user.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795/ /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1571823911.07-233716681793795/ > /dev/null 2>&1 && sleep 0’
failed: [localhost] (item=127.0.0.1) => {
“ansible_loop_var”: “item”,
“changed”: false,
“invocation”: {
“module_args”: {
“append_privs”: false,
“ca_cert”: null,
“check_implicit_admin”: true,
“client_cert”: null,
“client_key”: null,
“config_file”: “/home/gudur/.my.cnf”,
“connect_timeout”: 30,
“encrypted”: false,
“host”: “127.0.0.1”,
“host_all”: false,
“login_host”: “localhost”,
“login_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“login_port”: 3306,
“login_unix_socket”: null,
“login_user”: null,
“name”: “root”,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“priv”: null,
“sql_log_bin”: true,
“state”: “present”,
“update_password”: “always”,
“user”: “root”
}
},
“item”: “127.0.0.1”,
“msg”: “The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required.”
}
<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-1571823911.28-246825284398409” && echo ansible-tmp-1571823911.28-246825284398409="echo /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409" ) && sleep 0’
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/database/mysql/mysql_user.py
<127.0.0.1> PUT /home/gudur/.ansible/tmp/ansible-local-22952kNKL_k/tmpq8ilaI TO /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409/AnsiballZ_mysql_user.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409/ /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409/AnsiballZ_mysql_user.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1571823911.28-246825284398409/ > /dev/null 2>&1 && sleep 0’
failed: [localhost] (item=::1) => {
“ansible_loop_var”: “item”,
“changed”: false,
“invocation”: {
“module_args”: {
“append_privs”: false,
“ca_cert”: null,
“check_implicit_admin”: true,
“client_cert”: null,
“client_key”: null,
“config_file”: “/home/gudur/.my.cnf”,
“connect_timeout”: 30,
“encrypted”: false,
“host”: “::1”,
“host_all”: false,
“login_host”: “localhost”,
“login_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“login_port”: 3306,
“login_unix_socket”: null,
“login_user”: null,
“name”: “root”,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“priv”: null,
“sql_log_bin”: true,
“state”: “present”,
“update_password”: “always”,
“user”: “root”
}
},
“item”: “::1”,
“msg”: “The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required.”
}

RUNNING HANDLER [mariadb : restart mysql] **************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *********************************************************************
localhost : ok=24 changed=15 unreachable=0 failed=1 skipped=15 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/python2.7/subprocess.py”, line 190, 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=gudur’]’ returned non-zero exit status 2
gudur@ubuntu-4gb-nbg1-2:~$

I think you have a problem with MariaDB configuration, Please check out