Skip to content

Commit f3adfe9

Browse files
committed
Block deployment when backend port is already in use
Prevent port conflicts by hard-failing the deployment: - Change port conflict from warning to fatal error - Provide clear suggested port and diagnostic commands - Deployment stops immediately with actionable error message - User must fix port conflict before deploying
1 parent b72aa5d commit f3adfe9

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/commands/deploy.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ deploy_backend() {
3636
if ! check_remote_port_available "$BACKEND_PORT"; then
3737
local suggested_port
3838
suggested_port=$(suggest_available_port "$BACKEND_PORT")
39-
warn "Port $BACKEND_PORT is already in use on $SSH_HOST"
40-
warn "Consider updating shipnode.conf: BACKEND_PORT=$suggested_port"
41-
warn "Or check running apps with: ssh $SSH_USER@$SSH_HOST -p $SSH_PORT 'ss -tln | grep LISTEN'"
39+
error "Port $BACKEND_PORT is already in use on $SSH_HOST
40+
41+
Suggested fix:
42+
1. Update shipnode.conf: BACKEND_PORT=$suggested_port
43+
2. Check what's using the port:
44+
ssh $SSH_USER@$SSH_HOST -p $SSH_PORT 'ss -tln | grep :$BACKEND_PORT'
45+
46+
Deployment blocked to prevent port conflict."
4247
fi
4348

4449
if [ "$ZERO_DOWNTIME" = "true" ]; then

0 commit comments

Comments
 (0)