【问题标题】:Bitbucket self hosted runner failing during step setupBitbucket 自托管运行器在步骤设置期间失败
【发布时间】:2021-07-28 15:33:40
【问题描述】:

我尝试在 Atlassian/Bitbucket 社区支持中发布此内容,但我的帖子并未在此处发布。他们甚至没有显示为待处理/需要审核/无论如何。

我无法弄清楚为什么在设置过程中某个步骤会失败。我正在运行一个自托管的运行器(并为运行器容器提供 6 GB 内存,所以我认为这不是 OOM 错误)并且我正在测试一个相当简单的管道:

第 1 步 - 根据需要增加版本 - 超轻量级 - 顺利通过。

第 2 步 - 将 go 可执行文件构建到 Docker 映像中,发布到 gcr.io - 仍然非常轻量级 - 在设置过程中失败

这是我的 bitbucket-pipelines.yml:

image:
  name: gcr.io/novo00/bitbucket-pipelines:latest
  username: _json_key
  password: '$NOVO_GCR_IO_JSON_KEY'
pipelines:
  branches:
    master:
      - step:
          runs-on:
            - self.hosted
          script:
            - build/bitbucket_pipelines/version.sh
      - step:
          runs-on:
            - self.hosted
          script:
            - build/bitbucket_pipelines/build.sh
          services:
            - docker

这是管道仪表板中“构建设置”的输出:

+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIRCloning into '/opt/atlassian/pipelines/agent/build'...

之后什么都没有,然后进入“构建拆解”。

这是我的跑步者标准输出的 sn-p:

[2021-07-27 21:52:30,706] Starting container.
[2021-07-27 21:52:30,739] Adding container log: /var/lib/docker/containers/02152994b7d0485fa65a5dd8a4dd5254ea1c7a41b9b00f98ed5478245e3255da/02152994b7d0485fa65a5dd8a4dd5254ea1c7a41b9b00f98ed5478245e3255da-json.log
[2021-07-27 21:52:30,740] Waiting on container to exit.
[2021-07-27 21:52:30,741] Creating exec into container.
[2021-07-27 21:52:30,749] Starting exec into container and waiting for exec to exit.
[2021-07-27 21:52:30,949] Adding container log: /var/lib/docker/containers/1467fcbb959c9f17eacd2bc04967e4fe8042ba1fbc3bcb0a345d6da6db1717d0/1467fcbb959c9f17eacd2bc04967e4fe8042ba1fbc3bcb0a345d6da6db1717d0-json.log
[2021-07-27 21:52:30,949] Waiting on container to exit.
[2021-07-27 21:52:30,981] Adding container log: /var/lib/docker/containers/a62ece4849a5ee784f4f483d58eb87c3684f52ebca35308e6d485e014a17ac99/a62ece4849a5ee784f4f483d58eb87c3684f52ebca35308e6d485e014a17ac99-json.log
[2021-07-27 21:52:30,981] Waiting on container to exit.
[2021-07-27 21:52:31,051] Container has state (exitCode: Some(4), OOMKilled Some(false))
[2021-07-27 21:52:31,054] Removing container build
[2021-07-27 21:52:31,065] Not uploading caches. (numberOfCaches: 0, resultOrError: FAILED)
[2021-07-27 21:52:31,066] Not uploading artifacts. (numberOfArtifacts: 0, resultOrError: FAILED)
[2021-07-27 21:52:31,066] Updating step progress to PARSING_TEST_RESULTS.
[2021-07-27 21:52:31,401] Test report processing complete.
[2021-07-27 21:52:31,401] Removing container clone
[2021-07-27 21:52:31,562] Removing container clone
[2021-07-27 21:52:31,565] Removing container build
[2021-07-27 21:52:31,568] Removing container system-docker
[2021-07-27 21:52:31,583] Removing container system-auth-proxy
[2021-07-27 21:52:31,698] Removing container pause
[2021-07-27 21:52:31,749] Appending log line to log: {bc88f95e-9f7b-425a-adaf-e3060f3a53ee}.
[2021-07-27 21:52:31,754] Appending log line to main log.
[2021-07-27 21:52:31,861] Updating step progress to COMPLETING_LOGS.
[2021-07-27 21:52:31,972] Appending log line to log: {71708781-63f3-46de-8042-730f079fe9d6}.
[2021-07-27 21:52:32,009] Shutting down log uploader.
[2021-07-27 21:52:32,224] Tearing down directories.
[2021-07-27 21:52:32,227] Cancelling timeout
[2021-07-27 21:52:32,228] Completing step with result Result{status=FAILED, error=None}.

注意Container has state (exitCode: Some(4), OOMKilled Some(false)) 有什么帮助吗?我可以提供任何其他数据吗?我尝试查看输出中提到的一些日志,但它们要么不再存在,要么没有包含太多有用的信息。

更新:从步骤 2 中删除 services: - docker 修复了当前问题,但我需要可用于该步骤的 docker 服务。现在正在寻找解决方法。

【问题讨论】:

    标签: bitbucket-pipelines self-hosting


    【解决方案1】:

    我在使用自托管运行器时遇到了一些问题。经过2天的互联网挖掘,我知道:

    1. 自托管 docker 运行器在大多数情况下都能正常工作
    2. 除了 docker-in-docker 情况外,它们运行良好。如果您需要在管道中运行 docker,您应该使用选定的 Linux 类型和版本。我已经测试了 Debian 9、Debian 11、Ubuntu 20 LTS、CentOS8、CentOS 7.9.2009。只有最后一个工作正常。
    3. 即使您使用兼容的 Linux 安装,您也可能在 docker 构建过程中遇到问题。不同的问题。感谢this post,我已经解决了。
    4. 如果您使用 WSL2 和 DockerDesktop,您将没有来自容器的任何日志。这是由于 DD 中的另一个日志文件位置(并且它们在执行 WSL 机器时不可用)。如果您需要日志(即用于调试)并且使用 Windows,只需在 Linux 中安装 VirtualBox,在其中设置 docker 和其他运行程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-28
      • 2020-12-08
      • 2020-12-28
      • 1970-01-01
      • 2018-09-02
      • 1970-01-01
      • 2019-05-01
      相关资源
      最近更新 更多