#1945·kubeshark

CLI `console` subcommand broken since hub #464 — re-point from /scripts/logs WebSocket to ScriptLogsDashboard Connect-RPC

Author: corestCreated Jun 16, 2026Updated Jul 10, 2026

Summary

kubeshark console has been non-functional since hub #464 (merged 2025-12-19). A transitional "under refactoring" note has been added to the command (help text + runtime warning) on the cli-console-refactoring-note branch; this issue tracks the actual client migration.

What broke

  • Hub #464 moved scripting-console log streaming off the /scripts/logs WebSocket and onto a Connect-RPC streaming service: script_logs.ScriptLogsDashboard/StreamLogs (registered in hub/server/server.go, schema in api2 script_logs). The old GET /scripts/logs route and its ScriptLogsHandler were deleted.
  • The CLI console command still dials a raw WebSocket at ws://<host>:<frontPort>/api/scripts/logs (cmd/console.go, gorilla/websocket). That route no longer exists, so the dial fails and the command spins in its 5s reconnect loop, never streaming logs.

Fix

Re-point cmd/console.go from the WebSocket dial to the Connect-RPC stream:

  • Replace the gorilla/websocket dial to /api/scripts/logs with a Connect-RPC client for ScriptLogsDashboard.StreamLogs (api2 script_logsconnect), reading the streamed log records and printing them (preserving the :ERROR] → stderr/red behavior).
  • Reuse the existing auth: the command already mints the kubeshark-cli SA token (MintHubToken) and falls back to License-Key — attach it on the Connect request the same way (X-Kubeshark-Authorization / License-Key).
  • Remove the transitional "under refactoring" note (Short/Long + runtime warning) added on cli-console-refactoring-note once the stream works.
  • Verify against a gated hub (auth enabled) and an auth-disabled hub.

Context

The same SA-token auth pattern is already wired into cmd/mcpRunner.go and cmd/console.go (token minting), so this is primarily a transport swap (WebSocket → Connect-RPC streaming).