Closed gabicavalcante closed 2 years ago
Note "stderr": "/bin/sh: 1: unzip: not found
in the Ansible output.
You do not have the unzip
program installed, so the operation fails. For Ubuntu, you probably need to run sudo apt install unzip
(or similar) to install it.
Please report back whether this fixes the problem. Thanks.
The role should check that dependency. Thanks for reporting.
thanks @chakl, it worked!
I added a new task to install unzip
:)
- name: Install unzip
apt:
name: unzip
state: present
update_cache: yes
Another thing that I have noticed was this error when I try to run the playbook again (after it works):
TASK [existdb-ansible-role : Backup installed exist instance] **
fatal: [default]: FAILED! => {"changed": true, "cmd": "/usr/local/existdb/exist/contrib/exist-filebased-backup.sh -M exist existdb", "delta": "0:00:00.003873", "end": "2021-11-25 21:01:18.267224", "msg": "non-zero return code", "rc": 1, "start": "2021-11-25 21:01:18.263351", "stderr": "Illegal option -M", "stderr_lines": ["Illegal option -M"], "stdout": "Usage: /usr/local/existdb/exist/contrib/exist-filebased-backup.sh [-f] [-s] [-v] [-d bakdir] [-i instname] [-t baktype] [-u instuser]\n /usr/local/existdb/exist/contrib/exist-filebased-backup.sh [-h]\n\nOptions:\n -d place backups below this directory (default /usr/local/existdb/backup)\n -f force, skip \"proceed?\" question\n -h help (this text)\n -i backup the named exist-db instance (default exist)\n -s log to syslog\n -t backup type (rsync/tgz/fast, default rsync)\n -u exist-db instance user (default existdb)\n -v verbose", "stdout_lines": ["Usage: /usr/local/existdb/exist/contrib/exist-filebased-backup.sh [-f] [-s] [-v] [-d bakdir] [-i instname] [-t baktype] [-u instuser]", " /usr/local/existdb/exist/contrib/exist-filebased-backup.sh [-h]", "", "Options:", " -d place backups below this directory (default /usr/local/existdb/backup)", " -f force, skip \"proceed?\" question", " -h help (this text)", " -i backup the named exist-db instance (default exist)", " -s log to syslog", " -t backup type (rsync/tgz/fast, default rsync)", " -u exist-db instance user (default existdb)", " -v verbose"]}
I think this command is expecting an answer like yes
to the question place backups below this directory (default /usr/local/existdb/backup)", " -f force, skip "proceed?". I can create a new issue for this error if you prefer.
For now, I set Ansible var
exist_backup_previnstall: no
exist_restore_prevdata: no
And it worked. But I'll investigate this bug because the backup it's something we need.
I got another error related to contrib/execute-xmlrpc.py
.
TASK [existdb-ansible-role : Set admin password (exec set-adminpass.xql)] ** fatal: [default]: FAILED! => {"changed": true, "cmd": "contrib/execute-xmlrpc.py -u admin -p \"\" -P 8080 -T < \"/usr/local/existdb/exist/set-adminpass.xql\" && touch \"/usr/local/existdb/exist//data/.password-set\"", "delta": "0:00:00.174735", "end": "2021-11-26 15:15:17.364059", "msg": "non-zero return code", "rc": 1, "start": "2021-11-26 15:15:17.189324", "stderr": "Traceback (most recent call last):\n File \"contrib/execute-xmlrpc.py\", line 70, in
\n with ServerProxy('{xmlrpcSchema}://{xmlrpcUser}:{xmlrpcPass}@{xmlrpcHost}:{xmlrpcPort}/exist/xmlrpc'.format(locals())) as proxy:\nAttributeError: exit", "stderr_lines": ["Traceback (most recent call last):", " File \"contrib/execute-xmlrpc.py\", line 70, in ", " with ServerProxy('{xmlrpcSchema}://{xmlrpcUser}:{xmlrpcPass}@{xmlrpcHost}:{xmlrpcPort}/exist/xmlrpc'.format( locals())) as proxy:", "AttributeError: exit"], "stdout": "", "stdout_lines": []}
I think ServerProxy
doesn't have __exit__
method
root@vagrant-ubuntu-trusty-64:/usr/local/existdb/exist/contrib# python3 execute-xmlrpc.py -u admin -p 8080 < /usr/local/existdb/exist/set-adminpass.xql
Namespace(B=False, L=False, Q=False, T=False, debug=False, file-name='', group='SYSTEM', host='localhost', mime='application/xml', mode='rw-r--r--', owner='admin', pass='8080', port=8080, timeout=180, user='admin')
execute-xmlrpc.py
8080
Traceback (most recent call last):
File "execute-xmlrpc.py", line 70, in <module>
with ServerProxy('{xmlrpcSchema}://{xmlrpcUser}:{xmlrpcPass}@{xmlrpcHost}:{xmlrpcPort}/exist/xmlrpc'.format(**locals())) as proxy:
AttributeError: __exit__
I changed to
proxy = ServerProxy('{xmlrpcSchema}://{xmlrpcUser}:{xmlrpcPass}@{xmlrpcHost}:{xmlrpcPort}/exist/xmlrpc'.format(**locals())):
And this fixed the __exit__
error.
I also found this in the execute-xmlrpc.py
file:
parser.add_argument("-P", "--port", type=int, default=8080, help="URL port (default: 8443)")
It says default: 8443
but actually use 8080
. And this raises a SSL error
ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:600)
I gonna close this issue and open a new one to report new issues.
@gabicavalcante I have committed a fix that adds "unzip" to the list of required packages in defaults/main.yml
. You should not need to add a separate task just to install "unzip".
Bug confirmed and fixed. Thanks for reporting!
And thanks for moving unrelated problems to separate issue.
Describe the bug I'm trying to use the exist-db ansible role, but I got this error message:
To Reproduce
The playbook:
And the Vangrantfile where I'm testing the playbook:
Context (please always complete the following information):