Skip to content

bug(sandbox): SSH exec hardcodes /bin/bash and breaks BYOC images without Bash #2290

Closed

Description

@lilhammerfun

Agent Diagnostic

Description

Actual behavior: BYOC images that provide /bin/sh but not /bin/bash can reach Sandbox Ready, but OpenShell cannot execute the initial command or subsequent sandbox exec commands. The client reports that the exec relay closed before an exit status was returned.

Expected behavior: SSH command execution should not impose an undocumented Bash dependency on otherwise supported standard Linux images. The shell should be configurable or fall back to /bin/sh. If Bash is intentionally mandatory, OpenShell should validate this prerequisite early and return an actionable error.

Reproduction Steps

  1. Deploy OpenShell with the Kubernetes driver using sidecar topology.
  2. Create a Sandbox from an Alpine-based application image that has /bin/sh and no /bin/bash.
  3. Confirm that the Sandbox is Ready and that /bin/sh works through kubectl exec.
  4. Run: openshell sandbox exec --name <sandbox> -- /bin/sh -lc 'echo OK'.
  5. Observe that the SSH exec channel closes without reporting an exit status.
  6. Add /bin/bash to the same image and repeat; the hard dependency is no longer encountered.

Environment

Logs

$ kubectl exec <sandbox-pod> -c sandbox -- /bin/sh -lc 'echo OK'
OK

$ openshell sandbox exec --name <sandbox> -- /bin/sh -lc 'echo OK'
Error: exec relay closed before the command reported an exit status

Agent-First Checklist

  • I pointed my agent at the repo and had it investigate this issue
  • I loaded relevant skills (debug-openshell-cluster, openshell-cli, and create-github-issue)
  • I checked the latest OpenShell release and explained why I did not replace the deployed prototype to runtime-test it
  • I searched existing issues for possible duplicates
  • My agent could not resolve this without modifying the image or supervisor

Activity

  1. added
    area:sandboxSandbox runtime and isolation work
    and removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Jul 29, 2026
  2. matthewgrossman commented on Jul 29, 2026

    @matthewgrossman
    Member

    📋 triage-agent

    Triage Assessment

    Classification: bug-confirmed

    Summary

    Supported BYOC images containing /bin/sh but not Bash cannot execute commands through OpenShell SSH.

    Investigation

    Both PTY and non-PTY SSH paths still construct /bin/bash, including when the requested command is itself /bin/sh. No existing issue duplicates this compatibility defect.

    Recommendation

    Remove the undocumented Bash dependency through a defined shell contract or safe /bin/sh fallback, with coverage for Bash-free images.

  3. github-actions commented on Aug 28, 2026

    @github-actions

    This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.

  4. johntmyers commented on Sep 17, 2026

    @johntmyers
    Collaborator

    📋 triage-agent

    Closing as fixed by #3147. The sandbox now detects an available login shell for the built-in default command and interactive SSH sessions, preferring Bash when present and falling back to /bin/sh for minimal images such as Alpine. The change also reports the missing executable in spawn errors and was verified on Alpine/OpenShift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sandboxSandbox runtime and isolation workstate:staleInactive item at risk of automatic closure.topic:compatibilityCompatibility-related work

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions