Cinder API response with code 500 when creating a new volume when quota is exceeded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello.
On Queens I receive a code 500 response from the cinder API when I try to create a new volume when the quota for the project is already exceeded:
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
I can nail down the ERROR from the logs:
- Quota exceeded for xxx, tried to create volume (50 volumes already consumed).: OverQuota: Quota exceeded for resources: ['volumes']
- Task 'cinder.
- Task 'cinder.
- Task 'cinder.
- Flow 'volume_create_api' (...) transitioned into state 'REVERTED' from state 'RUNNING'
- ERROR cinder.
What I see also after the Error is another WARNING which probably is related to https:/
- WARNING py.warnings [...] /var/lib/
- INFO cinder.
Of course there are a plenty of other DEBUG and INFO messages but they don't look interesting.
I read in some other bug reports of other projects that this seems to be a "general" exception handler, e.g. here: https:/
The question here is if quota exceeded actions raise such an code 500 error with that general exception or if it is something specific on my side. I think the expected behaviour would another response code, e.g. 4xx.
Best regards, Ron
Hi Ron,
Cinder currently (on master/stein) returns 413[1] status when we exceed the quota limit[2].
It was implemented by the commit [3], and the code exists in queens too.
The exception called are here[4]. Could you please check again?
[1] https:/ /github. com/openstack/ cinder/ blob/master/ cinder/ exception. py#L627 /github. com/openstack/ cinder/ blob/master/ cinder/ exception. py#L632 /github. com/openstack/ cinder/ commit/ 87c5749a3fe88e4 2277c3dcf631b51 0a45995935# diff-568ee7fd30 2847948453bea53 c42c72f /github. com/openstack/ cinder/ blob/master/ cinder/ quota_utils. py#L245- L248
[2] https:/
[3] https:/
[4] https:/