ResourceNotFound from the binary protocol prints an empty key

オープン
#4,767 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

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

@xalestar がすでに取り組んでいます。

2026年11月5日 から。

評価

この issue はまだ評価されていません。

説明

api python rust
Bug description

Deleting a personal access token that does not exist, over the binary protocol, fails with code 20 as expected, but the error message has an empty key:

Resource with key:  was not found.

The caller cannot tell from the message what was not found. I expected the message to name the resource, or at least not to print an empty placeholder.

By reading the code, not confirmed for every path: the binary response carries only the status code, and the client rebuilds the error with IggyError::from_code (core/common/src/error/iggy_error.rs:703), which calls from_repr. That fills the String field of ResourceNotFound(String) with an empty string, and the #[error("Resource with key: {0} was not found.")] format then prints nothing for {0}. The server maps DeletePersonalAccessTokenResult::NotFound to code 20 (core/metadata/src/stm/result.rs:766), and the user-not-found results use the same code, so I expect those to show the same message. Other variants with fields that are decoded from a bare code may have the same problem.

Affected area / component

Rust SDK, Python SDK, Wire protocol / API

Deployment

Local build, cargo run --bin iggy-server -- --with-default-root-credentials

Versions

Server: master at 06cf04e5e. Python SDK: branch of #4766, which adds delete_personal_access_token to the Python client.

Hardware / environment

macOS, Apple Silicon (arm64)

Sample code
import asyncio
from apache_iggy import IggyClient

async def main():
    client = IggyClient("127.0.0.1:8090")
    await client.connect()
    await client.login_user("iggy", "iggy")
    try:
        await client.delete_personal_access_token("no-such-token-xyz")
    except Exception as error:
        print(type(error).__name__, error.code, error)

asyncio.run(main())

Output:

IggyError 20 Resource with key:  was not found.
Reproduction
  1. Start a local server with cargo run --bin iggy-server -- --with-default-root-credentials.
  2. Build the Python SDK from #4766 with maturin develop in foreign/python. The Rust client's delete_personal_access_token goes through the same from_code path.
  3. Run the sample above.
主要言語
Rust
スター
5.2k
フォーク
516
平均マージ
2日 17時間
マージ済み PR(30日)
155

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

apache/iggy のほかの issue

apache/iggy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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