WSL (490 - Relay) ERROR: CreateProcessCommon:798: execvpe(/bin/bash) failed: No such file or directory #3067

Closed
opened 2026-02-16 17:38:27 -05:00 by yindo · 12 comments
Owner

Originally created by @mentalzenith on GitHub (Nov 23, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

# Builds the .NET backend project using the solution file in the current directory
$ dotnet build
<3>WSL (490 - Relay) ERROR: CreateProcessCommon:798: execvpe(/bin/bash) failed: No such file or directory

OpenCode version

1.0.105

Steps to reproduce

When the AI run any shell command in windows

Screenshot and/or share link

No response

Operating System

windows 10

Terminal

Windows Terminal

Originally created by @mentalzenith on GitHub (Nov 23, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description ``` # Builds the .NET backend project using the solution file in the current directory $ dotnet build <3>WSL (490 - Relay) ERROR: CreateProcessCommon:798: execvpe(/bin/bash) failed: No such file or directory ``` ### OpenCode version 1.0.105 ### Steps to reproduce When the AI run any shell command in windows ### Screenshot and/or share link _No response_ ### Operating System windows 10 ### Terminal Windows Terminal
yindo added the bug label 2026-02-16 17:38:27 -05:00
yindo closed this issue 2026-02-16 17:38:27 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 23, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4599: Bash tool executes bash commands with cmd.exe (similar Windows shell execution issue)
  • #4379: Specific bash commands fail on Windows in Git Bash due to path re-mapping (Windows path handling)
  • #631: Windows Support (umbrella issue tracking all Windows problems)
  • #3479: Opencode bash tool spawn user commands using /bin/sh instead of bash (shell execution configuration)

The core issue appears to be related to how OpenCode spawns shell commands on Windows. When the AI tries to run shell commands on Windows, the spawn mechanism doesn't properly handle bash execution, particularly in WSL environments. Issues #4599 and #4379 describe similar problems where bash-specific commands fail on Windows due to improper shell handling.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 23, 2025): This issue might be a duplicate of existing issues. Please check: - #4599: Bash tool executes bash commands with cmd.exe (similar Windows shell execution issue) - #4379: Specific bash commands fail on Windows in Git Bash due to path re-mapping (Windows path handling) - #631: Windows Support (umbrella issue tracking all Windows problems) - #3479: Opencode bash tool spawn user commands using `/bin/sh` instead of bash (shell execution configuration) The core issue appears to be related to how OpenCode spawns shell commands on Windows. When the AI tries to run shell commands on Windows, the spawn mechanism doesn't properly handle bash execution, particularly in WSL environments. Issues #4599 and #4379 describe similar problems where bash-specific commands fail on Windows due to improper shell handling. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

checking it out

@rekram1-node commented on GitHub (Nov 23, 2025): checking it out
Author
Owner

@mentalzenith commented on GitHub (Nov 23, 2025):

Found out that the shell tool become broken at 1.0.88
1.0.87 is working correctly

@mentalzenith commented on GitHub (Nov 23, 2025): Found out that the shell tool become broken at 1.0.88 1.0.87 is working correctly
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

@mentalzenith what do you see if you run:
Get-Command bash

or

where bash

@rekram1-node commented on GitHub (Nov 23, 2025): @mentalzenith what do you see if you run: `Get-Command bash` or `where bash`
Author
Owner

@mentalzenith commented on GitHub (Nov 23, 2025):

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Windows\system32> Get-Command bash

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     bash.exe                                           10.0.19... C:\Windows\system32\bash.exe


PS C:\Windows\system32> where bash
PS C:\Windows\system32>
@mentalzenith commented on GitHub (Nov 23, 2025): ``` Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Windows\system32> Get-Command bash CommandType Name Version Source ----------- ---- ------- ------ Application bash.exe 10.0.19... C:\Windows\system32\bash.exe PS C:\Windows\system32> where bash PS C:\Windows\system32> ```
Author
Owner

@mentalzenith commented on GitHub (Nov 23, 2025):

Asking opencode to run "Get-Command bash" directly gives

# Attempting to run the PowerShell cmdlet Get-Command to locate bash
$ Get-Command bash
<3>WSL (9 - Relay) ERROR: CreateProcessCommon:798: execvpe(/bin/bash) failed: No such file or directory
@mentalzenith commented on GitHub (Nov 23, 2025): Asking opencode to `run "Get-Command bash" directly` gives ``` # Attempting to run the PowerShell cmdlet Get-Command to locate bash $ Get-Command bash <3>WSL (9 - Relay) ERROR: CreateProcessCommon:798: execvpe(/bin/bash) failed: No such file or directory ```
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

Maybe my logic is messed up, but it should only be using bash if you have it in your path, idk why it fails but ill look into it for you

@rekram1-node commented on GitHub (Nov 23, 2025): Maybe my logic is messed up, but it should only be using bash if you have it in your path, idk why it fails but ill look into it for you
Author
Owner
@rekram1-node commented on GitHub (Nov 23, 2025): https://github.com/sst/opencode/blob/25b3846694fd548074e72a4cc694d5e7374f6235/packages/opencode/src/tool/bash.ts#L73
Author
Owner

@mentalzenith commented on GitHub (Nov 23, 2025):

Let me know if there's anything I can help, many thanks

@mentalzenith commented on GitHub (Nov 23, 2025): Let me know if there's anything I can help, many thanks
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

okay fixed in next release, im gonna do something better later.

Need to make something that'll work better for windows and windows wsl users

@rekram1-node commented on GitHub (Nov 23, 2025): okay fixed in next release, im gonna do something better later. Need to make something that'll work better for windows and windows wsl users
Author
Owner

@nikitakot commented on GitHub (Nov 23, 2025):

@rekram1-node as soon as Ubuntu wsl is installed on Windows it adds bash to path, imo shell should be configurable via config and maybe default to bash.exe from Git? claude code does that

or do you think defaulting to pwsh.exe or cmd.exe is a better option on Windows?

@nikitakot commented on GitHub (Nov 23, 2025): @rekram1-node as soon as Ubuntu wsl is installed on Windows it adds bash to path, imo shell should be configurable via config and maybe default to bash.exe from `Git`? [claude code](https://code.claude.com/docs/en/setup#windows-setup) does that or do you think defaulting to pwsh.exe or cmd.exe is a better option on Windows?
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

Yeah I wanna do something like that for sure

@rekram1-node commented on GitHub (Nov 23, 2025): Yeah I wanna do something like that for sure
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3067