Sandbox restarting cause "nc" not found

Last updated: January 21, 2026

Root Cause

The issue occurs when the entrypoint.sh script fails to properly start the sandbox API due to:

  • Missing netcat package required for port checking

  • Using localhost instead of 127.0.0.1 in Debian-based images

Solution 1: Remove the entrypoint script (Recommended)

If you don't need custom initialization logic, the simplest solution is to remove the entrypoint.sh file and modify your Dockerfile to directly start the sandbox API:

ENTRYPOINT ["/usr/local/bin/sandbox-api"]

Remove these lines from your Dockerfile:

# Remove these lines:
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

Solution 2: Fix the entrypoint script

If you need to keep the entrypoint script for custom initialization, make these changes:

1. Install netcat in your Dockerfile

Add netcat-openbsd to your package installation:

RUN apt-get update \
  && apt-get install --assume-yes --no-install-recommends --quiet \
  netcat-openbsd \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*

2. Update your entrypoint.sh

Replace localhost with 127.0.0.1 in the port checking function:

while ! nc -z 127.0.0.1 $port; do

Debugging

To check if your sandbox is experiencing these issues, you can view the console logs using the CLI:

bl logs sbx your-sandbox-name

This will show any errors related to the entrypoint script failing to start properly.

Note: The localhost hostname does not work automatically on Debian-based images. Always use 127.0.0.1 for local connections in these environments.