Undefined symbol in source #9203

Closed
opened 2025-12-29 20:46:55 +01:00 by adam · 7 comments
Owner

Originally created by @francois-vincent on GitHub (Feb 6, 2024).

Originally assigned to: @abhi1693 on GitHub.

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

Originally created by @francois-vincent on GitHub (Feb 6, 2024). Originally assigned to: @abhi1693 on GitHub. ### 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
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:46:55 +01:00
adam closed this issue 2025-12-29 20:46:55 +01:00
Author
Owner

@francois-vincent commented on GitHub (Feb 6, 2024):

my bad it's actually VERSION = '3.7.3-dev'

@francois-vincent commented on GitHub (Feb 6, 2024): my bad it's actually VERSION = '3.7.3-dev'
Author
Owner

@jeremystretch commented on GitHub (Feb 6, 2024):

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.

@jeremystretch commented on GitHub (Feb 6, 2024): 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.
Author
Owner

@jeremystretch commented on GitHub (Feb 13, 2024):

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.

@jeremystretch commented on GitHub (Feb 13, 2024): 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.
Author
Owner

@francois-vincent commented on GitHub (Feb 13, 2024):

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:
@.***>

@francois-vincent commented on GitHub (Feb 13, 2024): 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: > ***@***.***> >
Author
Owner

@abhi1693 commented on GitHub (Feb 13, 2024):

It's not undefined. Are you by any chance running a forked version of netbox where you have made changes?

image

@abhi1693 commented on GitHub (Feb 13, 2024): It's not undefined. Are you by any chance running a forked version of netbox where you have made changes? ![image](https://github.com/netbox-community/netbox/assets/5083532/0f366bf9-f6aa-4560-b386-6a37b93e281d)
Author
Owner

@francois-vincent commented on GitHub (Feb 15, 2024):

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:
@.***>

@francois-vincent commented on GitHub (Feb 15, 2024): 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: > ***@***.***> >
Author
Owner

@francois-vincent commented on GitHub (Feb 16, 2024):

👍🏼

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:
@.***>

@francois-vincent commented on GitHub (Feb 16, 2024): 👍🏼 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: > ***@***.***> >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9203