I reproduced with a brand new USB to ethernet adapter:
2023-03-28 07:42:12,315 DEBUG root:37 start: subiquity/Network/_send_update: DEL enx00e04c680717
2023-03-28 07:42:12,315 DEBUG subiquity.server.controllers.network:355 dev_info enx00e04c680717 {'dhcp4': True}
2023-03-28 07:42:12,315 ERROR root:37 finish: subiquity/Network/_send_update: FAIL: 'NoneType' object has no attribute 'is_connected'
2023-03-28 07:42:12,315 ERROR subiquity.server.server:422 top level error
Traceback (most recent call last):
File "/snap/subiquity/4542/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/snap/subiquity/4542/lib/python3.10/site-packages/subiquitycore/controllers/network.py", line 215, in _data_ready
self.observer.data_ready(fd)
File "/snap/subiquity/4542/lib/python3.10/site-packages/probert/network.py", line 667, in data_ready
with CoalescedCalls(self):
File "/snap/subiquity/4542/usr/lib/python3.10/contextlib.py", line 142, in __exit__
next(self.gen)
File "/snap/subiquity/4542/lib/python3.10/site-packages/probert/network.py", line 630, in CoalescedCalls
meth(obj, action, data)
File "/snap/subiquity/4542/lib/python3.10/site-packages/probert/network.py", line 680, in link_change
self.receiver.del_link(ifindex)
File "/snap/subiquity/4542/lib/python3.10/site-packages/subiquitycore/controllers/network.py", line 72, in del_link
self.controller.del_link(netdev)
File "/snap/subiquity/4542/lib/python3.10/site-packages/subiquity/server/controllers/network.py", line 379, in del_link
self._send_update(LinkAction.DEL, dev)
File "/snap/subiquity/4542/lib/python3.10/site-packages/subiquity/server/controllers/network.py", line 356, in _send_update
dev_info = dev.netdev_info()
File "/snap/subiquity/4542/lib/python3.10/site-packages/subiquitycore/models/network.py", line 201, in netdev_info
is_connected = bool(self.info.is_connected)
AttributeError: 'NoneType' object has no attribute 'is_connected'
2023-03-28 07:42:12,320 DEBUG subiquity.common.errorreport:384 generating crash report
2023-03-28 07:42:12,320 INFO subiquity.common.errorreport:406 saving crash report 'unknown error crashed with AttributeError' to /var/crash/1679989332.320252895.unknown.crash
When a link disappears, SubiquityNetworkEventReceiver.del_link() calls model.del_link() which sets dev.info to None. Then, the code flows to NetworkController.del_link() which expects dev.info not to be None.
This feels wrong and I suspect the bug could occur without the adapter being disconnected.
I reproduced with a brand new USB to ethernet adapter:
2023-03-28 07:42:12,315 DEBUG root:37 start: subiquity/ Network/ _send_update: DEL enx00e04c680717 server. controllers. network: 355 dev_info enx00e04c680717 {'dhcp4': True} Network/ _send_update: FAIL: 'NoneType' object has no attribute 'is_connected' server. server: 422 top level error subiquity/ 4542/usr/ lib/python3. 10/asyncio/ events. py", line 80, in _run _context. run(self. _callback, *self._args) subiquity/ 4542/lib/ python3. 10/site- packages/ subiquitycore/ controllers/ network. py", line 215, in _data_ready observer. data_ready( fd) subiquity/ 4542/lib/ python3. 10/site- packages/ probert/ network. py", line 667, in data_ready self): subiquity/ 4542/usr/ lib/python3. 10/contextlib. py", line 142, in __exit__ subiquity/ 4542/lib/ python3. 10/site- packages/ probert/ network. py", line 630, in CoalescedCalls subiquity/ 4542/lib/ python3. 10/site- packages/ probert/ network. py", line 680, in link_change receiver. del_link( ifindex) subiquity/ 4542/lib/ python3. 10/site- packages/ subiquitycore/ controllers/ network. py", line 72, in del_link controller. del_link( netdev) subiquity/ 4542/lib/ python3. 10/site- packages/ subiquity/ server/ controllers/ network. py", line 379, in del_link _send_update( LinkAction. DEL, dev) subiquity/ 4542/lib/ python3. 10/site- packages/ subiquity/ server/ controllers/ network. py", line 356, in _send_update subiquity/ 4542/lib/ python3. 10/site- packages/ subiquitycore/ models/ network. py", line 201, in netdev_info info.is_ connected) common. errorreport: 384 generating crash report common. errorreport: 406 saving crash report 'unknown error crashed with AttributeError' to /var/crash/ 1679989332. 320252895. unknown. crash
2023-03-28 07:42:12,315 DEBUG subiquity.
2023-03-28 07:42:12,315 ERROR root:37 finish: subiquity/
2023-03-28 07:42:12,315 ERROR subiquity.
Traceback (most recent call last):
File "/snap/
self.
File "/snap/
self.
File "/snap/
with CoalescedCalls(
File "/snap/
next(self.gen)
File "/snap/
meth(obj, action, data)
File "/snap/
self.
File "/snap/
self.
File "/snap/
self.
File "/snap/
dev_info = dev.netdev_info()
File "/snap/
is_connected = bool(self.
AttributeError: 'NoneType' object has no attribute 'is_connected'
2023-03-28 07:42:12,320 DEBUG subiquity.
2023-03-28 07:42:12,320 INFO subiquity.
When a link disappears, SubiquityNetwor kEventReceiver. del_link( ) calls model.del_link() which sets dev.info to None. Then, the code flows to NetworkControll er.del_ link() which expects dev.info not to be None.
This feels wrong and I suspect the bug could occur without the adapter being disconnected.