Failed to save static IP for device

Bug #2065482 reported by maasuser1

This bug report will be marked for expiration in 58 days if no further activity occurs. (find out why)

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Incomplete
Undecided
Unassigned

Bug Description

MAAS 3.4/Stable 3.4.2-14353-g.5a5221d57
```
2024-05-11 12:06:54 maasserver.websockets.protocol: [critical] Error on request (596) device.update_interface: {"numa_node": ["Only interfaces for machines are linked to a NUMA node"]}
        Traceback (most recent call last):
          File "/usr/lib/python3.10/threading.py", line 953, in run
            self._target(*self._args, **self._kwargs)
          File "/snap/maas/35359/lib/python3.10/site-packages/provisioningserver/utils/twisted.py", line 821, in worker
            return target()
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 47, in work
            task()
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 182, in doWork
            task()
        --- <exception caught here> ---
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 244, in inContext
            result = inContext.theWork() # type: ignore[attr-defined]
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 260, in <lambda>
            inContext.theWork = lambda: context.call( # type: ignore[attr-defined]
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/python/context.py", line 117, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/snap/maas/35359/usr/lib/python3/dist-packages/twisted/python/context.py", line 82, in callWithContext
            return func(*args, **kw)
          File "/snap/maas/35359/lib/python3.10/site-packages/provisioningserver/utils/twisted.py", line 856, in callInContext
            return func(*args, **kwargs)
          File "/snap/maas/35359/lib/python3.10/site-packages/provisioningserver/utils/twisted.py", line 203, in wrapper
            result = func(*args, **kwargs)
          File "/snap/maas/35359/lib/python3.10/site-packages/maasserver/utils/orm.py", line 771, in call_within_transaction
            return func_outside_txn(*args, **kwargs)
          File "/snap/maas/35359/lib/python3.10/site-packages/maasserver/utils/orm.py", line 574, in retrier
            return func(*args, **kwargs)
          File "/usr/lib/python3.10/contextlib.py", line 79, in inner
            return func(*args, **kwds)
          File "/snap/maas/35359/lib/python3.10/site-packages/maasserver/websockets/base.py", line 437, in prep_user_execute
            return self._call_method_track_queries(
          File "/snap/maas/35359/lib/python3.10/site-packages/maasserver/websockets/base.py", line 461, in _call_method_track_queries
            result = method(params)
          File "/snap/maas/35359/lib/python3.10/site-packages/maasserver/websockets/handlers/device.py", line 357, in update_interface
            raise ValidationError(form.errors)
        django.core.exceptions.ValidationError: {'numa_node': ['Only interfaces for machines are linked to a NUMA node']}
```

Revision history for this message
maasuser1 (maasuser1) wrote :
description: updated
Revision history for this message
Anton Troyanov (troyanov) wrote :

Hi maasuser1!

Can you tell us a little more about this problem?
Under what circumstances does this happen and how can it be reproduced?

Changed in maas:
status: New → Incomplete
Revision history for this message
maasuser1 (maasuser1) wrote (last edit ):

Hi Anton,

So I have one "Device" (not machine) with "Dynamic" as its "IP assignment" settings. I wanna change this option to be "Static", with a static IP address from the pool "192.168.0.0/24".

Revision history for this message
Anton Troyanov (troyanov) wrote :

Hm, I cannot reproduce it.

What I did:

1. Add device with a static IP
2. Clicked "Edit physical"
3. Changed IP assignment to "Static" and provided IP from the pool

Revision history for this message
Anton Troyanov (troyanov) wrote :
Revision history for this message
Anton Troyanov (troyanov) wrote :
Revision history for this message
Anton Troyanov (troyanov) wrote :
Revision history for this message
Anton Troyanov (troyanov) wrote :
Changed in maas:
status: Incomplete → New
status: New → Incomplete
Revision history for this message
maasuser1 (maasuser1) wrote :

Please find the attached file. thanks

Revision history for this message
Anton Troyanov (troyanov) wrote :

Huh, thats interesting. Thanks for the GIF.
I wonder what is the different between your setup and my..

I can see only one place that can return this error:

```
def clean_numa_node(self):
    index = self.cleaned_data["numa_node"]
    if not (self.node.is_machine or self.node.is_rack_controller):
        if index is None:
            return None
        raise ValidationError(
            "Only interfaces for machines are linked to a NUMA node"
        )
     if index is None:
        index = self.instance.numa_node.index if self.is_update else 0
     try:
        self.cleaned_data["numa_node"] = self.node.numanode_set.get(
            index=index
        )
    except NUMANode.DoesNotExist:
        raise ValidationError("Invalid NUMA node")
    return self.cleaned_data["numa_node"]
```

Revision history for this message
Anton Troyanov (troyanov) wrote :

maasuser1, can you capture the message that is being sent when you submit the web form?

The simplest way would be to use Google Chrome:
1. Open network tab
2. Reload the page
3. Make sure to select WS (wbsocket)
...

Changed in maas:
status: Incomplete → New
status: New → Incomplete
Revision history for this message
maasuser1 (maasuser1) wrote (last edit ):

```json
{
  "method": "device.update_interface",
  "type": 0,
  "params": {
    "ip_address": "192.168.0.5",
    "ip_assignment": "static",
    "mac_address": "64:66:b3:b0:ec:a0",
    "name": "eth0",
    "subnet": "1",
    "tags": [],
    "interface_id": 272,
    "system_id": "nrsrhp"
  },
  "request_id": 16
}
```

```json
{
  "type": 1,
  "request_id": 16,
  "rtype": 1,
  "error": "{\"numa_node\": [\"Only interfaces for machines are linked to a NUMA node\"]}"
}
```

Revision history for this message
Jacopo Rota (r00ta) wrote :

Hi @maasuser1, could you please run the following query and paste here the result please?

select * from maasserver_node
join maasserver_config on maasserver_node.current_config_id=maasserver_config.id
join maasserver_interface on maasserver_interface.node_config_id=maasserver_config.id
where maasserver_node.system_id='nrsrhp';

Revision history for this message
maasuser1 (maasuser1) wrote (last edit ):

```csv
id,created,updated,system_id,hostname,status,bios_boot_method,osystem,distro_series,architecture,min_hwe_kernel,hwe_kernel,agent_name,error_description,cpu_count,memory,swap_size,power_state,power_state_updated,error,netboot,license_key,boot_cluster_ip,enable_ssh,skip_networking,skip_storage,boot_interface_id,gateway_link_ipv4_id,gateway_link_ipv6_id,owner_id,parent_id,zone_id,boot_disk_id,node_type,domain_id,dns_process_id,bmc_id,address_ttl,status_expires,power_state_queried,url,managing_process_id,last_image_sync,previous_status,default_user,cpu_speed,current_commissioning_script_set_id,current_installation_script_set_id,current_testing_script_set_id,install_rackd,locked,pool_id,instance_power_parameters,install_kvm,hardware_uuid,ephemeral_deploy,description,dynamic,register_vmhost,last_applied_storage_layout,current_config_id,enable_hw_sync,last_sync,sync_interval,id,name,value,id,created,updated,name,type,mac_address,params,tags,enabled,vlan_id,acquired,mdns_discovery_state,neighbour_discovery_state,firmware_version,product,vendor,interface_speed,link_connected,link_speed,numa_node_id,sriov_max_vf,node_config_id
84,2023-12-13 21:22:17.165433 +00:00,2023-12-13 21:22:17.165433 +00:00,nrsrhp,RIPEAtlasProbe,0,,"","",,,,"","",0,0,,unknown,,"",true,,,false,false,false,,,,19,,1,,1,0,,,,,,"",,,0,"",0,,,,false,false,,"""""",false,,false,"",false,false,"",15,false,,,15,enable_http_proxy,true,272,2023-12-13 21:22:17.219398 +00:00,2023-12-13 21:23:40.874226 +00:00,eth0,physical,64:66:b3:b0:ec:a0,{},"",true,5001,false,false,false,,,,0,true,0,9,0,15

```

Revision history for this message
Jacopo Rota (r00ta) wrote :

Thanks, for better readability

id: 84
created: 2023-12-13 21:22:17.165433 +00:00
updated: 2023-12-13 21:22:17.165433 +00:00
system_id: nrsrhp
hostname: RIPEAtlasProbe
status: 0
bios_boot_method:
osystem: ""
distro_series: ""
architecture:
min_hwe_kernel:
hwe_kernel:
agent_name: ""
error_description: ""
cpu_count: 0
memory: 0
swap_size:
power_state: unknown
power_state_updated:
error: ""
netboot: true
license_key:
boot_cluster_ip:
enable_ssh: false
skip_networking: false
skip_storage: false
boot_interface_id:
gateway_link_ipv4_id:
gateway_link_ipv6_id:
owner_id: 19
parent_id:
zone_id: 1
boot_disk_id:
node_type: 1
domain_id: 0
dns_process_id:
bmc_id:
address_ttl:
status_expires:
power_state_queried:
url: ""
managing_process_id:
last_image_sync:
previous_status: 0
default_user: ""
cpu_speed: 0
current_commissioning_script_set_id:
current_installation_script_set_id:
current_testing_script_set_id:
install_rackd: false
locked: false
pool_id:
instance_power_parameters: ""
install_kvm: ""
hardware_uuid: false
ephemeral_deploy:
description: false
dynamic: ""
register_vmhost: false
last_applied_storage_layout: false
current_config_id: ""
enable_hw_sync: 15
last_sync: false
sync_interval:
current_release_script_set_id:
id: 15
name: enable_http_proxy
value: true
id: 272
created: 2023-12-13 21:22:17.219398 +00:00
updated: 2023-12-13 21:23:40.874226 +00:00
name: eth0
type: physical
mac_address: 64:66:b3:b0:ec:a0
params: {}
tags: ""
enabled: true
vlan_id: 5001
acquired: false
mdns_discovery_state: false
neighbour_discovery_state: false
firmware_version:
product:
vendor:
interface_speed: 0
link_connected: true
link_speed: 0
numa_node_id: 9
sriov_max_vf: 0
node_config_id: 15

Could you please also report

```
select * from maasserver_numanode;
```
?

Revision history for this message
maasuser1 (maasuser1) wrote :
Download full text (5.5 KiB)

Thanks!

```csv
id,created,updated,index,memory,cores,node_id
2,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",76
4,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",46
5,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",61
8,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,8192,"{0,1,2,3}",37
9,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",84
11,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",82
34,2023-12-13 22:21:53.585356 +00:00,2024-05-09 17:06:58.208747 +00:00,0,3584,"{0,1,2,3}",47
24,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",64
37,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,0,"",63
64,2024-01-12 14:56:45.041890 +00:00,2024-05-22 13:15:28.801409 +00:00,0,40704,"{0,1,2,3,4,5}",111
43,2023-12-13 22:21:53.585356 +00:00,2023-12-13 22:21:53.585356 +00:00,0,73728,"{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}",59
49,2023-12-15 17:20:01.072264 +00:00,2023-12-21 14:55:28.842782 +00:00,0,12288,"{0,1}",95
23,2023-12-13 22:21:53.585356 +00:00,2023-12-14 12:44:46.305658 +00:00,0,31753,"{0,8,1,9,10,2,11,3,12,4,13,5,14,6,15,7}",86
72,2024-02-02 15:09:00.098302 +00:00,2024-05-09 17:11:01.118711 +00:00,0,3584,"{0,1,2,3}",126
44,2023-12-13 22:21:53.585356 +00:00,2024-05-09 17:02:20.355816 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",28
50,2023-12-15 18:31:58.825916 +00:00,2023-12-21 15:43:08.648719 +00:00,0,8192,"{0,4,1,5,2,6,3,7}",96
21,2023-12-13 22:21:53.585356 +00:00,2024-05-10 07:54:41.622960 +00:00,0,32768,"{0,1,2,3}",83
41,2023-12-13 22:21:53.585356 +00:00,2024-05-09 17:06:08.697995 +00:00,0,3584,"{0,1,2,3}",48
12,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:47:04.718864 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",21
28,2023-12-13 22:21:53.585356 +00:00,2024-05-16 13:47:24.912848 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",1
59,2024-01-12 14:54:51.420462 +00:00,2024-05-22 13:15:34.914166 +00:00,0,40704,"{0,1,2,3,4,5}",108
71,2024-02-01 17:22:42.636666 +00:00,2024-05-22 13:15:39.547014 +00:00,0,32768,"{0,4,1,5,2,6,3,7}",125
42,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:43:15.202149 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",10
68,2024-01-25 16:23:28.930175 +00:00,2024-02-02 17:33:01.851703 +00:00,0,65536,"{0,32,1,33,2,34,3,35,36,4,37,5,38,6,39,7,40,8,41,9,10,42,11,43,12,44,13,45,14,46,15,47}",123
31,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:47:08.423398 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",18
39,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:31:20.034894 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",34
20,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:46:50.124170 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",15
33,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:53:46.439521 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",17
14,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:46:59.598732 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",19
73,2024-02-05 15:38:36.255015 +00:00,2024-02-05 16:17:36.426006 +00:00,0,32768,"{0,2,4,6,1,3,5,7}",127
18,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:47:09.857090 +00:00,0,16384,"{0,4,1,5,2,6,3,7}",20
30,2023-12-13 22:21:53.585356 +00:00,2024-05-09 16:31:39.777504 +00:00,0,1...

Read more...

Revision history for this message
Jacopo Rota (r00ta) wrote :

Can you tell us more about this device? What's its history? How did you add it to MAAS and did you take any operation on it?

It is very strange that the interface was

created: 2023-12-13 21:22:17.219398 +00:00
updated: 2023-12-13 21:23:40.874226 +00:00

and the related numa node

created: 2023-12-13 22:21:53.585356 +00:00
updated: 2023-12-13 22:21:53.585356 +00:00

And I don't quite get how it's possible that the numa node was created AFTER the interface was updated for the last time

Revision history for this message
maasuser1 (maasuser1) wrote :

It is just an TP-link router as shown in this article.

https://labs.ripe.net/author/kistel/ripe-atlas-probes-as-iot-devices/

I only added its mac address as a device, so that we could see its IP address. I have no idea why NUMA node was created from this device.

Revision history for this message
Jacopo Rota (r00ta) wrote (last edit ):

unfortunately without additional info we can't really reproduce this. The workaround for you (take a snapshot of the DB anyways, just in case) is to reset the linked numa node to NULL with

```
update maasserver_interface set numa_node_id=null where id = 272;
```

and ideally inspect a bit if that numa node is linked also somewhere else and then remove it. I'm keeping this bug as incomplete, but if you experience this again feel free to re-open and provide all the regiond logs

Revision history for this message
Jacopo Rota (r00ta) wrote :

Or well, probably the cleanest solution is to delete and add again the device

Revision history for this message
maasuser1 (maasuser1) wrote :

Thank you Jacopo. Issue has been resolved by delete and re-create the device.

Changed in maas:
status: Incomplete → New
status: New → Incomplete
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.