Undefined symbol in source
Deployment Type
Self-hosted
NetBox Version
v3.7.2
Python Version
3.10
Steps to Reproduce
❯ ruff check | grep F821
core/api/schema.py:139:79: F821 Undefined name serializers
Expected Behavior
add the required import in file schema.py
Observed Behavior
missing import
my bad it's actually VERSION = '3.7.3-dev'
Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.
Oh, it is just an undefined symbol in the python code. If execution reaches there, the app will crash. All the details are included in the issue. I found it very easily, just run RUFF !
François
Le mar. 13 févr. 2024 à 16:25, Jeremy Stretch @.***> a écrit :
This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.
— Reply to this email directly, view it on GitHub https://github.com/netbox-community/netbox/issues/15058#issuecomment-1941777666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATJUWHDYOREY2R2IFJRGYDYTOAYFAVCNFSM6AAAAABC4APXGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBRG43TONRWGY . You are receiving this because you authored the thread.Message ID: @.***>
It's not undefined. Are you by any chance running a forked version of netbox where you have made changes?
It is definitely undefined.
The undefined symbol is serializers with final s, not serializer !!!
To reproduce, just follow these steps (as described in the issue but I reproduce it here) :
- Download the current zip from the github repo, then unzip it
- cd netbox-develop/netbox
- pip install ruff
- ruff check | grep F821 --> core/api/schema.py:139:79: F821 Undefined name serializers
or open core/api/schema.py in a smart editor (I use pycharm)
I guess that this undefined symbol went unnoticed because it is hidden behind an 'and' in a case that is never unit tested.
Let me know, François
Le mar. 13 févr. 2024 à 21:32, Abhimanyu Saharan @.***> a écrit :
It's not undefined. Are you by any chance running a forked version of netbox where you have made changes?
image.png (view on web) https://github.com/netbox-community/netbox/assets/5083532/0f366bf9-f6aa-4560-b386-6a37b93e281d
— Reply to this email directly, view it on GitHub https://github.com/netbox-community/netbox/issues/15058#issuecomment-1942424679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATJUWA3S7X7EHQBJ5P4X3LYTPEWDAVCNFSM6AAAAABC4APXGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGQZDINRXHE . You are receiving this because you authored the thread.Message ID: @.***>
👍🏼
Le jeu. 15 févr. 2024 à 20:56, Abhimanyu Saharan @.***> a écrit :
Closed #15058 https://github.com/netbox-community/netbox/issues/15058 as completed.
— Reply to this email directly, view it on GitHub https://github.com/netbox-community/netbox/issues/15058#event-11820298498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATJUWESWOKXAF4GPTFM2VDYTZR5DAVCNFSM6AAAAABC4APXGKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHAZDAMRZHA2DSOA . You are receiving this because you authored the thread.Message ID: @.***>