You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`startHttpAndWs` tried to bind the HTTP server it owns to `host:port` and the underlying `listen()` call failed — most commonly `EADDRINUSE` (another process, often a previous devframe instance, is already bound to that port) or `EACCES` (insufficient permissions, typically a privileged port). The WS RPC transport is torn down before this error surfaces, so nothing is leaked.
- Free the port, or pick another via `--port`, `cli.port` / `cli.portRange` on the definition, or `devMiddleware.port` on `viteDevBridge`.
25
+
- The original node error is available as `error.cause` — check `error.cause.code` (e.g. `'EADDRINUSE'`) to branch on the failure kind programmatically.
26
+
27
+
## Source
28
+
29
+
-[`packages/devframe/src/node/server.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/node/server.ts) — `startHttpAndWs()` throws this when its owned HTTP server's `listen()` fails.
# DF8206: Terminal Session Restart on Closed Stream
6
+
7
+
## Message
8
+
9
+
> Terminal session "`{id}`" cannot be restarted — its output stream is already closed
10
+
11
+
## Cause
12
+
13
+
`restart()` was called on a `startChildProcess()` or `startPtySession()` session whose output stream is already closed. The stream closes irreversibly on a natural process exit or after `terminate()` — it backs a single-use `ReadableStream` controller that cannot be reopened, so restarting in place is not possible once it has closed.
14
+
15
+
## Fix
16
+
17
+
Drop the spent session with `ctx.terminals.remove(session)`, then spawn a replacement via `ctx.terminals.startChildProcess()` or `ctx.terminals.startPtySession()` with a fresh id.
18
+
19
+
## Source
20
+
21
+
-[`packages/hub/src/node/host-terminals.ts`](https://github.com/devframes/devframe/blob/main/packages/hub/src/node/host-terminals.ts) — the `restart()` handle returned by `startChildProcess()` and `startPtySession()` throws this once the session's stream has closed.
why: (p: {port: number})=>`The devframe instance on port ${p.port} has no MCP endpoint.`,
113
113
fix: 'Restart the instance with the --mcp flag (or set `cli.mcp: true` on its definition) to expose its tools, then list instances again.',
114
114
},
115
+
DF0052: {
116
+
why: (p: {host: string,port: number,reason: string})=>`Failed to listen on ${p.host}:${p.port}: ${p.reason}`,
117
+
fix: 'The port is likely already taken by another process (often a previous devframe instance). Free it, or pick another via `--port`, `cli.port` / `cli.portRange` on the definition, or `devMiddleware.port` on `viteDevBridge`. The original node error is available as `error.cause`.',
why: (p: {id: string})=>`Terminal session "${p.id}" is not restartable`,
68
68
fix: 'It was registered with `restartable: false`; restart it through its owner\'s controls, or spawn it with `restartable: true` (the default) to allow in-place restarts.',
69
69
},
70
+
DF8206: {
71
+
why: (p: {id: string})=>`Terminal session "${p.id}" cannot be restarted — its output stream is already closed`,
72
+
fix: 'The session already exited (or was terminated) and its stream is spent. Drop it with `ctx.terminals.remove(session)`, then spawn a replacement via `ctx.terminals.startChildProcess()` or `ctx.terminals.startPtySession()` with a fresh id.',
73
+
},
70
74
DF8400: {
71
75
why: (p: {id: string})=>`Command "${p.id}" is already registered`,
/** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
/** Current foreground process name, when the backend can resolve it. */
140
141
getProcessName: ()=>string|undefined
141
142
terminate: ()=>Promise<void>
143
+
/** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
0 commit comments