Version Control System (VSC)

GitLab-runner is not recognized as an internal or external command, operable program, or batch file

Gitfixed

GitLab Runner is open-source and written in Go. It can be run as a single binary; no language-specific requirements are needed. GitLab Runner can also run inside a Docker container or be deployed into a Kubernetes cluster. After you install the application, you register individual runners. Runners are the agents that run the CI/CD jobs that come from GitLab. When you register a runner, you are setting up communication between your GitLab instance and the machine where GitLab Runner is installed. 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.

Runners usually process jobs on the same machine where you installed GitLab Runner. However, you can also have a runner process jobs in a container, in a Kubernetes cluster, or in auto-scaled instances in the cloud. See this guide on how to install, register and start GitLab Runner on Windows.

Most times, this issue is associated with the Enviornment variable not defined etc. But in this case, it has nothing to do with it. Below are some guides relating to Environment variables in Windows 10, Windows Error “Not recognised as an internal or external program” – Environment Variable, and how to uninstall Oracle Database 11G or 12c.

Screenshot-2021-09-27-at-23.50.43

After spending some time troubleshooting this error, I decided to view the file name extension. And this led to the resolution of the issue.
Rememeber in GitLab-Runner guide, you are optionally required to rename this file as "GitLab-runner.exe". If you do not display the filename extenstion, you willautomatically be adding another .exe extensio to it : )

Screenshot-2021-09-28-at-00.02.00

As you can see below, displaying the File name extension revealed the root cause.

Screenshot-2021-09-28-at-00.02.26

We will have to rename it by deleting the .exe from the file name. What we should have left should be just "GitLab-runner.exe"

Screenshot-2021-09-28-at-00.04.03

Upon taking the extra extension off the “GitLan-runner.exe”, you should be able to determine the version number and also run “GitLab-runner” without adding the .exe to it as shown below. You may want to see this related guide “Panic: Failed to register the GitLab-runner, you may be having network issues“.

Screenshot-2021-09-28-at-00.04.49

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

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Kindly subscribe to TechDirectArchive
This is default text for notification bar