Red Hat Bugzilla – Bug 1255848
Error 500 and NPE when trying to import certificates of HTTP provider
Last modified: 2016-02-10 14:00:43 EST
This issue has been reported by Alexander Wells as part of the results of the test day. Quoting him:
* Openstack volume provider. Everything worked as advertised as well,
with the exception of 'importcertificates' that produced a 500 response. I get
a feeling its because of my setup, where my connection to openstack was over
http instead of https causing the problem. I would expect a better error
message than a 500 though.
* Openstack network provider. Same result as above, everything worked
except for importcertificates.
* Openstack image provider. Same result as above, everything worked
except for importcertificates. This includes the public ovirt glance instance.
it worked, with the exception of the importcertificates.
The reason for this is that when the protocol used is HTTP the backend returns null instead of an empty list of certificates. The RESTAPI doesn't take this into account and tries to access the list to get its size, which triggers the NPE and then the 500 response code.
The fix for this is changing the RESTAPI so it will tolerate that null, and return the error message generated by the backend instead of a 500 respose code.
$ curl -k -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -H "Filter: $filter" \
-u $U $URL/openstackimageproviders/8b5452b2-695d-48b4-ae90-94486add1955/importcertificates
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
oVirt 3.6.0 has been released and the bz verified, moving to closed current release.