dstack icon indicating copy to clipboard operation
dstack copied to clipboard

Check port forwarding before switching SSH instance from `pending` to `idle`

Open jvstme opened this issue 7 months ago • 2 comments

Problem

If an SSH instance forbids port forwarding with AllowTcpForwarding no, dstack does not detect this configuration error at dstack apply time. The instance is marked as idle and dstack apply exits successfully. The instance is then marked as unreachable immediately after that.

This is counterintuitive and the error can remain unnoticed by the user.

Solution

Check port forwarding before marking the instance as idle. For example, replace this health check that runs curl on the instance with the regular health check that uses port forwarding and calls shim from the server.

Workaround

No response

Would you like to help us implement this feature by sending a PR?

Yes

jvstme avatar May 15 '25 19:05 jvstme