[Solved] Production server installation error in Bench init frappe-bench

Hello,

I faced Below error while executing ** python install.py --production ** in Ubuntu server.

Traceback (most recent call last):
File “install.py”, line 351, in
install_bench(args)
File “install.py”, line 98, in install_bench
run_playbook(‘develop/create_user.yml’, extra_vars=extra_vars)
File “install.py”, line 301, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘develop/create_user.yml’, ‘-e’, ‘@/tmp/extra_vars.json’]’ returned non-zero exit status 2

Regards,
Hardik Gadesha

Share the full trace.

Hello @rmehta,

Could you please guide me for installation process of frappe in production server.

Thanks

@rmehta below is full stack trace

fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “setup”, “production”, “frappe”], “delta”: “0:00:00.610073”, “end”: “2016-12-12 09:04:46.014850”, “failed”: true, “rc”: 1, “start”: “2016-12-12 09:04:45.404777”, “stderr”: “Aborted!”, “stdout”: "supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: ", “stdout_lines”: ["supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: "], “warnings”: []}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @production/install.retry

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

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

Maybe you should delete your supervisor.conf file in /etc and try again.

Hello,

During manual installation process of production server, i faced below error when i execute bench init frappe-bench && cd frappe-bench command.

What will be the cause behind this error ?

Regards,
Hardik Gadesha

Hello,

Here is a steps that we follow for Production setup.

**Manual Installation : **

1. Install Pre-requisites

** Python 2.7**
** MariaDB 10+ ( entered password = root )**
** Nginx (for production)**
** Nodejs**
** Redis**
** wkhtmltopdf with patched Qt (for pdf generation)**

2. Install Bench

** Install bench as a non root user,**

** git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo**
** sudo pip install -e bench-repo**

3. Create a new bench

** The init command will create a bench directory with frappe framework installed. It will be setup for periodic backups and auto updates once a day.**

** bench init frappe-bench && cd frappe-bench (Following errors can be occured while running this command)**

Note: If you face error like OSerror:Permission Denied on ./cache/pip file then use this command {sudo chmod 777 /home/.cache/}. This remove Permission Denied Error.

Note: If you face {Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-_F0_Pv/mysql-python/} error as well with above error then run following commands:

** 1) sudo easy_install pip**
** 2) sudo pip install pip --upgrade**
** 3) sudo pip install MySQL-python**

Above commands will install MySQLdb package. After that remove frappe-bench Directory and re-execute bench init frappe-bench && cd frappe-bench command.

4. Add apps


** The get-app command gets remote frappe apps from a remote git repository and installs it. Example: erpnext**

** bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)**

5. Add site

** Frappe apps are run by frappe sites and you will have to create at least one site. The new-site command allows you to do that.**

** bench new-site ERPNext**

6. Install erpnext

** To install erpnext on your new site, use the bench install-app command**

** bench --site ERPNext install-app erpnext**

7. Run: {bench setup supervisor} and {bench setup nginx}

8. Bench start ( Then enter your server IP:8000 in browser URL).

Above Mention Steps Are successfully working for us on [amazon EC2 instance with ubuntu 16.04 EMI].

Regards,
Hardik Gadesha

1 Like