-
Notifications
You must be signed in to change notification settings - Fork 1k
Unable to run bash scripts on a windows installed runner #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same behavior on my self-hosted windows runner 😞 Execute the following action
gives the following error
PowerShell can execute bash, but it seems that the runner cannot find it. I'd appreciate any help anybody can provide. |
Hi @olivier-jourdan, You can invoke it with:
|
Hi @brian-pickens, @olivier-jourdan,
As you can see, I created steps with The following image shows the output of my action: Can you check if you still get that error on the newer version of the runner? |
It still happens, but only if you use
You cannot reproduce it with a mingw, msys or cygwin bash shell in your PATH ( only if it is found before searching in the system32 directory ), which you have installed through git for windows. |
Hi @ChristopherHX, |
Hi, at the moment I am also facing the exact same issue. |
@ruvceskistefan For some reason when spawning For more context I am using Edit: This is on |
Unfortunately we are no longer using a windows runner so I'm unable to test. However I don't believe your test case is valid. In our case we were passing a path the step ENV property, which was consumed by the terraform cli to execute. However it appeared that the path that was actually passed to the ENV variable contained none of the forward slashes. The other difference I noticed is that I was using windows subsystem for linux on the host machine while you are using GIT Bash. |
Does anyone know how to use Git Bash in a Windows runner if WSL is installed? It seems like it isn't part of PATH and there's no way to map |
Could someone please help. I am having exact same issue ! |
I was able to solve this by uninstalling Ubuntu, WSL 2 feature and then by restarting runner. Now only Git Bash is there so it started working ! any one facing this problem can workaround this way until GitHub can implement WSL Bash support ! I wish GitHub can improve documentation so we don't have to struggle things much ! |
You can recreate this problem by using a self-hosted Windows runner that has WSL enabled. I wonder if the GitHub runner could be updated to not rely upon PATH to find bash.exe and instead execute using the bash provided by Git for Windows? |
make sure to move the git entry to the top if you still find the WSL version |
It helped me to install WSL |
+1 on this issue. I'm seeing it in the same environment mentioned in other comments, self-hosted Windows runner with WSL2 installed. Using |
In my case I would prefer to use the bash provided by wsl2 (I do not have git-bash installed), but it would be great if this could be included as an explicit option
|
anybody found solution? I won't wait 32 minutes running github hosted runner just to find an error which doesn't happen on my local machine... |
Describe the bug
When trying to run a bash script against a windows runner, all the path separators are missing. Presumably the runner is sending backslashes for windows, but should be sending forward slashes in the case of bash.
https://stackoverflow.com/questions/40396613/forward-slash-vs-backward-slash-for-file-path-in-git-bash/40397237#40397237
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Can execute the temporary *.sh file sent to the runner
Runner Version and Platform
2.281.1
OS of the machine running the runner? OSX/Windows/Linux/...
Windows
What's not working?
Job Log Output
Run terraform init
terraform init
shell: C:\Windows\system32\bash.EXE --noprofile --norc -e -o pipefail {0}
env:
ARM_CLIENT_ID: ***
ARM_CLIENT_SECRET: ***
ARM_SUBSCRIPTION_ID: ***
ARM_TENANT_ID: ***
TERRAFORM_CLI_PATH: C:\runners\win_runner_1\run_temp\988e6fdc-5a58-4292-bb9d-3a9aa0c50f0b
/bin/bash: C:runnerswin_runner_1run_temp0124e743-9c40-4523-bd75-62286f04eb6a.sh: No such file or directory
Error: Process completed with exit code 1.
Runner and Worker's Diagnostic Logs
[2021-09-13 18:29:04Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO HostContext] Well known config file 'Credentials': 'C:\runners\win_runner_1.credentials'
[2021-09-13 18:29:04Z INFO Listener] Runner is built for Windows (X64) - win-x64.
[2021-09-13 18:29:04Z INFO Listener] RuntimeInformation: Microsoft Windows 10.0.17763.
[2021-09-13 18:29:04Z INFO Listener] Version: 2.281.1
[2021-09-13 18:29:04Z INFO Listener] Commit: c8caf59
[2021-09-13 18:29:04Z INFO Listener] Culture: en-US
[2021-09-13 18:29:04Z INFO Listener] UI Culture: en-US
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO Listener] Validating directory permissions for: 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO CommandLineParser] Parse
[2021-09-13 18:29:04Z INFO CommandLineParser] Parsing 2 args
[2021-09-13 18:29:04Z INFO CommandLineParser] parsing argument
[2021-09-13 18:29:04Z INFO CommandLineParser] HasArgs: False
[2021-09-13 18:29:04Z INFO CommandLineParser] Adding Command: configure
[2021-09-13 18:29:04Z INFO CommandLineParser] parsing argument
[2021-09-13 18:29:04Z INFO CommandLineParser] HasArgs: True
[2021-09-13 18:29:04Z INFO CommandLineParser] arg: version
[2021-09-13 18:29:04Z INFO Listener] Arguments parsed
[2021-09-13 18:29:04Z INFO Runner] ExecuteCommand
[2021-09-13 18:29:04Z INFO ConfigurationStore] currentAssemblyLocation: C:\runners\win_runner_1\bin\Runner.Listener.dll
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO ConfigurationStore] binPath: C:\runners\win_runner_1\bin
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO ConfigurationStore] RootFolder: C:\runners\win_runner_1
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO HostContext] Well known config file 'Runner': 'C:\runners\win_runner_1.runner'
[2021-09-13 18:29:04Z INFO ConfigurationStore] ConfigFilePath: C:\runners\win_runner_1.runner
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO HostContext] Well known config file 'Credentials': 'C:\runners\win_runner_1.credentials'
[2021-09-13 18:29:04Z INFO ConfigurationStore] CredFilePath: C:\runners\win_runner_1.credentials
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO HostContext] Well known config file 'MigratedCredentials': 'C:\runners\win_runner_1.credentials_migrated'
[2021-09-13 18:29:04Z INFO ConfigurationStore] MigratedCredFilePath: C:\runners\win_runner_1.credentials_migrated
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Bin': 'C:\runners\win_runner_1\bin'
[2021-09-13 18:29:04Z INFO HostContext] Well known directory 'Root': 'C:\runners\win_runner_1'
[2021-09-13 18:29:04Z INFO HostContext] Well known config file 'Service': 'C:\runners\win_runner_1.service'
[2021-09-13 18:29:04Z INFO ConfigurationStore] ServiceConfigFilePath: C:\runners\win_runner_1.service
[2021-09-13 18:29:04Z INFO CommandSettings] Flag 'help': 'False'
[2021-09-13 18:29:04Z INFO CommandSettings] Flag 'version': 'True'
[2021-09-13 18:29:04Z INFO Terminal] WRITE LINE: 2.281.1
[2021-09-13 18:29:04Z INFO Listener] Runner execution has finished with return code 0
The text was updated successfully, but these errors were encountered: