dev-mode key pair and healthcheck without a config file read a variable that is not UTF-8 as unset

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

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

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

評価

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

調査の方向性

2 つの読み取り処理は、UTF-8 ではない環境変数の値を未設定として扱っています。1 つは crates/server/src/dev_credentials.rs の resolve_with 内にある non_empty クロージャ、もう 1 つは crates/app/src/cmd_healthcheck.rs の resolve_target 内にある std::env::var の呼び出しです。まず無効化スイッチ EXTENDDB_DEV_DISABLE_EXAMPLE_CREDENTIAL を読んでください。このスイッチは、そのような値を変数名を含むメッセージとともにすでに拒否しています。両者を比較してください。どちらかの読み取り処理で UTF-8 ではない値が与えられたときに、変数名を含むエラーが発生し、既存のエラー処理の経路がそのまま残っていれば完了です。

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

説明

bug

What happens

Two readers of ExtendDB variables read the process environment with their own code instead of the configuration loader. Both treat a value that is not UTF-8 as unset, and no message says that the value is not UTF-8. For an EXTENDDB__ variable, the configuration loader refuses such a value with an error that names it (#977).

Measured on 21 November 2026 with the dev-mode SQLite binary (--features sqlite-memory,dev-mode) of the fix for #977. Each case ran twice and gave the same answer both times.

The dev-mode key pair

A dev-mode build reads EXTENDDB_DEV_ACCESS_KEY_ID and EXTENDDB_DEV_SECRET_ACCESS_KEY as unset when their values are not UTF-8.

env $'EXTENDDB_DEV_ACCESS_KEY_ID=\xff' $'EXTENDDB_DEV_SECRET_ACCESS_KEY=\xfe' extenddb serve --foreground --port 18991

At 20:53 UTC, both runs served /health, and a ListTables signed with the documented example pair got HTTP 200. The startup output named only the example pair under "Sign requests with".

With only EXTENDDB_DEV_ACCESS_KEY_ID not UTF-8 and EXTENDDB_DEV_SECRET_ACCESS_KEY=abc, both runs at 20:58 UTC exited 1 with this message. The message says that the access key variable is not set:

Error: EXTENDDB_DEV_SECRET_ACCESS_KEY is set but EXTENDDB_DEV_ACCESS_KEY_ID is not; set both to seed an additional dev credential, or neither.

resolve_with in crates/server/src/dev_credentials.rs reads each variable of the pair through the non_empty closure. The closure maps a value that is not UTF-8 to None (.and_then(|v| v.into_string().ok())). The disable switch EXTENDDB_DEV_DISABLE_EXAMPLE_CREDENTIAL refuses such a value with a message that names it.

Healthcheck without a config file

With no config file, resolve_target in crates/app/src/cmd_healthcheck.rs reads EXTENDDB__SERVER__PORT and EXTENDDB__SERVER__BIND_ADDR with std::env::var. It treats Err(_) as unset. std::env::var also returns Err for a value that is not UTF-8. Its comment says that it reports a bad port instead of using the default port.

extenddb healthcheck --config <a path that does not exist>, with nothing on port 18443, at 20:52 UTC:

Environment Answer
EXTENDDB__SERVER__PORT=abc exit 1, healthcheck failed: EXTENDDB__SERVER__PORT 'abc' is not a valid port: invalid digit found in string
EXTENDDB__SERVER__PORT holds the byte 0xFF exit 1, healthcheck failed: Cannot connect to 127.0.0.1:18443: Connection refused (os error 111)
EXTENDDB__SERVER__BIND_ADDR holds the byte 0xFF exit 1, the same Cannot connect to 127.0.0.1:18443

The byte 0xFF in the port gives the answer of an unset port. The probe goes to the default port, and the message does not name the variable.

On main, any variable that is not UTF-8 stops serve with a panic before it reads the key pair (#977). Neither reader changes in the fix for #977.

Expected

Each reader refuses a value that is not UTF-8 with a message that names the variable, as the disable switch and the configuration loader do.

主要言語
Rust
スター
517
フォーク
60
平均マージ
3日 21時間
マージ済み PR(30日)
116

環境構築

はじめの一歩

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

ExtendDB/extenddb のほかの issue

ExtendDB/extenddb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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