Gitlab Windows runner 在收到工作时转为 not 运行

Gitlab Windows runner turns to not running when receive a job

我完全按照官方document设置我的Windows 运行ner,我可以成功注册并安装运行ner,我使用shell 在注册执行器时,在我启动 运行ner 并检查状态后,它显示 运行ning 没有任何问题。但是当我触发一个标记为 windows 运行ner 的作业时,作业将一直挂起,当我再次检查 运行ner 状态时,它会变成 不是 运行ning

我在 Window 7 和 Window 10 上都试过了,都遇到了同样的问题。

我也试过运行

gitlab-runner --debug run

但日志只显示 运行ner 可以接收作业,但无声地崩溃了。

C:\GitLab-Runner>gitlab-runner.exe --debug run
Runtime platform                                    arch=amd64 os=windows pid=15912 revision=d0b76032 version=12.0.2
Starting multi-runner from C:\GitLab-Runner\config.toml ...  builds=0
Checking runtime mode                               GOOS=windows uid=-1
Configuration loaded                                builds=0
listenaddress: ""
sessionserver:
  listenaddress: ""
  advertiseaddress: ""
  sessiontimeout: 1800
concurrent: 1
checkinterval: 0
loglevel: null
logformat: null
user: ""
runners:
- name: window 10
  limit: 0
  outputlimit: 0
  requestconcurrency: 0
  runnercredentials:
    url: https://gitlab.com/
    token: 6e46f139636cfea3ce2301be1b4225
    tlscafile: ""
    tlscertfile: ""
    tlskeyfile: ""
  runnersettings:
    executor: shell
    buildsdir: ""
    cachedir: ""
    cloneurl: ""
    environment: []
    preclonescript: ""
    prebuildscript: ""
    postbuildscript: ""
    debugtracedisabled: false
    shell: powershell
    custombuilddir:
      enabled: false
    ssh: null
    docker: null
    parallels: null
    virtualbox: null
    cache:
      type: ""
      path: ""
      shared: false
      s3:
        serveraddress: ""
        accesskey: ""
        secretkey: ""
        bucketname: ""
        bucketlocation: ""
        insecure: false
      gcs:
        cachegcscredentials:
          accessid: ""
          privatekey: ""
        credentialsfile: ""
        bucketname: ""
    machine: null
    kubernetes: null
sentrydsn: null
modtime: 2019-07-16T14:59:02.7487831+02:00
loaded: true
  builds=0
listen_address not defined, metrics & debug endpoints disabled  builds=0
[session_server].listen_address not defined, session endpoints disabled  builds=0
Starting worker                                     builds=0 worker=0
Feeding runners to channel                          builds=0
Dialing: tcp gitlab.com:443 ...
Checking for jobs... nothing                        runner=6ee6f139
Feeding runners to channel                          builds=0
Checking for jobs... nothing                        runner=6ee6f139
Feeding runners to channel                          builds=0
Checking for jobs... received                       job=33225 repo_url=https://gitlab.com/my-project/repo.git runner=6ee6f139
Failed to requeue the runner:                       builds=1 runner=6ee6f139
Running with gitlab-runner 12.0.2 (d0b76032)        job=33225 project=278 runner=6ee6f139
  on window 10 6ee6f139                             job=33225 project=278 runner=6ee6f139
Shell configuration: environment: []
dockercommand:
- PowerShell
- -NoProfile
- -NoLogo
- -InputFormat
- text
- -OutputFormat
- text
- -NonInteractive
- -ExecutionPolicy
- Bypass
- -Command
- '-'
command: powershell
arguments:
- -noprofile
- -noninteractive
- -executionpolicy
- Bypass
- -command
passfile: true
extension: ps1
  job=33225 project=278 runner=6ee6f139
Using Shell executor...                             job=33225 project=278 runner=6ee6f139
Waiting for signals...                              job=33225 project=278 runner=6ee6f139
Executing build stage                               build_stage=prepare_script job=33225 project=278 runner=6ee6f139
Executing build stage                               build_stage=get_sources job=33225 project=278 runner=6ee6f139

我设法找出原因。 我的GitLab版本是11.4.0-ee,Windowsgitlab runner版本是12.0.2,从日志可以看出。在我将 runner 降级到版本 11.11.4 后,它立即运行没有任何问题。在作业日志中,我可以看到一条消息:

DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab

我觉得升级Gitlab服务器应该也能解决问题。这是一个版本不匹配的问题。