Skip to content

JSONRPC Server Connection Failure Due to Stdout Contamination #341

@eleanorjboyd

Description

@eleanorjboyd

Summary

The JSONRPC server breaks after commit 2df70d1 due to tracing output being written to stdout, corrupting the JSONRPC protocol communication and causing connection errors in client extensions.

Environment

  • Affected versions: Builds after commit 2df70d1
  • Platform: All platforms (macOS, Windows, Linux)

Symptoms

  • Extension UI (e.g., py-envs) shows endless loading state
  • Console error: Connection Error: [{},null,null]
  • JSONRPC communication fails completely
  • Server appears to hang or not respond to requests

Root Cause

Commit 2df70d1 introduced performance tracing via tracing-subscriber. The tracing configuration writes log/trace output to stdout by default, but the JSONRPC server communicates via stdin/stdout. This causes log messages to intermix with JSONRPC messages, corrupting the protocol.

Solution

Redirect all tracing output to stderr by adding .with_writer(std::io::stderr) to the tracing subscriber configuration.

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions