redhat-cip / dci-ansible

DCI Ansible modules and callback

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dci_file returns a UnicodeDecodeError exception

goneri opened this issue · comments

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128)
failed: [localhost] (item={u'path': u'/var/lib/dci-ansible-agent/.quickstart/collected_files/undercloud.tar.gz', u'mime': u'application/x-compressed', u'name': u'undercloud.tar.gz'}) => {"failed": true, "item": {"mime": "application/x-compressed", "name": "undercloud.tar.gz", "path": "/var/lib/dci-ansible-agent/.quickstart/collected_files/undercloud.tar.gz"}, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_d19GWY/ansible_module_dci_file.py\", line 217, in <module>\n    main()\n  File \"/tmp/ansible_d19GWY/ansible_module_dci_file.py\", line 199, in main\n    res = dci_file.create(ctx, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/dciclient/v1/api/file.py\", line 36, in create\n    return context.session.post(uri, headers=headers, data=content)\n  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 522, in post\n    return self.request('POST', url, data=data, json=json, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 461, in request\n    prep = self.prepare_request(req)\n  File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 394, in prepare_request\n    hooks=merge_hooks(request.hooks, self.hooks),\n  File \"/usr/lib/python2.7/site-packages/requests/models.py\", line 298, in prepare\n    self.prepare_auth(auth, url)\n  File \"/usr/lib/python2.7/site-packages/requests/models.py\", line 500, in prepare_auth\n    r = auth(self)\n  File \"/usr/lib/python2.7/site-packages/dciclient/v1/api/context.py\", line 98, in __call__\n    payload=r.body)\n  File \"/usr/lib/python2.7/site-packages/dciclient/v1/auth.py\", line 55, in sign\n    payload_hash = hashlib.sha256(payload.encode('utf-8')).hexdigest()\nUnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128)\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}

@goneri as the traceback does not relate to the latest code in the repo, could you verify if your python-dciclient and dci-ansible packages are up-to-date ?

This should have been fixed in redhat-cip/python-dciclient#7 or worked around by #5

Thanks for the answer @fcharlier.