@wale thank’s for mentioning it. Since I’m not able to replicate the error, if possible, please try out the following and get back to me.
On a fresh instance,
yum check-update
yum update -y
yum install -y git wget curl
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --repo-url https://github.com/codingCoffee/bench --bench-branch perm_error
wale
April 17, 2018, 5:24am
22
Hi @codingCoffee
Thanks for your response. I noticed there’s no user flag here. Should I still proceed? Remember I’m running these commands as root. Just want to be sure…
Thanks
Yup you can proceed. The user flag defaults to frappe
. Thanks for trying it out
wale
April 17, 2018, 6:34am
24
Hi @codingCoffee
Still the same . Please see complete trace below:
[root@server00 ~]# sudo python install.py --production --repo-url https://github.com/codingCoffee/bench --bench-branch perm_error
Loaded plugins: fastestmirror, universal-hooks
EA4 | 2.9 kB 00:00
cpanel-addons-production-feed | 2.9 kB 00:00
base | 3.6 kB 00:00
cpanel-plugins | 2.9 kB 00:00
epel/x86_64/metalink | 19 kB 00:00
extras | 3.4 kB 00:00
ius | 2.3 kB 00:00
nodesource | 2.5 kB 00:00
remi-php70 | 2.9 kB 00:00
remi-safe | 2.9 kB 00:00
updates | 3.4 kB 00:00
Loading mirror speeds from cached hostfile
* EA4: 216.38.56.98
* cpanel-addons-production-feed: 216.38.56.98
* epel: mirror.us.leaseweb.net
* ius: iad.mirror.rackspace.com
* remi-php70: repo1.ash.innoscale.net
* remi-safe: repo1.ash.innoscale.net
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 216.38.56.98
* cpanel-addons-production-feed: 216.38.56.98
* epel: mirror.us.leaseweb.net
* ius: iad.mirror.rackspace.com
* remi-php70: repo1.ash.innoscale.net
* remi-safe: repo1.ash.innoscale.net
Package epel-release-7-11.noarch already installed and latest version
Package redhat-lsb-core-4.1-27.el7.centos.1.x86_64 already installed and latest version
Package git-1.8.3.1-12.el7_4.x86_64 already installed and latest version
Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
Package python-devel-2.7.5-58.el7.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.2k-8.el7.x86_64 already installed and latest version
Package libffi-devel-3.0.13-18.el7.x86_64 already installed and latest version
Nothing to do
Requirement already up-to-date: setuptools in /usr/lib/python2.7/site-packages
Requirement already up-to-date: pip==9.0.3 in /usr/lib/python2.7/site-packages
You are using pip version 9.0.3, however version 10.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already satisfied: ansible in /usr/lib/python2.7/site-packages
Requirement already satisfied: cryptography in /usr/lib64/python2.7/site-packages (from ansible)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from ansible)
Requirement already satisfied: paramiko in /usr/lib/python2.7/site-packages (from ansible)
Requirement already satisfied: jinja2 in /usr/lib64/python2.7/site-packages (from ansible)
Requirement already satisfied: PyYAML in /usr/lib64/python2.7/site-packages (from ansible)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in /usr/lib64/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: idna>=2.1 in /usr/lib/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography->ansible)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/lib/python2.7/site-packages (from paramiko->ansible)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib64/python2.7/site-packages (from paramiko->ansible)
Requirement already satisfied: pynacl>=1.0.1 in /usr/lib64/python2.7/site-packages (from paramiko->ansible)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python2.7/site-packages (from jinja2->ansible)
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->ansible)
You are using pip version 9.0.3, however version 10.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
File "install.py", line 417, in <module>
install_bench(args)
File "install.py", line 100, in install_bench
run_playbook('create_user.yml', 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 537, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 524, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Try this:
sudo chown -R youruser:yourusergroup /usr/lib64/python2.7
wale
April 17, 2018, 4:46pm
26
Hi @Leonardo_Augusto
Thanks for your suggestion. I tried it but still the same result
wale
April 17, 2018, 5:10pm
27
Hi @codingCoffee
I’m wondering if the repo-url flag actually worked as I didn’t notice any difference in the full trace
Is there supposed to be any visible difference?
Thanks
Hi @wale , I had made changes (create_user.yml was made executable) in the particular branch, and I expected it to make a difference, but it didn’t. Just give me some time. I’ll get back to you on this issue, on this same thread.
wale
April 18, 2018, 6:14am
29
Hi @codingCoffee
Thanks a lot for looking into this. What I wanted to know was if we’re sure that the install script actually pulled from your repo. Will await your update
Kind regards,
wale
April 18, 2018, 10:07am
30
Hi @codingCoffee
I was able to get past the initial error by making the ansible-playbooks file executable but now I’m encountering the error below:
TASK [swap : Turn swap on] *****************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["swapon", "-a"], "delta": "0:00:00.019014", "end": "2018-04-18 09:52:54.775507", "msg": "non-zero return code", "rc": 255, "start": "2018-04-18 09:52:54.756493", "stderr": "swapon: /extraswap: insecure permissions 0644, 0600 suggested.\nswapon: /extraswap: swapon failed: Operation not permitted", "stderr_lines": ["swapon: /extraswap: insecure permissions 0644, 0600 suggested.", "swapon: /extraswap: swapon failed: Operation not permitted"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry
PLAY RECAP *********************************************************************
localhost : ok=8 changed=5 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/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
How to proceed? Please assist
Thanks
wale
April 18, 2018, 10:26am
31
I tried updating the permissions for the swapfile as suggested but still encountered the error below:
TASK [swap : Turn swap on] *****************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["swapon", "-a"], "delta": "0:00:00.003422", "end": "2018-04-18 10:22:18.546557", "msg": "non-zero return code", "rc": 255, "start": "2018-04-18 10:22:18.543135", "stderr": "swapon: /extraswap: swapon failed: Operation not permitted", "stderr_lines": ["swapon: /extraswap: swapon failed: Operation not permitted"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry
PLAY RECAP *********************************************************************
localhost : ok=8 changed=3 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/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
wale
April 18, 2018, 12:47pm
32
@codingCoffee any idea how to get around this please? Swap on / Swap off seems to be disabled (even for root) on this server
Thanks
wale
April 18, 2018, 12:50pm
33
By the way, I also noticed some warnings earlier on:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note
that the implicit localhost does not match 'all'
Hope these are not critical
Thanks
Hi @wale yes the warnings are harmless.
In case you the swap error, can you try executing this:
swapon -a
as the root user, on the failed sever and tell me if it works
wale
April 19, 2018, 7:14am
35
Hi @codingCoffee
Thanks for your response. Here’s the output:
swapon: /extraswap: swapon failed: Operation not permitted
wale
April 19, 2018, 7:51am
36
Hi @codingCoffee
Apparently, this is a known issue with openvps. Is there any way of making this task optional when it is not permitted?
Thanks
wale
April 19, 2018, 9:49am
37
Hi @codingCoffee
I got past the swap issue by following the suggestion in the thread below:
TASK [swap : Set swapiness] ****************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “echo 1 | tee /proc/sys/vm/swappiness”, “delta”: “0:00:00.003134”, “end”: “2017-11-07 11:43:08.930969”, “failed”: true, “rc”: 1, “start”: “2017-11-07 11:43:08.927835”, “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 @/…
Now I’m encountering the following error:
TASK [frappe_selinux : Check enabled SELinux modules] **************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "semanage module -l", "delta": "0:00:01.684212", "end": "2018-04-19 09:38:36.310557", "msg": "non-zero return code", "rc": 1, "start": "2018-04-19 09:38:34.626345", "stderr": "ValueError: SELinux policy is not managed or store cannot be accessed.", "stderr_lines": ["ValueError: SELinux policy is not managed or store cannot be accessed."], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry
PLAY RECAP *********************************************************************
localhost : ok=8 changed=1 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/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
Please advise
Thanks
Seems kernel not supporting SELinux.
please share output for uname -rv