Script result page omits Job-level failure reasons

オープン 初心者向け
#153 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

job.data['log']を読み取るScript結果ページのコードから始め、Job runnerでのjob.log_entriesの使用方法とJob Logタブを比較してください。結果ページを更新して、ScriptのログとともにJobレベルのメッセージを表示し、Scriptが無効な場合の失敗理由やその他のJobメッセージが結果ページに表示されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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

v0.0.1

NetBox Version

v4.7.1

Python Version

3.12

Steps to Reproduce
  1. Upload and activate a Project with a Script File, for example deploy.py:
    from netbox_scripts import Script
    
    
    class Hello(Script):
        def run(self, data, commit):
            self.log_success('Hello.')
    
  2. From the Script's Run tab, schedule a run a few minutes in the future.
  3. Disable the Script before the scheduled run starts.
  4. After the Job has run, refresh its result page.
Expected Behavior

The result page explains why the Job failed, even if the Script never started:

"Hello" was disabled after this run was requested, so it was not run.
Observed Behavior

The result page shows Failed, but the log is empty and no failure reason is displayed.

The reason is recorded in the Job's own log, accessible through the Script's Jobs tab and the Job's Log tab.

The result page currently reads only job.data['log'], while the Job runner records its messages in job.log_entries. This also hides other Job-level messages, including revision information, execution refusals, Script loading failures, and final failure summaries.

Reproduced on main (4a65dfe) and the #122 development tree with NetBox v4.7.1.

Related to #41 and #122, but separate from both.

主要言語
Python
スター
8
フォーク
0
平均マージ
12時間 34分
マージ済み PR(30日)
57

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

netbox-community/netbox-scripts のほかの issue

netbox-community/netbox-scripts の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。