bug: dataplane client ignores SERVER_BASEPATH, so create/delete topic miss the subpath

Aperta Adatta ai principianti
#2,693 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@bhataprameya ci sta già lavorando.

Dal 24/10/2026.

  • #2694 di @bhataprameya — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Inizia in frontend/src/app.tsx, nella configurazione del trasporto dataplane. Poi leggi getGrpcBasePath in frontend/src/config.ts e confrontalo con il client console.v1alpha1 funzionante. Verifica come SERVER_BASEPATH influisce sugli URL delle richieste dataplane dell’interfaccia utente autonoma. Il lavoro è completato quando Create Topic, Delete Topic e le altre RPC dataplane includono il prefisso configurato; verificalo con una richiesta sotto /kafka.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

  1. Open /kafka/topics.
  2. Create Topic, fill in a name, submit.
  3. 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.

Lingua principale
TypeScript
Stelle
4.3k
Fork
433
Merge medio
2g 9h
PR unite (30g)
29

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redpanda-data/console

Tutte le issue di redpanda-data/console

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.