openwisp / openwisp-firmware-upgrader

Firmware upgrade solution for OpenWRT with possibility to add support for other embedded OSes. Provides features like automatic retry for network failures, mass upgrades, REST API and more.
https://openwisp.io/docs/dev/firmware-upgrader/
Other
53 stars 60 forks source link

FirmwareImageDetailView raised exception during schema generation #127

Open minhng99 opened 3 years ago

minhng99 commented 3 years ago

Hi, I'm getting these warning in the log after running for a while:

[WARNING 2021-03-11 11:55:14,460] module: base, process: 1329847, thread: 140595094034240
view's FirmwareImageDetailView raised exception during schema generation; use `getattr(self, 'swagger_fake_view', False)` to detect and short-circuit this
Traceback (most recent call last):
  File "/opt/openwisp2/env/lib/python3.8/site-packages/drf_yasg/inspectors/base.py", line 42, in call_view_method
    return view_method()
  File "/opt/openwisp2/env/lib/python3.8/site-packages/openwisp_firmware_upgrader/api/views.py", line 159, in get_queryset
    return super().get_queryset().filter(build=self.kwargs['build_pk'])
KeyError: 'build_pk'

[WARNING 2021-03-11 11:57:07,047] module: base, process: 1329845, thread: 140595094034240
view's NotificationReadAllView raised exception during schema generation; use `getattr(self, 'swagger_fake_view', False)` to detect and short-circuit this
Traceback (most recent call last):
  File "/opt/openwisp2/env/lib/python3.8/site-packages/drf_yasg/inspectors/base.py", line 42, in call_view_method
    return view_method()
  File "/opt/openwisp2/env/lib/python3.8/site-packages/rest_framework/generics.py", line 108, in get_serializer
    serializer_class = self.get_serializer_class()
  File "/opt/openwisp2/env/lib/python3.8/site-packages/rest_framework/generics.py", line 122, in get_serializer_class
    assert self.serializer_class is not None, (
AssertionError: 'NotificationReadAllView' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.

[WARNING 2021-03-11 11:57:07,070] module: base, process: 1329845, thread: 140595094034240
view's NotificationReadRedirect raised exception during schema generation; use `getattr(self, 'swagger_fake_view', False)` to detect and short-circuit this
Traceback (most recent call last):
  File "/opt/openwisp2/env/lib/python3.8/site-packages/drf_yasg/inspectors/base.py", line 42, in call_view_method
    return view_method()
  File "/opt/openwisp2/env/lib/python3.8/site-packages/rest_framework/generics.py", line 108, in get_serializer
    serializer_class = self.get_serializer_class()
  File "/opt/openwisp2/env/lib/python3.8/site-packages/rest_framework/generics.py", line 122, in get_serializer_class
    assert self.serializer_class is not None, (
AssertionError: 'NotificationReadRedirect' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.

OS: Ubuntu 20.04.2

eleensmathew commented 2 years ago

Hi can i work on this? I don't have experience working on a project like this so please guide me.

SonakshiChauhan commented 1 year ago

Hi I would like to work on this durinh hacktober fest. Please assign it to me @minhng99

Vihar214 commented 1 year ago

Hello, Is there anyone working on this issue if not then can you assign this issue to Me?

tspare commented 1 year ago

I tried to reproduce this but I think the issue is nolonger there. I see: HTTP GET /api/v1/firmware-upgrader/build/216caba4-cbf0-485e-8d34-be87a1c32675/image/feb0ca62-536d-4fa4-9acf-f78353a6376c/ 200 [0.04, 127.0.0.1:48468] And no traceback in the console where django is running. Should I be looking somewhere else?