Hi team,
I would like to report a potential issue I encountered while using the latest version of the OpenWISP2 application. Below are the steps I followed and the observations:
1. I registered a device and it was working correctly.
2. I deactivated the device using the dropdown list and waited until the device status updated to "Deactivated".
3. After that, I deleted the device.
4. Later, I used the “Recover Deleted Devices” option in the OpenWISP2 application to restore the device.
Issue Observed:
After recovery, the device came back online and appeared to be working.However, in the OpenWISP2 logs, I noticed an error (screenshot attached). It seems some device data was lost during this process.
Could you please confirm whether this is a known bug or an expected behavior? Also, I would appreciate any guidance on how to prevent this issue or resolve it properly.
Path: /opt/openwisp2/log/openwisp2.log
Note: Error(Traceback (most recent call last):
File "/opt/openwisp2/env/lib/python3.10/site-packages/reversion/models.py", line 34, in _safe_revert
version.revert()
File "/opt/openwisp2/env/lib/python3.10/site-packages/reversion/models.py", line 329, in revert
self._object_version.save(using=self.db)
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/core/serializers/base.py", line 288, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/db/models/base.py", line 892, in save_base
post_save.send(
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
(receiver, receiver(signal=self, sender=sender, **named))
File "/opt/openwisp2/env/lib/python3.10/site-packages/openwisp_firmware_upgrader/base/models.py", line 391, in auto_add_device_firmware_to_device
if not instance.device.os or not instance.device.model:
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py", line 236, in __get__
rel_obj = self.get_object(instance)
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py", line 199, in get_object
return qs.get(self.field.get_reverse_related_filter(instance))
File "/opt/openwisp2/env/lib/python3.10/site-packages/django/db/models/query.py", line 637, in get
raise self.model.DoesNotExist(
openwisp_controller.config.models.Device.DoesNotExist: Device matching query does not exist.
)
Please find the screenshot of the log error attached for your reference.

Version am using openwisp2:

Regards,
logu