Trying to reserve a static IP when no more IPs are available results in 503 Service Unavailable with no error text

Bug #1388033 reported by Dimiter Naydenov
6
This bug affects 1 person
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.122.10-192.168.122.99 and a static range 192.168.122.100-192.168.122.101 (for testing the case below).

No static IPs are reserved yet on that network. Then I run:
$ maas maas-user ipaddresses reserve network=192.168.122.0/24

This works fine the first two times, as expected, and I get the following reservations:
$ maas maas-user ipaddresses read
[
    {
        "alloc_type": 4,
        "ip": "192.168.122.100",
        "resource_uri": "/MAAS/api/1.0/ipaddresses/",
        "created": "2014-10-31T11:49:58.699"
    },
    {
        "alloc_type": 4,
        "ip": "192.168.122.101",
        "resource_uri": "/MAAS/api/1.0/ipaddresses/",
        "created": "2014-10-31T11:50:03.853"
    }
]

However, running "reserve" again results in 503 Service Unavailable (only visible when run with --debug):
$ maas maas-user ipaddresses reserve network=192.168.122.0/24 -d
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=192.168.122.0/24

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=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================================-====================================-============-===============================================================================
ii maas 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server all-in-one metapackage
ii maas-cli 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS command line API tool
ii maas-cluster-controller 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server cluster controller
ii maas-common 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server common files
ii maas-dhcp 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS DHCP server
ii maas-dns 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS DNS server
ii maas-proxy 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS Caching Proxy
ii maas-region-controller 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server complete region controller
ii maas-region-controller-min 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS Server minimum region controller
ii python-django-maas 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server Django web framework
ii python-maas-client 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS python API client
ii python-maas-provisioningserver 1.7.0~beta7+bzr3266-0ubuntu1~trusty1 all MAAS server provisioning libraries

Tags: trivial

Related branches

Revision history for this message
Christian Reis (kiko) wrote :

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.

Changed in maas:
milestone: none → 1.7.1
Revision history for this message
Julian Edwards (julian-edwards) wrote :

They're not dupes Kiko, all the others are referring to the DHCP-issued dynamic IPs AFAICT.

summary: Trying to reserve a static IP when no more IPs are available results in
- 503 Service Unavailable
+ 503 Service Unavailable with no error text
Changed in maas:
status: New → Triaged
importance: Undecided → High
tags: added: trivial
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.