Centos 7 Playbook Error

Hi,

Trying to install production setup on a new server and I got this error with playbook when I ran

sudo python install.py --production

TASK [Check if bench_repo_path exists] ***********************************************************************************************************************
ok: [localhost]

TASK [move /tmp/.bench if it exists] *************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["cp", "-R", "/tmp/.bench", "/home/root/.bench"], "delta": "0:00:00.003325", "end": "2017-09-29 14:33:35.269744", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-09-29 14:33:35.266419", "stderr": "cp: cannot create directory ‘/home/root/.bench’: No such file or directory", "stderr_lines": ["cp: cannot create directory ‘/home/root/.bench’: No such file or directory"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

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

Traceback (most recent call last):
  File "install.py", line 381, in <module>
    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 323, 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', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

I had earlier installed on the same config without problem but then I deleted the frappe user and now I am trying to install again and hence getting this error I had tried it with both:

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

Both are giving me the same error.

seems you are logged in as root and running from /home dir.

Run script from /root location

I realised I was logged into server as root and logged into the user as su - user
But then I logged into the server from the user account and then sud cd /root and then ran sudo python /home/aditya/install.py --production --user usernae and again got this error:

TASK [Set root Password] *************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["mysqladmin", "-u", "root", "password", "dpjLEzjHHqc7AEq"], "delta": "0:00:00.011623", "end": "2017-09-29 15:17:21.115353", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-09-29 15:17:21.103730", "stderr": "\u0007mysqladmin: connect to server at 'localhost' failed\nerror: 'Access denied for user 'root'@'localhost' (using password: NO)'", "stderr_lines": ["\u0007mysqladmin: connect to server at 'localhost' failed", "error: 'Access denied for user 'root'@'localhost' (using password: NO)'"], "stdout": "", "stdout_lines": []}
...ignoring

TASK [add launchagents folder mac] ***************************************************************************************************************************
skipping: [localhost]

TASK [add mysql to mac startup] ******************************************************************************************************************************
skipping: [localhost]

TASK [stop mysql mac] ****************************************************************************************************************************************
skipping: [localhost]

TASK [start mysql mac] ***************************************************************************************************************************************
skipping: [localhost]

TASK [Check if /tmp/.bench exists] ***************************************************************************************************************************
ok: [localhost]

TASK [Check if bench_repo_path exists] ***********************************************************************************************************************
ok: [localhost]

TASK [move /tmp/.bench if it exists] *************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["cp", "-R", "/tmp/.bench", "/home/root/.bench"], "delta": "0:00:00.004164", "end": "2017-09-29 15:17:21.917819", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-09-29 15:17:21.913655", "stderr": "cp: cannot create directory ‘/home/root/.bench’: No such file or directory", "stderr_lines": ["cp: cannot create directory ‘/home/root/.bench’: No such file or directory"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

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

Traceback (most recent call last):
  File "/home/aditya/install.py", line 381, in <module>
    install_bench(args)
  File "/home/aditya/install.py", line 111, in install_bench
    run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars)
  File "/home/aditya/install.py", line 323, 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', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=aditya']' returned non-zero exit status 2

I just checked that the bench seems to be working even after the above error and I was able to create a new site.

The problem now is that I am unable to access the website on a browser.

http://new_rigpl.rigpl.com

I am getting an error that connection refused. I am getting the same error even if I disable the firewalld service

How to debug this issue?

I have checked the bench doctor and it throws the below error:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 121, in doctor
    return _doctor(site=site)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 98, in doctor
    workers_online = check_number_of_workers()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 86, in check_number_of_workers
    return len(get_workers())
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/doctor.py", line 12, in get_workers
    workers = Worker.all()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/rq/worker.py", line 104, in all
    reported_working = connection.smembers(cls.redis_workers_keys)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 1638, in smembers
    return self.execute_command('SMEMBERS', name)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 673, in execute_command
    connection.send_command(*args)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 610, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 585, in send_packed_command
    self.connect()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 489, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.

sudo bench setup production frappe did the trick and now the webpage is accessible.

1 Like

I am also getting issue in default installation script for cents 7.

I run multiple time the script.
So finally I have done manual installation plus sudo bench setup production frappe

Now everything works fine.

Yo intente instalar de varias formas con el script en CentOS 7 en diferentes modalidades y no me fue posible, pero el mismo script en Ubuntu 16.4+ me funciono de maravilla