Can't add DHCP reserved range via UI

Bug #1859630 reported by Alberto Donato on 2020-01-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Caleb Ellis

Bug Description

On a subnet configuration page, when I try to add a DHCP reserved range, nothing happens when clicking "Reserve"

The console shows the following error:

maas.3f4f187….bundle.js:26 TypeError: Cannot read property 'start_ip' of null
    at maas.3f4f187….bundle.js:98
    at Object.S [as forEach] (maas.3f4f187….bundle.js:26)
    at t.saveForm (maas.3f4f187….bundle.js:98)
    at maas.3f4f187….bundle.js:98
    at c.$eval (maas.3f4f187….bundle.js:26)
    at c.$apply (maas.3f4f187….bundle.js:26)
    at HTMLButtonElement.<anonymous> (maas.3f4f187….bundle.js:98)
    at HTMLButtonElement.dispatch (maas.3f4f187….bundle.js:50)
    at HTMLButtonElement.m.handle (maas.3f4f187….bundle.js:50)

Tags: ui Edit Tag help
Caleb Ellis (caleb-ellis) wrote :

Is this happening with every subnet? I've just tested a few on karura and it's able to reserve them properly.

I just tried on another subnet, i get the same behavior

On Tue, Jan 14, 2020 at 4:00 PM Caleb Ellis <email address hidden>
wrote:

> Is this happening with every subnet? I've just tested a few on karura
> and it's able to reserve them properly.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1859630
>
> Title:
> Can't add DHCP reserved range via UI
>
> Status in MAAS:
> New
>
> Bug description:
> On a subnet configuration page, when I try to add a DHCP reserved
> range, nothing happens when clicking "Reserve"
>
> The console shows the following error:
>
> maas.3f4f187….bundle.js:26 TypeError: Cannot read property 'start_ip' of
> null
> at maas.3f4f187….bundle.js:98
> at Object.S [as forEach] (maas.3f4f187….bundle.js:26)
> at t.saveForm (maas.3f4f187….bundle.js:98)
> at maas.3f4f187….bundle.js:98
> at c.$eval (maas.3f4f187….bundle.js:26)
> at c.$apply (maas.3f4f187….bundle.js:26)
> at HTMLButtonElement.<anonymous> (maas.3f4f187….bundle.js:98)
> at HTMLButtonElement.dispatch (maas.3f4f187….bundle.js:50)
> at HTMLButtonElement.m.handle (maas.3f4f187….bundle.js:50)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maas/+bug/1859630/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=maas; milestone=2.7.0rc2; status=New;
> importance=Undecided; assignee=None;
> Launchpad-Bug-Tags: ui
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: ack caleb-ellis
> Launchpad-Bug-Reporter: Alberto Donato (ack)
> Launchpad-Bug-Modifier: Caleb Ellis (caleb-ellis)
> Launchpad-Message-Rationale: Subscriber
> Launchpad-Message-For: ack
>

--
Alberto Donato | <email address hidden>
https://launchpad.net/~ack | GPG: 2048R/9E2823B3

Changed in maas:
status: New → Triaged
importance: Undecided → High
Caleb Ellis (caleb-ellis) wrote :

Hmm I'm clearly missing something. Are you able to list the steps you take, and when the error appears? e.g.
- Click on Subnets in header
- Click on a subnet
- Click Reserve range
- Enter IP address range
- Click save
- Error appears

And could you provide a pastebin of the subnet JSON?

Caleb Ellis (caleb-ellis) wrote :

Is iprange.create ever called on the websocket?

Alberto Donato (ack) wrote :

- Go to the "Subnets" page
- Click on the vlan link where maas is serving dhcp (in my setup is the untagged vlan for 172.16.99.0/24)
- In the "Reserved ranges" section, enter start and end IPs (valid IPs in the subnet for a subrange which is currently not used, in my case 172.16.99.100-172.16.99.110)
- Click "Reserve"
- nothing happens on the page, I can click the button multiple times

the console shows the error above, there's no websocket call being made for the iprange creation

This is the JSON for the subnet from the subnet.list call:

id: 4
created: "Thu, 09 Jan. 2020 15:36:58"
updated: "Mon, 13 Jan. 2020 14:58:20"
name: "172.16.99.0/24"
description: ""
vlan: 5002
cidr: "172.16.99.0/24"
rdns_mode: 2
gateway_ip: "172.16.99.254"
dns_servers: ""
allow_dns: true
allow_proxy: true
active_discovery: false
managed: true
statistics: {num_available: 188, largest_available: 188, num_unavailable: 66, total_addresses: 254,…}
num_available: 188
largest_available: 188
num_unavailable: 66
total_addresses: 254
usage: 0.25984251968503935
usage_string: "26%"
available_string: "74%"
first_address: "172.16.99.1"
last_address: "172.16.99.254"
ip_version: 4
ranges: [{start: "172.16.99.1", end: "172.16.99.1", num_addresses: 1, purpose: ["assigned-ip"]},…]
0: {start: "172.16.99.1", end: "172.16.99.1", num_addresses: 1, purpose: ["assigned-ip"]}
1: {start: "172.16.99.2", end: "172.16.99.189", num_addresses: 188, purpose: ["unused"]}
2: {start: "172.16.99.190", end: "172.16.99.253", num_addresses: 64, purpose: ["dynamic"]}
3: {start: "172.16.99.254", end: "172.16.99.254", num_addresses: 1, purpose: ["gateway-ip"]}
suggested_gateway: null
suggested_dynamic_range: null
version: 4
space: null

Caleb Ellis (caleb-ellis) wrote :

Fix here: https://github.com/canonical-web-and-design/maas-ui/pull/684

Turns out an incorrectly closed tag in the ipranges partial was automagically fixed when running in development, but not when built.

Changed in maas:
status: Triaged → In Progress
assignee: nobody → Caleb Ellis (caleb-ellis)
Changed in maas:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers