作业以错误结束 "WARNING: Uploading artifacts as "archive" to coordinator... failed"

Job ends with error "WARNING: Uploading artifacts as "archive" to coordinator... failed"

我正在尝试在我的本地 Windows 机器上 docker 中设置一个 GitLab ce 服务器 运行。尝试配置 GitLab CI,我在作业结束时上传工件时遇到问题:

警告:将工件作为“存档”上传到协调器...失败 id=245 responseStatus=500 内部服务器错误状态=500 token=i3yfe7rf

在显示更多日志之前,这是我的设置。我正在使用不同的容器

这是唯一注册跑步者的 config.toml 文件。请注意,此版本使用本地 s3 服务器,但本地缓存也是如此。

[[runners]]
  name = "Docker Runner"
  url = "http://192.168.1.18:6180/"
  token = "JHubtvs8kFaQjJNC6r6Z"
  executor = "docker"
  clone_url = "http://192.168.1.18:6180/"
  [runners.custom_build_dir]
  [runners.cache]
    Type = "s3"
    Path = "mycustom-s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "192.168.1.18:9115"
      AccessKey = "XXXXXX"
      SecretKey = "XXXXXX"
      BucketName = "runner"
      Insecure = true
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "docker:19.03.1"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

这是我的 CI YAML 文件:我从 YouTube 视频中获取了这个示例。 GitLab 中的所有项目都会发生同样的情况。

image: "ruby:latest"

cache:
  paths:
    - output

before_script:
  - bundle install --path vendor  # Install dependencies into ./vendor/ruby

build:
  stage: build
  tags:
    - docker,ruby
  artifacts:
    paths:
      - output/
    expire_in: 5 days   
  script:
    - echo "In the build stage"
    - mkdir -p output
    - echo date > output/$(date +%s).txt
    - ls -l output
    - ls -l vendor

运行 作业以上述错误结束。

在日志文件中可以看到更多错误:

{“严重性”:“错误”,“时间”:“2020-12-16T11:24:11.865Z”,“correlation_id”:“ZxQ4vVdD1J1”,“tags.correlation_id” :"ZxQ4vVdD1J1","tags.locale":"en","exception.class":"Errno::ENOENT","exception.message":"没有这样的文件或目录@ apply2files - /var/opt/gitlab/gitlab-rails/shared/artifacts/tmp/work/1608117851-2655-0006-1409/artifacts.zip...

过去 3 天我一直在寻找这个问题的根源,尽管阅读了很多文章(在这里或 GitLab 支持网站上),但我无法解决这个问题。

错误表明这是文件 /var/opt/gitlab/gitlab-rails/shared/artifacts/tmp/work/1608117848-2659-0005-4872/artifacts.zip 的问题。 当然,目录 /var/opt/gitlab/gitlab-rails/shared/artifacts/tmp/work/ 存在。 但是子目录 1608117848-2659-0005-4872 没有。

今天早上遇到了同样的问题,终于帮我解决了。

我在 gitlab 容器中为 data/config/log 卷使用绑定挂载,这显然会在上传工件时造成问题。

我现在改用 docker 卷,现在可以上传工件了。