Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Containers » There has been a runner system failure: failed to start the process exec “pwsh”
  • fgbv
    Export and Import Scheduled Tasks in Windows Windows Server
  • ycx
    Install SysInternals from the Microsoft Store Windows
  • Featured image DNS Server settings
    Do not use Public DNS in Prod: Change DNS Server in Windows Network | Monitoring
  • Route53AWS
    Set up and configure Route 53 for your Domain in AWS AWS/Azure/OpenShift
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox: Restoring Backups on XTM Device Network | Monitoring
  • Fix invalid backup repostory and delete not needed repo via Veeam Backup Repository
    Fix missing path and delete a Veeam Backup Repository Backup
  • unnamed
    Upgrade ManageEngine Password Manager Pro Password Manager
  • screenshot 2020 03 15 at 00.58.30
    Fix failed to open session for the virtual machine GNS3 VM Network | Monitoring

There has been a runner system failure: failed to start the process exec “pwsh”

Posted on 05/10/202110/04/2023 Christian By Christian No Comments on There has been a runner system failure: failed to start the process exec “pwsh”
GitLabrunner-1-1

The Shell executor is a simple executor that you use to execute builds locally on the machine where GitLab Runner is installed. It supports all systems on which the Runner can be installed. That means that it’s possible to use scripts generated for Bash, PowerShell Core, Windows PowerShell, and Windows Batch (deprecated). As I said before, Shell is the simplest executor to configure. All required dependencies for your builds need to be installed manually on the same machine that GitLab Runner is installed on. In this article, you will learn how to fix there has been a runner system failure: failed to start the process exec “pwsh”. Here are some related articles: Linux containers: How to install LXC/LXD for container management, The executor requires OSType=windows, but Docker engine supports OStypelinux, and how to fix Error: cannot lock ref ‘refs/remotes/origin/windows’.

Why was the error “There has been a runner system failure, Job failed, prepare the environment: failed to start the process, exec: “pwsh” prompted?

The following error "There has been a runner system failure, please try again: ERROR: Job failed (system failure): prepare the environment: failed to start process: exec: "pwsh": executable file not found in %PATH%" can result because the “pwsh” entry for the shell attribute in gitlab-runner config.toml does not work in some WIN10 machines. You may also want to see “how to install, register and start GitLab Runner on Windows“. And how to uninstall GitLab from your Windows device.

PowerShell Desktop Edition is the default shell when a new runner is registered on Windows using GitLab Runner 12.0-13.12. In 14.0 and later. The default is PowerShell Core Edition. PowerShell doesn’t support executing the build-in context of another user.

Screenshot-2021-10-04-at-17.30.00

Modify the Config.toml file

GitLab Runner supports certain shells. To select a shell, specify it in your config.toml file. For example. So I had to edit the confg.toml like follows.

Screenshot-2021-10-05-at-17.40.08

Resolution: Replace the Shell Executor with PowerShell

Below is the syntax of the config.toml file that is currently being edited to resolve this issue.

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "windows10 runner with Shell"
  url = "https://gitlab.com/"
  token = "xxxxxxxxxxxxxxxxxx"
  executor = "shell"
  shell = "pwsh"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

I had to replace the shell executor with the following shell = “powershell” as shown below. You may also see this official guide from Docker on how this was defined.

Screenshot-2021-10-05-at-17.45.05

Here are some related VMware guides: How to create and delete a snapshot on VMware Workstation. How to extend a VM’s Hard Disk on VMware Workstation, and how to install Docker Desktop and register GitLab-Runner with Docker. How to Failure 5456: Unable to determine destination disk, partition, and how to install Windows Server 2022 on VMware Workstation.

Restart The GitLab Services

When this is done, GitLab-runner should reload automatically. But to be safe, just restart manually to ensure it takes effect.

gitlab-runner.exe restart
Screenshot-2021-10-05-at-17.49.16

Alternatively, you can restart via the services.msc as shown below.

Screenshot-2021-10-05-at-17.48.02

Note: Generally it’s unsafe to run tests with shell executors. The jobs are run with the user’s permissions (gitlab-runner) and can “steal” code from other projects that are run on this server. Use it only for running builds on a server you trust and own. Kindly refer to this guide for more information.

Here are some related guides: How to install Git on macOS, How to uninstall Git on macOS, Practical Git use with mackdown, how to clone a repository and install software from GitHub on Windows, how to use AWS CodeCommit, Azure DevOps and GitHub integration for Docker and Kubernetes deployment, and how to build your first CI/CD Pipeline in Azure DevOps using ASP.Net Core Application.

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Containers Tags:docker, docker hub, docker image, Microsoft Windows, PowerShell, PowerShell version 7, Windows 10, Windows Server 2016

Post navigation

Previous Post: Mastering Vim in Linux: How to Create, Edit, Save, and Quit Files
Next Post: Failed to remove network for build: Error during connect in the default daemon configuration on Windows, the Docker client must be run with elevated privileges

Related Posts

  • Slide2
    How to Setup Jenkins Pipelines Environment for Docker Container Deployment Containers
  • DockerEn
    How to Install and Upgrade Docker Engine From Binaries Containers
  • kubernetes
    Create and monitor Apps using the Azure Kubernetes Service manifest AWS/Azure/OpenShift
  • Windowsfilesystemxx
    Failed to remove network for the build, Job failed error: Invalid volume specification: “/cache” Containers
  • update Docker desktop
    How to manually update Docker desktop Containers
  • docker desktop 1
    Failed to remove network for build: Error during connect in the default daemon configuration on Windows, the Docker client must be run with elevated privileges Containers

More Related Articles

Slide2 How to Setup Jenkins Pipelines Environment for Docker Container Deployment Containers
DockerEn How to Install and Upgrade Docker Engine From Binaries Containers
kubernetes Create and monitor Apps using the Azure Kubernetes Service manifest AWS/Azure/OpenShift
Windowsfilesystemxx Failed to remove network for the build, Job failed error: Invalid volume specification: “/cache” Containers
update Docker desktop How to manually update Docker desktop Containers
docker desktop 1 Failed to remove network for build: Error during connect in the default daemon configuration on Windows, the Docker client must be run with elevated privileges Containers

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • fgbv
    Export and Import Scheduled Tasks in Windows Windows Server
  • ycx
    Install SysInternals from the Microsoft Store Windows
  • Featured image DNS Server settings
    Do not use Public DNS in Prod: Change DNS Server in Windows Network | Monitoring
  • Route53AWS
    Set up and configure Route 53 for your Domain in AWS AWS/Azure/OpenShift
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox: Restoring Backups on XTM Device Network | Monitoring
  • Fix invalid backup repostory and delete not needed repo via Veeam Backup Repository
    Fix missing path and delete a Veeam Backup Repository Backup
  • unnamed
    Upgrade ManageEngine Password Manager Pro Password Manager
  • screenshot 2020 03 15 at 00.58.30
    Fix failed to open session for the virtual machine GNS3 VM Network | Monitoring

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.