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

Google Cloud deployment returns a 500 error when the client secret file is not valid JSON

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

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

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

評価

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

調査の方向性

まず web/pgadmin/misc/cloud/google/__init__.py の verify_credentials() を読み、そこで発生したエラーがどのように HTTP レスポンスになるかを追ってください。issue に記載された、無効な JSON、無効な UTF-8、不正な client secret、ファイルが存在しない場合を確認してください。各ケースで明確な通常の Bad Request が返され、ファイルが存在しない場合には既存の “Client secret path not found” エラーが使われれば完了です。

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

説明

Bug

Describe the bug

In the Google Cloud deployment wizard, selecting a client secret file that is not valid JSON makes the "Click here to authenticate yourself to Google" step fail with an internal server error (HTTP 500), instead of saying that the file is invalid.

verify_credentials() in web/pgadmin/misc/cloud/google/__init__.py calls json.load() on the file without handling errors. A file that isn't JSON, isn't UTF-8, or doesn't have the structure of a Google OAuth client secret raises an exception that is not caught. A request without client_secret_file fails the same way, because unquote(None) raises TypeError.

To Reproduce

  1. Start Deploy Cloud PostgreSQL and choose Google Cloud.
  2. Select any file that is not a Google client secret JSON file (e.g. a .sql or text file) as the client secret file.
  3. Click the button to authenticate with Google.
  4. The request returns a 500 error.

Expected behavior

A clear error such as "The client secret file is not a valid Google OAuth client secret JSON file.", returned as a normal bad-request response.

Error message

HTTP 500 Internal Server Error. The server log shows an uncaught json.decoder.JSONDecodeError (or UnicodeDecodeError for a non-UTF-8 file).

Desktop (please complete the following information):

  • OS: any
  • pgAdmin version: 9.18 (also current master)
  • Mode: Desktop and Server
  • Package type: any

Additional context

Catching ValueError (which covers JSONDecodeError and UnicodeDecodeError), and checking that the expected keys are present, before creating the Google object would fix it. A missing client_secret_file should return the existing "Client secret path not found" error.

主要言語
Python
スター
3.9k
フォーク
914
平均マージ
1日 15時間
マージ済み PR(30日)
39

環境構築

はじめの一歩

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

pgadmin-org/pgadmin4 のほかの issue

pgadmin-org/pgadmin4 の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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