Skip to content

SQL Server REPL reports "Terminal view is not connected" without useful failure diagnostics #20645

Description

Is there an existing issue for this?

  • I have searched the existing issues.

Describe the bug

In the Terminals playground on Windows, running the SQL Server REPL command opens a sqlcmd (sqlserver) terminal dock tab, but reports “Terminal view is not connected” instead of providing a usable SQL prompt.

The available diagnostics do not identify why the session ended. The error originates from a disconnected-view guard in the Hex1b web-terminal client; it is not, by itself, evidence of SQL Server authentication or connectivity failure.

Expected Behavior

The REPL should show an interactive SQL prompt. If the underlying command or terminal session fails, its actual failure reason should be available in the terminal or diagnostic logs rather than only a generic disconnected-view message.

Steps To Reproduce

  1. Use the source checkout for Upgrade Hex1b and improve dashboard terminal navigation and metadata #20255.
  2. Run playground/Terminals/Terminals.AppHost/Terminals.AppHost.csproj on Windows.
  3. Open the dashboard and run the sqlserver resource's REPL command.
  4. Observe the sqlcmd (sqlserver) dock tab and the reported disconnected-view error.

This is the reported scenario; the underlying cause and reproduction frequency remain unconfirmed.

Exceptions (if any)

Reported terminal error:

Terminal view is not connected

The shared browser console also contained repeated warnings:

Dashboard terminal connection failed. Timed out waiting for the terminal's first frame

These warnings do not identify the terminal/view, so they cannot conclusively be attributed to the SQL Server REPL rather than another terminal on the page. No complete exception stack for the REPL failure was captured.

Aspire doctor output

Not collected for this investigation.

Anything else?

Observed in the Terminals playground on Windows, using VS Code and its integrated browser while testing #20255. The PR head when these details were recorded was 2756fc13a2a684a0991b4942a5294537e58527aa.

Evidence from the running app

  • The sqlserver resource was Running / Healthy.
  • The SQL Server dock view's snapshot reported connected: false, ended: true, and no screen text available to the viewer. This does not establish whether the producer emitted output before the viewer attached.
  • Searches of the dashboard console logs found no matching Failed to attach terminal or Terminal view failed entries.

Diagnostic locations

  • Browser DevTools → Console: connection failures, WebSocket close codes, first-frame timeouts, and input errors.
  • Dashboard → Console logs → aspire-dashboard: category Aspire.Dashboard.Terminal.TerminalWebSocketProxy.
  • AppHost output: terminal lifecycle messages under Aspire.Hosting.ApplicationModel.TerminalService, including Starting terminal … (sqlcmd (sqlserver)) and unexpected workload exceptions.

Logging gap and investigation follow-up

RunTerminalAsync logs unexpected exceptions and cancellation, but does not log a process exit code when the workload simply completes. The current diagnostics therefore do not establish why the REPL session ended.

Investigate the producer/session lifecycle and correlate browser warnings with the terminal/view ID. Surface launch/completion diagnostics, including exit status when available, without exposing credentials or environment-variable values.

The root cause remains unconfirmed; no fix is claimed.

Related PR: #20255. Original investigation: #20255 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-dashboardarea-terminalsTerminal/PTY UX and lifecycle behavior in the dashboardbugsqlserverIssues related to SQLServer integrtions

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions