[2.2, trunk, UI] Unable to change device IP because 'subnet' is listed incorrectly on 'edit'.

Bug #1669213 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
LaMont Jones

Bug Description

I was trying to update the IP I gave to a device, and while doing so via the WebUI, I was unable to and no error was surfaced.

1. I added a device with IP 10.90.90.2.
2. I went to the device details page, interface section. And it lists:

MAC IP Assignment Subnet IP Address
aa:bb:cc:dd:ee:ff Static 10.90.90.0/24 10.90.90.2

3. I click on the interface to 'edit' it, and the following shows:
IP Assignment: Static
Subnet: 192.168.1.0/24
IP Address: 10.90.90.2

4. Obviously, I didn't notice that the 'Subnet' was automatically changed on edit, which caused the following error while trying to save. (I'll file a different bug for the lack of error surface).

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 824, in worker
    return target()
  File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 246, in inContext
    result = inContext.theWork()
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 857, in callInContext
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 225, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 685, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 503, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/device.py", line 350, in update_interface
    self._configure_interface(interface, params)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/device.py", line 303, in _configure_interface
    INTERFACE_LINK_TYPE.STATIC, subnet, ip_address=ip_address)
  File "/usr/lib/python3/dist-packages/maasserver/models/interface.py", line 956, in link_subnet
    alloc_type=alloc_type, user=user)
  File "/usr/lib/python3/dist-packages/maasserver/models/interface.py", line 879, in _link_subnet_static
    "IP address is not in the given subnet '%s'." % subnet)
maasserver.exceptions.StaticIPAddressOutOfRange: IP address is not in the given subnet '192.168.1.0/24:192.168.1.0/24(vid=0)'.

Related branches

summary: - [2.2, trunk] Changing the IP of a device results in error
+ [2.2, trunk] Unable to change device IP because 'subnet' is listed
+ incorrectly on 'edit'.
description: updated
description: updated
Changed in maas:
status: New → Triaged
importance: Undecided → High
assignee: nobody → LaMont Jones (lamont)
milestone: none → 2.2.0
summary: - [2.2, trunk] Unable to change device IP because 'subnet' is listed
+ [2.2, trunk, UI] Unable to change device IP because 'subnet' is listed
incorrectly on 'edit'.
Changed in maas:
status: Triaged → 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.