Trying to reserve a static IP when no more IPs are available results in 503 Service Unavailable with no error text
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Julian Edwards |
Bug Description
I have a managed cluster interface with CIDR 192.168.122.0/24, configured to use DHCP and give IPs from the range 192.168.
No static IPs are reserved yet on that network. Then I run:
$ maas maas-user ipaddresses reserve network=
This works fine the first two times, as expected, and I get the following reservations:
$ maas maas-user ipaddresses read
[
{
"ip": "192.168.122.100",
"created": "2014-10-
},
{
"ip": "192.168.122.101",
"created": "2014-10-
}
]
However, running "reserve" again results in 503 Service Unavailable (only visible when run with --debug):
$ maas maas-user ipaddresses reserve network=
503 SERVICE UNAVAILABLE
Connection: close
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Date: Fri, 31 Oct 2014 09:50:07 GMT
Server: Apache/2.4.7 (Ubuntu)
Status: 503
Vary: Cookie
X-Frame-Options: SAMEORIGIN
No error is given without --debug:
$ maas maas-user ipaddresses reserve network=
This is not helpful, I'd expect so see an error like "No more static IPs are available for 192.168.122.0/24" or "Static range exhausted", etc.
There are no errors in the MAAS logs, no tracebacks, as if nothing happened. Only the apache2 access.log shows the 503 error, but no more details. It would've been nicer to have an error in the maas.log saying "Cannot reserve static IP for user maas-user..." or something similar.
---------
$ dpkg -l '*maas*'|cat
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii maas 1.7.0~beta7+
ii maas-cli 1.7.0~beta7+
ii maas-cluster-
ii maas-common 1.7.0~beta7+
ii maas-dhcp 1.7.0~beta7+
ii maas-dns 1.7.0~beta7+
ii maas-proxy 1.7.0~beta7+
ii maas-region-
ii maas-region-
ii python-django-maas 1.7.0~beta7+
ii python-maas-client 1.7.0~beta7+
ii python-
Related branches
- Graham Binns (community): Approve
-
Diff: 32 lines (+7/-2)2 files modifiedsrc/maasserver/models/staticipaddress.py (+3/-1)
src/maasserver/models/tests/test_staticipaddress.py (+4/-1)
Changed in maas: | |
assignee: | nobody → Julian Edwards (julian-edwards) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Thanks, we plan on handling this situation better. There are quite a few bugs related to IP exhaustion that we have there, so this might end up as an eventual dupe.