Script run responses include storage backend error text
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading validation.py around build_error_sanitizer and storage/store.py around _stream_verified, then trace how script_class_context passes load errors to the REST and UI views. Check how the sanitizer handles backend-specific error details while preserving useful administrator logging. Done when script run responses omit storage backend details and the full error remains available in server logs; consider the upload path covered by #77.
索引モデルが issue の本文から書いたものです。
説明
Plugin Version
v0.0.1 (also present on main)
NetBox Version
v4.7.4
Python Version
3.12
Steps to Reproduce
- Use the default filesystem storage backend for script source.
- Activate a revision for an upload project so it has a runnable Script.
- Make that revision's stored files unreadable by the NetBox process, and clear the local runtime cache so the run has to read from storage.
- Run the Script through the REST API (
POST /api/plugins/scripts/scripts/<id>/run/), or from its run view in the UI.
Expected Behavior
The response says the Script could not be loaded, without storage backend details. The full error goes to the server log for the administrator.
Observed Behavior
Found by reading the code on main, not by running these steps. The example message below shows the shape the code produces, not captured output.
The load failure is shown to the user by api/views.py:351-358 (REST) and views/scripts.py:198 (UI). It comes from script_class_context, which passes the error through build_error_sanitizer (validation.py:239-261). The sanitizer replaces the storage key, digest, local cache directory and runtime root, but not the storage backend's own root path or other backend text. Reading a stored file wraps the backend exception text (storage/store.py, _stream_verified), so a filesystem read failure still shows something like Permission denied: '/opt/netbox/netbox/media/<scripts root>/<storage>/<digest>/script.py'. Other backends would include their own error text, such as an S3 endpoint URL.
The upload path has the same root cause and is covered by #77. CodeQL reports this one as py/stack-trace-exposure (alert 3).
- 主要言語
- Python
- スター
- 8
- フォーク
- 0
- 平均マージ
- 11時間 22分
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
netbox-community/netbox-scripts のほかの issue
-
app: scripts Bucket: Improve status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
netbox-community/netbox-scripts#80 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts Bucket: KTLO severity: low status: backlog type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
netbox-community/netbox-scripts#76 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Raise the minimum NetBox version to v4.7.5対応中かも @pheus が 2 日前に担当しました。 オープンapp: scripts Bucket: KTLO status: backlog type: housekeeping
netbox-community/netbox-scripts#123 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
A committed run is reported as unfinished when its events cannot be queued対応中かも @pheus が 2 日前に担当しました。 オープンapp: scripts Bucket: KTLO severity: low status: accepted type: bug
netbox-community/netbox-scripts#122 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Failed post-commit callback reports committed changes as reverted and drops events対応中かも @pheus が 2 日前に担当しました。 オープンapp: scripts Bucket: KTLO severity: low status: accepted type: bug
netbox-community/netbox-scripts#121 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
netbox-community/netbox-scripts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
marimo-team/marimo#11768 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-node#2358 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 7 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MTSWebServices/RecTools#330 ·