Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Failed REST uploads expose internal error details

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

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

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

評価

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

調査の方向性

issueで説明されているアップロードハンドラーと既存のUploadAPITestCaseフィクスチャから始めます。StorageError、OSError、ImproperlyConfiguredがHTTP 400レスポンスに変換される仕組みを追い、その後アップロードAPIのテストを実行します。失敗時に例外の詳細を公開せず固定メッセージを返し、根本のエラーがログで引き続き確認できれば完了です。

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

説明

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

v0.0.1

NetBox Version

v4.7.4

Python Version

3.12

Steps to Reproduce
  1. Create a Script Project with source type Upload.
  2. In a local API test, patch the configured netbox_scripts storage backend's save() method to raise:
    PermissionError(
        13,
        'Permission denied',
        '/srv/netbox/private/deploy.py',
    )
    
  3. As a user with permission to change the Project and add Script Files, POST a Python source file as multipart form data to /api/plugins/netbox-scripts/projects/<id>/upload/.

This was reproduced using the existing UploadAPITestCase fixture and a mocked backend failure.

Expected Behavior

The upload returns HTTP 400 with a fixed message, such as “The upload could not be stored.” The underlying exception and traceback are logged for troubleshooting.

Configuration failures should also return a fixed message without including internal exception details.

Observed Behavior

The response is HTTP 400, but its detail includes the storage exception's message, including the internal path:

[Errno 13] Permission denied: '/srv/netbox/private/deploy.py'

A failure from the backend's save() method also includes the generated storage key.

The upload handler formats caught StorageError and OSError exceptions into the response. Its adjacent ImproperlyConfigured handler returns the exception text directly, which can include internal details from a failed NetBox Branching routing check.

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

環境構築

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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