Unhelpful message with custom script errors - AttributeError:'NoneType' object has no attribute 'full_name'
#15353
Labels
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Deployment Type
Self-hosted
NetBox Version
v3.7.3
Python Version
3.8
Steps to Reproduce
Create a local file called
wombat.py
Upload this as a custom script via the web UI
Test at CLI:
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py runscript wombat.Possum
Edit the file
/opt/netbox/netbox/scripts/wombat.py
on the Netbox server. Change "def" to "defz" (a gross syntax error)Re-run same CLI command:
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py runscript wombat.Possum
Expected Behavior
A useful error message, such as
Observed Behavior
A confusing error message:
Additional Reproducers
It's also possible to reproduce this problem without a syntax error:
from extras.scripts import Script
, add a lineimport foo from bar
. OR:Then re-run the exact same CLI command:
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py runscript wombat.Possum
The errors I'd expect would be along the lines of:
or
But instead, these both still give
AttributeError: 'NoneType' object has no attribute 'full_name'
References
Relates to discussion #15352 and issue #12766
The text was updated successfully, but these errors were encountered: