Issue with Device Recovery in Latest OpenWISP2 – Possible Bug

8 views
Skip to first unread message

Logunath K

unread,
Jul 31, 2025, 7:05:32 AMJul 31
to open...@googlegroups.com
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.
image.png

Version am using openwisp2: 
image.png
Regards,
logu

Federico Capoano

unread,
Aug 1, 2025, 12:45:07 PMAug 1
to open...@googlegroups.com
From what you wrote it doesn't look too worrying.
It looks like it originated from the firmware-upgrader module in "auto_add_device_firmware_to_device".
If you find a way to replicate it consistently in a development environment based on the firmware-upgrader module you're welcome to open a bug report, find the instructions for setting it up here: https://openwisp.io/docs/dev/firmware-upgrader/developer/installation.html

Best regards
Federico Capoano
OpenWISP OÜ
Kotkapoja tn 2a-10, 10615, Harju maakond, Tallinn, Estonia
VAT: EE101989729


--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/openwisp/CAJy2ivrQQcfdLAWRqk-UOOdKmeukC5cEMOOreeGwe6MxogjgDQ%40mail.gmail.com.

Logunath K

unread,
Aug 8, 2025, 12:26:49 AMAug 8
to open...@googlegroups.com
Hi,
     Thanks for the instructions. I'll work on replicating the error in the development environment and will open a bug report if I succeed.

Regards,
logu


Reply all
Reply to author
Forward
0 new messages