You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using --force and re-uploading a binary the checksum verification step fails with an exception like:
Traceback (most recent call last):
File "/tmp/venv.CzmM0ZXkCH/bin/chacractl", line 6, in <module>
main.ChacraCtl()
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/main.py", line 38, in __init__
self.main(argv)
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/decorators.py", line 68, in newfunc
return f(*a, **kw)
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/main.py", line 82, in main
parser.dispatch()
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/tambo/dispatcher.py", line 21, in dispatch
return instance.main()
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/api/binaries.py", line 161, in main
self.post(url, filename)
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/api/binaries.py", line 86, in post
return self.put(file_url, filepath)
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/api/binaries.py", line 123, in put
if not self.upload_is_verified(url, filename, digest):
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/chacractl/api/binaries.py", line 71, in upload_is_verified
arch_data = r.json()
File "/tmp/venv.CzmM0ZXkCH/lib/python2.7/site-packages/requests/models.py", line 826, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
This is because when chacractl uses PUT to re-upload, the url that it uses to get the checksum includes the binary name. This makes the url incorrect for the upload_is_verified method and it can not get at the binary data it expects to be in the json payload. In fact, there is no json at all at that endpoint.
A PUT request must include the binary filename so it can be overwritten,
however if we want to verify the checksum we need to trim that filename
and issue a GET to the arch endpoint to retrieve the metadata for the
binary.
Fixes: #29
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
When using --force and re-uploading a binary the checksum verification step fails with an exception like:
This is because when chacractl uses PUT to re-upload, the url that it uses to get the checksum includes the binary name. This makes the url incorrect for the
upload_is_verified
method and it can not get at the binary data it expects to be in the json payload. In fact, there is no json at all at that endpoint.This was found during this job: https://jenkins.ceph.com/job/ceph-dev-build/807/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=centos7,DIST=centos7,MACHINE_SIZE=huge/console
The text was updated successfully, but these errors were encountered: