Revision validation failure reasons expose internal exception details

Open
#258 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by tracing how revision validation and validation Job messages construct failure reasons; the issue does not name specific files or tests. Check the related issues #119, #139, and #237 for context. Done means user-facing failures use explicitly constructed messages without exception class names or raw exception details, while diagnostic information remains available in server logs.

Written by the indexing model from the issue text.

Description

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.2.0

NetBox Version

v4.7.6

Python Version

3.12

Steps to Reproduce
  1. Create an upload-backed Script Project with deploy.py selected as a Script File.
  2. Upload deploy.py containing import netaddr.absent_submodule.
  3. Wait for the validation Job to finish.
  4. Retrieve the revision through /api/plugins/netbox-scripts/project-revisions/<revision_id>/ and inspect last_validation_failure.
Expected Behavior

The revision remains materialized and records a clear, actionable failure reason without exposing internal exception details.

The original exception is available in the server logs for troubleshooting. The same convention applies to the validation Job's user-facing messages.

Observed Behavior

The revision returns to materialized, but last_validation_failure contains the exception class name and its original message:

ScriptFileImportError: The script file "deploy.py" failed to import. No module named 'netaddr.absent_submodule'

Storage, cache, source corruption and timeout failures also expose exception class names or exception messages.

Failure reasons should consistently use explicitly constructed, user-facing messages while retaining useful diagnostic information.

Related: #119, #139 and #237.

Dominant language
Python
Stars
9
Forks
0
Avg merge
18h 59m
Merged PRs (30d)
93

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from netbox-community/netbox-scripts

All issues in netbox-community/netbox-scripts

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.