Skip to content

[Bug]: SSH remote launch timeout - server killed with SIGTERM before migrations complete #2770

@fullheart

Description

@fullheart

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

  • packages/contracts or packages/shared

Steps to reproduce

  1. Set up an SSH remote environment via the desktop app (Settings → Connections → Add environment → SSH)
  2. Target a Linux host that has not previously run t3 serve
  3. Launch the remote environment
  4. Observe failure after ~15 seconds

Expected behavior

SSH launch should wait long enough for the server to complete first-time startup including database migrations — at least 30–60 seconds.

Actual behavior

The remote launch script starts the server, migrations run successfully, but the readiness probe times out before the HTTP server starts listening. The parent process sends SIGTERM and the launch fails with:

Remote T3 server did not become ready on 127.0.0.1:3773.
npm error process terminated
npm error signal SIGTERM

Server logs confirm migrations completed:

[10:14:36.716] INFO (#3): Running all migrations...
[10:14:36.827] INFO (#3): Migrations ran successfully
migrations: [ '1_OrchestrationEvents', ..., '30_ProjectionThreadShellArchiveIndexes' ]

Impact

  • Blocks work completely

Version or commit

v0.0.24

Environment

  • Client: macOS (installed via brew install --cask t3-code)
  • Remote host: Linux, Node v24.14.0
  • Transport: SSH
  • Database: SQLite (30 migrations)

Logs or stack traces

Remote T3 server did not become ready on 127.0.0.1:3773.
npm error process terminated
npm error signal SIGTERM
npm error A complete log of this run can be found in: /home/developer/.npm/_logs/2026-05-20T08_11_02_663Z-debug-0.log

bash: cannot set terminal process group (2092048): Inappropriate ioctl for device
bash: no job control in this shell

(node:2092479) ExperimentalWarning: SQLite is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

[10:14:36.716] INFO (#3): Running all migrations...
[10:14:36.827] INFO (#3): Migrations ran successfully
migrations: [ '1_OrchestrationEvents', '2_OrchestrationCommandReceipts', ..., '30_ProjectionThreadShellArchiveIndexes' ]

Workaround

Increase REMOTE_READY_TIMEOUT_MS in packages/ssh/src/tunnel.ts from 15_000 to 60_000:

const REMOTE_READY_TIMEOUT_MS = 60_000;

Building and publishing a patched @t3tools/ssh package would resolve the issue permanently.

Alternatively, manually run t3 serve once on the remote host (let it complete migrations and start), kill it, then retry the SSH launch. The server log output shows the server would have been ready with more time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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