[glance] "true is not of type boolean" when creating protected image
This problem occurs on a stable Ussuri Devstack. I issue this command to create a protected image: $ openstack image create myimage2 --file ~/myvm1.qcow2 --disk-format qcow2 --protected and get this error message back: BadRequestException: 400: Client Error for url: http://192.168.1.200/image/v2/images, 400 Bad Request: On instance['protected']:: 'type': 'boolean'}: {'description': 'If true, image will not be deletable.',: 'True': Provided object does not match schema 'image': 'True' is not of type 'boolean': Failed validating 'type' in schema['properties']['protected']: It seems that image creation fails because 'True' is not of type 'boolean' Am I looking at a bug or am I doing something wrong? I do have a great workaround: First, create the image without the protected flag. Then: $ openstack image set --protected myimage2 This works.
On 5/27/20 7:26 AM, Bernd Bausch wrote:
This problem occurs on a stable Ussuri Devstack. I issue this command to create a protected image:
$ openstack image create myimage2 --file ~/myvm1.qcow2 --disk-format qcow2 --protected
and get this error message back:
BadRequestException: 400: Client Error for url: http://192.168.1.200/image/v2/images, 400 Bad Request: On instance['protected']:: 'type': 'boolean'}: {'description': 'If true, image will not be deletable.',: 'True': Provided object does not match schema 'image': 'True' is not of type 'boolean': Failed validating 'type' in schema['properties']['protected']:
It seems that image creation fails because
'True' is not of type 'boolean'
'True' (capital T) is not a valid JSON boolean value, so if that's what's in the request JSON, it should fail schema validation.
Am I looking at a bug or am I doing something wrong?
Looks like a bug.
I do have a great workaround: First, create the image without the protected flag. Then:
$ openstack image set --protected myimage2
This works.
I suggest making both calls with the --debug option so you can compare the JSON being passed in the unsuccessful vs. the successful request. This will give you a better idea of whether the problem is client-side or server-side, and then you can file a bug with the appropriate project.
participants (2)
-
Bernd Bausch
-
Brian Rosmaita