frappe / bench

CLI to manage Multi-tenant deployments for Frappe apps
https://frappeframework.com/docs/user/en/bench
GNU General Public License v3.0
1.36k stars 1.19k forks source link

I'm trying to installl frappe bench - production. Not able to proceed. #313

Closed morethegr8 closed 7 years ago

morethegr8 commented 8 years ago

TASK [Create new site] *** fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "*", "--mariadb-root-password", "****_"], "delta": "0:00:00.821712", "end": "2016-09-21 02:02:19.216869", "failed": true, "rc": 1, "start": "2016-09-21 02:02:18.395157", "stderr": "INFO:bench.utils:creating new site site1.local\n/bin/sh: 1: /home/frappe/frappe-bench/env/bin/frappe: not found\nTraceback (most recent call last):\n File \"/usr/local/bin/bench\", line 11, in \n load_entry_point('bench', 'console_scripts', 'bench')()\n File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli\n bench_command()\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 716, in call*\n return self.main(_args, _kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 696, in main\n rv = self.invoke(ctx)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1060, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 889, in invoke\n return ctx.invoke(self.callback, _ctx.params)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 534, in invoke\n return callback(_args, _kwargs)\n File \"/home/frappe/.bench/bench/commands/make.py\", line 56, in new_site\n new_site(site, mariadb_root_password=mariadb_root_password, admin_password=admin_password)\n File \"/home/frappe/.bench/bench/utils.py\", line 150, in new_site\n ), cwd=os.path.join(bench_path, 'sites'))\n File \"/home/frappe/.bench/bench/utils.py\", line 127, in exec_cmd\n raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/frappe site1.local --install 1bd3e0294d --root_password NAPL#123 --admin_password NAPL#123", "stdout": "frappe app is not installed. Run the following command to install frappe\nbench get-app https://github.com/frappe/frappe.git", "stdout_lines": ["frappe app is not installed. Run the following command to install frappe", "bench get-app https://github.com/frappe/frappe.git"], "warnings": []}

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

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

Traceback (most recent call last): File "install.py", line 342, 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 292, 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

shreyasp commented 7 years ago

@morethegr8 What version of Linux are you using ?

morethegr8 commented 7 years ago

I have tried installing it on ubuntu 14.04, 15.10 & 16.04. All the three has given same error or while task bench init.

Still not been able to setup erpnext server.

shreyasp commented 7 years ago

@morethegr8 That's weird, we haven't faced any such issues, while we try to set up the ERPNext system.

Can you please tell me what command you are trying to run to set up your ERPNext environment.

morethegr8 commented 7 years ago

I have used easy script - opinionated setup on blank server.

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py sudo python install.py --production

Entered Maria DB root password & administrator password. Thats it.

chdecultot commented 7 years ago

For information, I have just made a fresh install on an AWS-EC2 Ubuntu 16.04(64bit) instance and didn't encounter any issue, except #327 (small Nginx configuration issue).

Here is exact the process I have followed: 1) Launched the instance 2) SSH connection as user ubuntu 3) sudo apt-get update && sudo apt-get upgrade 4) sudo apt-get install python-minimal 5) wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py 6) sudo python install.py --production 7) Enter db and admin passwords when prompted 8) Connect to the site in the browser (after correction of #327 )

I have done the process a few times on a digital ocean droplet and ec2 with ubuntu 14.04 and it worked identically.

Hope this can help.

Best regards, Charles-Henri

KaruguDev commented 7 years ago

it impressive that you followed those steps and it worked image

vjFaLk commented 7 years ago

@paul-100 Would you mind creating a post on https://discuss.erpnext.com/ so we can move the debugging there? Feel free to link it here.

greenfield-br commented 6 years ago

try to create frappe user before. add to it sudo privilenges, and then from that account run the script. i faced the same on CentOS7.4 digitalocean, and i am now trying this.

amet123 commented 6 years ago

Ubuntu 16

TASK [bench : include_tasks] ***********************************************************************************************************
included: /tmp/.bench/playbooks/roles/bench/tasks/setup_bench_production.yml for localhost

TASK [bench : Setup production] ***********************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “setup”, “production”, “frappe”], “delta”: “0:00:14.696643”, “end”: “2018-03-15 09:54:27.454423”, “failed”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-03-15 09:54:12.757780”, “stderr”: “Aborted!”, “stderr_lines”: [“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]: "]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

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

Traceback (most recent call last):
File “install.py”, line 387, in
install_bench(args)
File “install.py”, line 109, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 325, 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’, ‘site.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2
RamAmancha commented 6 years ago

error in Ubuntu 16.04 distribution was not found and is required by bench to retry user --limit @/tmp/.bench/playbooks/site.retry

Ramesh7128 commented 6 years ago

How did you get over this issue?

Ramesh7128 commented 6 years ago

figured out. works fine with an update of ansible.

SarveshBajaj commented 6 years ago
TASK [common : include_tasks] **************************************************************
skipping: [localhost]

TASK [locale : Check current locale] *******************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "localectl", "delta": "0:00:00.010267", "end": "2018-05-21 04:56:49.468314", "msg": "non-zero return code", "rc": 1, "start": "2018-05-21 04:56:49.458047", "stderr": "Failed to create bus connection: No such file or directory", "stderr_lines": ["Failed to create bus connection: No such file or directory"], "stdout": "", "stdout_lines": []}
    to retry, use: --limit @/tmp/.bench/playbooks/site.retry

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

Traceback (most recent call last):
  File "install.py", line 417, 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/lib/python2.7/subprocess.py", line 541, 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

trying many solutions none are working anyone can help on what steps to follow next??

using 16.04 ssh steps followed:

1.sudo apt-get update && sudo apt-get upgrade 2.adduser frappe 3.usermod -aG sudo frappe 4.wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py 5.sudo python install.py --develop --user frappe

codingCoffee commented 6 years ago

@SarveshBajaj you're trying to install in a container based virtualization environment, like OpenVZ, or docker, or virtuozzo. The easy install scripts won't work in them. Please try installing it in a hardware based virtualization environment like KVM, virtualbox etc. Or install manually if using container based virtualization (https://github.com/frappe/frappe/wiki/The-Hitchhiker's-Guide-to-Installing-Frappé-on-Linux-OS)

SarveshBajaj commented 6 years ago

Ok..Thanks..

dzulhelmi commented 4 years ago

Still got error:

Traceback (most recent call last):
  File "install.py", line 413, in <module>
    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=frappe']' returned non-zero exit status 2
Thunderbottom commented 4 years ago

@dzulhelmi the issue should be fixed now with #854