Gitlab-runner as a windows service does not build automatically

Hello

I just got gitlab-multi-runner running as a service on a windows machine but it won’t build anything and leaves the build status at ‘pending’ on my gitlab server

Strangely enough, when I execute manually with ‘run’, everything works fine

C:\gitlab-runner>gitlab-ci-multi-runner-windows-386.exe run
( It even copies the artifacts to the commit on my gitlab server. Fantastic stuff!!! )

But what can I do to make the service do the job?

c:\gitlab-runner>gitlab-ci-multi-runner-windows-386.exe status
gitlab-runner: Service is running!

c:\gitlab-runner>gitlab-ci-multi-runner-windows-386.exe verify
Veryfing runner… is alive ←[0;m runner←[0;m=9bf8b954

Service executes:
C:\gitlab-runner\gitlab-ci-multi-runner-windows-386.exe run --working-directory C:\gitlab-runner --config C:\gitlab-runner\config.toml --service gitlab-runner --syslog

Logfile entry: ‘Checking for builds… failed’

I’m experiencing the exact same behavior. Were you ever able to resolve the issue?

Running as a Windows service, I get no error messages; but the runner never picks up any jobs. If I execute the runner manually, using “run,” it works as expected.

So I’m not sure what the service is doing. :-/

At the moment I have a working build server with gitlab-runner working flawlessly.

If I remember correctly, it was a TLS/SSL problem. I had to copy the .crt file to the windows machine and reference it in the confic.toml.

Hopefully this information helps you. Please adapt for your environment…

my config.toml looks like this:

concurrent = 2
check_interval = 0

[[runners]]
  name = "SharedRunner"
  url = "[your gitlab url]/"
  token = "[your token for the shared runner]"
  tls-ca-file = "certs/[your_ca_crt_file].crt"
  executor = "shell"
  environment = ["GIT_SSL_NO_VERIFY=1"]
  [runners.cache]

folder hierarchy:

18

shared runner settings:

.gitlab-ci.yaml project settings:

before_script:
  - echo "starting build for ..."
  - echo "Restoring NuGet Packages..."
  - c:\BuildTools\nuget.exe restore [your_solution_file].sln
  
stages:
  - build

job:
  stage: build
  script:
  - echo "Release build..."
  - '"C:\BuildTools\VS2019\MSBuild\Current\Bin\MSBuild.exe"  [your_solution_file].sln /p:Configuration=Release /p:DeployOnBuild=true'
  artifacts:
    name: "[your_project_name]_%CI_COMMIT_TAG%"
    paths:
    - [your_build_path]/bin/Release
    when: on_success
    expire_in: 3 mos
  tags:
  only:
  - tags