Windows Runner 17.5.0 broken

Summary

When using GitLab Runner 17.5.0, Windows Runners will fail to run and get the following error messages.

Remove-Item: Cannot process command because of one or more missing mandatory parameters: Path.
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.example.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.example.com/clsb_user_01/zd576799_windows_runner.git/'

Steps to reproduce

  • Install GitLab Runner 17.4.0 on a Windows Runner.
  • Create a Dummy project with the following .gitlab-ci.yml.
stages:
  - test
 
.windows-test:
  stage: test
  timeout: 30m
  before_script:        
    - Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
    - pwsh --version
  script:
    - Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
    - pwsh --version


windows-runner:
  extends:
    - .windows-test
  tags:
    - win
  • Observe the the job completes.
  • Upgrade the runner version to 17.5.0.
  • Run a new pipeline and observe that the error is raised.
Remove-Item: Cannot process command because of one or more missing mandatory parameters: Path.
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.example.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.example.com/clsb_user_01/zd576799_windows_runner.git/'
.gitlab-ci.yml
stages:
  - test
 
.windows-test:
  stage: test
  timeout: 30m
  before_script:        
    - Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
    - pwsh --version
  script:
    - Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
    - pwsh --version


windows-runner:
  extends:
    - .windows-test
  tags:
    - win

Actual behavior

Job does not complete and raises authentication error.

Expected behavior

Job should not raise authentication error.

Relevant logs and/or screenshots

job log
# 17.4.0
Running with gitlab-runner 17.4.0 (b92ee590)
  on XXXX x2sxQAKNs, system ID: XXXX
Resolving secrets
Preparing the "shell" executor
00:00
Using Shell (pwsh) executor...
Preparing environment
00:01
Running on XXXX...
Getting source from Git repository
00:07
Fetching changes with git depth set to 20...
Initialized empty Git repository in C:/GitLab-Runner/builds/x2sxQAKNs/0/clsb_user_01/zd576799_windows_runner/.git/
Created fresh repository.
Checking out 2168760a as detached HEAD (ref is main)...
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:02
$ Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
PowerShell 7.4.5
Caption                   CSDVersion OSArchitecture BuildNumber
-------                   ---------- -------------- -----------
Microsoft Windows 10 Home            64-bit         19045
$ pwsh --version
$ Invoke-WebRequest https://httpbin.org/ip
                                                    
$ Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, CSDVersion, OSArchitecture, BuildNumber
Microsoft Windows 10 Home            64-bit         19045
$ pwsh --version
PowerShell 7.4.5
Cleaning up project directory and file based variables
00:01
Job succeeded

# 17.5.0

Running with gitlab-runner 17.5.0 (66a723c3)
  on XXXX x2sxQAKNs, system ID: XXXX
Resolving secrets
Preparing the "shell" executor
00:00
Using Shell (pwsh) executor...
Preparing environment
00:01
Running on XXXX...
Getting source from Git repository
00:06
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in C:/GitLab-Runner/builds/x2sxQAKNs/0/clsb_user_01/zd576799_windows_runner/.git/
Remove-Item: Cannot process command because of one or more missing mandatory parameters: Path.
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.example.net/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.example.net/clsb_user_01/zd576799_windows_runner.git/'
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit status 128

Environment description

config.toml contents
concurrent = 1
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "<REDACTED>"
  url = "https://<REDACTED>"
  id = 28
  token = "<REDACTED>"
  token_obtained_at = 2024-10-18T06:17:56Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  shell = "pwsh"
  [runners.custom_build_dir]
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

Used GitLab Runner version

.\gitlab-runner.exe --version
Version:      17.5.0
Git revision: 66a723c3
Git branch:   17-5-stable
GO version:   go1.22.7
Built:        2024-10-17T15:26:50+0000
OS/Arch:      windows/amd64

Possible fixes

Edited by Kent Japhet Ballon