bug: dataplane client ignores SERVER_BASEPATH, so create/delete topic miss the subpath
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
frontend/src/app.tsx の dataplane トランスポートの設定から始めます。次に frontend/src/config.ts の getGrpcBasePath を読み、動作している console.v1alpha1 クライアントと比較します。SERVER_BASEPATH がスタンドアロン UI の dataplane リクエスト URL にどう影響するかを確認します。Create Topic、Delete Topic、その他の dataplane RPC に設定されたプレフィックスが含まれることを完了条件とし、/kafka 以下へのリクエストで確認します。
索引モデルが issue の本文から書いたものです。
説明
Summary
When Console is served under a URL prefix (SERVER_BASEPATH=/kafka), the topics list works, but Create Topic and Delete Topic call the dataplane API at the site root. The browser requests POST /redpanda.api.dataplane.v1.TopicService/CreateTopic instead of POST /kafka/redpanda.api.dataplane.v1.TopicService/CreateTopic.
Anything else mounted at / receives that request. The UI then shows ConnectError [unknown].
The same code is in v3.5.1 and is unchanged on v3.13.1 / current master.
Setup
Console behind a reverse proxy that forwards only /kafka/* to the process.
SERVER_BASEPATH=/kafka
SERVER_STRIPPREFIX=true
SERVER_SETBASEPATHFROMXFORWARDEDPREFIX=true
The served page sets window.BASE_URL = '/kafka/'. Listing topics and the console.v1alpha1 calls go to /kafka/... and succeed.
What happens
- Open
/kafka/topics. - Create Topic, fill in a name, submit.
- The browser sends:
POST /redpanda.api.dataplane.v1.TopicService/CreateTopic
That path has no /kafka prefix, so the proxy does not send it to Console. The Connect client reports ConnectError [unknown]. Delete Topic uses the same client.
The same request with the prefix reaches Console and returns a normal API response. For example, an empty body returns 400 invalid_argument (topic is required), which shows the handler itself is fine.
Cause
The standalone app builds the dataplane transport with an explicit empty base URL:
// frontend/src/app.tsx
const dataplaneTransport = createConnectTransport({
baseUrl: getGrpcBasePath(''), // Embedded mode handles the path separately.
getGrpcBasePath only falls back to window.BASE_URL when the override is nullish:
// frontend/src/config.ts
export const getGrpcBasePath = (overrideUrl?: string) => overrideUrl ?? getBasePath();
'' is not nullish, so the fallback never runs and baseUrl stays empty. The comment says embedded mode handles the path, but this transport is the one the standalone UI uses. Create Topic, Delete Topic, and the other redpanda.api.dataplane.v1 calls share it. The older console.v1alpha1 client still uses getBasePath() and is fine.
Expected
With SERVER_BASEPATH=/kafka, dataplane calls should be POST /kafka/redpanda.api.dataplane.v1.TopicService/CreateTopic (and the same prefix for Delete Topic and the other dataplane RPCs).
Workaround
Also route /redpanda.api.dataplane.v1.* to Console at the proxy, or serve Console at / on its own host. No Console config option changes the empty base URL.
- 主要言語
- TypeScript
- スター
- 4.3k
- フォーク
- 431
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
redpanda-data/console のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
redpanda-data/console#2487 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
redpanda-data/console#2459 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
redpanda-data/console#2692 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
redpanda-data/console#2673 ·
メンテナーはふだん 2 日以内に返信
-
dependencies lang/ts security snyk team/ux
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
redpanda-data/console#2583 ·
メンテナーはふだん 2 日以内に返信
redpanda-data/console の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
farion1231/cc-switch#8829 ·
メンテナーはふだん 1 日以内に返信
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverオープンdoc-audit enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100