繁体   English   中英

您如何解决 GitLab 错误“来自守护程序的错误响应:无效条件:'未运行'”?

[英]How do you resolve the GitLab error "Error response from daemon: invalid condition: 'not-running'"?

我设置了一个 Windows GitLab 运行器,它应该从我们的容器注册表下载 Docker 映像,然后在管道中运行构建脚本。 不幸的是,由于以下错误,Docker 容器永远不会启动:

Running with gitlab-runner 15.1.0 (76984217)
  on WindowsDockerRunner wZMWQZYi
Resolving secrets
Preparing the "docker-windows" executor
Using Docker executor with image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Pulling docker image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Using docker image sha256:e6b07227af5ca9303c2112b574f6f27f38135bbf9df29d829142410221967401 for mcr.microsoft.com/windows/servercore:ltsc2019 with digest mcr.microsoft.com/windows/servercore@sha256:26c6c296a4737ba478fe3c3e531b098f89b5562c40b416ba6fb8177ac462d1af ...
Preparing environment
Running on RUNNER-WZMWQZYI via 
runner2...
ERROR: Job failed (system failure): prepare environment: Error response from daemon: invalid condition: "not-running". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

错误消息并不清楚 state 问题的原因是什么,并且它引用的文档没有提到任何关于“条件”的内容。 Based on the link pointing to shell profiles I suspect it might have something to do with the shell that's being run, but when I run the Docker container locally it boots into PowerShell just fine.

有谁知道如何解决这个问题?

I came across this issue after installing Docker Engine using the Windows Server install script , which fetches docker.exe and dockerd.exe from https://master.dockerproject.org , These builds were last updated in March 2022, I found gitlab-runner 14.9 及更早的版本可以正常使用此版本(2022 年 3 月之前发布),但 14.10 不能(2022 年 4 月 19 日发布)也不能使用任何更新的版本。

安装 Docker Desktop 解决了这个问题,因为它提供了最新版本。 但是,使用 Docker Desktop 会引入许可问题。 另一种方法是手动安装 Docker 引擎/更新微软脚本下载的版本。

Docker Engine builds are provided on the Moby GitHub project to download from https://download.docker.com/win/static/stable/x86_64/ downloading the lastest version from here and replacing the docker executables in C:\Windows\System32 fixes问题,使用最新的 gitlab-runner。

另一种方法是使用docker-engine Chocolatey package (我顺便维护一下),它为上述稳定版本提供安装脚本:

choco install docker-engine

Windows-Containers 团队还有一个悬而未决的问题,即关闭(过时的)夜间: https://github.com/microsoft/Windows-Containers/issues/256 ,它将通过 Microsoft 提供稳定的 docker 构建推荐的安装方法。

终于可以解决这个问题了。 我们在 GitLab Runner 上安装了Docker 引擎,但这对于 GitLab CI/CD 似乎还不够。 在运行器上安装Docker Desktop后,问题消失了,我们能够运行管道。

经过一些试验和错误后,我启动并运行了它。

我有另一台服务器运行 gitlab-runner 和 docker 没有任何问题(没有安装 docker 桌面,由于许可问题,这是不允许的)。 我现在尝试设置的服务器是“冗余”构建服务器。

所以为了找出我的问题,我开始将东西从一个构建服务器切换到另一个。 目前看来,只需降级到 gitlab-runner V13.4.0 就足够了。

我确实重新注册了跑步者,因为 gitlab 声明 V15.xx 版本正在使用执行程序“未知”。

不知道那里发生了什么,但至少我现在可以继续建造。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM