GitLab shell运行器无法上载大于63KB的工件:&Quot;501未实现&Quot; [英] Gitlab shell runner cannot upload artifacts larger than 63KB : "501 Not Implemented"

查看:24
本文介绍了GitLab shell运行器无法上载大于63KB的工件:&Quot;501未实现&Quot;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将作业项目与GitLab CI配合使用时遇到问题。

我正在开发停靠的Web应用程序。我用docker-compose运行了这个应用程序,并在上面运行了一些测试。 当测试失败时,测试框架会截取一些屏幕截图。然后,我将屏幕截图复制到build目录,并尝试将它们作为构件上传,但是我得到了以下信息:

Uploading artifacts...
Runtime platform                                    arch=amd64 os=linux pid=6560 revision=d0b76032 version=12.0.2
src/tests/_output/: found 5 matching files         
WARNING: Uploading artifacts to coordinator... failed  id=11975 responseStatus=501 Not Implemented status=501 Not Implemented token=EyreCNs7
WARNING: Retrying...                                error=invalid argument
WARNING: Uploading artifacts to coordinator... failed  id=11975 responseStatus=501 Not Implemented status=501 Not Implemented token=EyreCNs7
WARNING: Retrying...                                error=invalid argument
WARNING: Uploading artifacts to coordinator... failed  id=11975 responseStatus=501 Not Implemented status=501 Not Implemented token=EyreCNs7
FATAL: invalid argument                            
ERROR: Job failed: exit status 1

舞台配置如下:

upload_screenshots:
  stage: upload_screenshots
  script:
    - docker cp myapp_php_test:/var/www/html/myapp/tests/_output/. src/tests/_output/
  when: on_failure
  artifacts:
    paths:
      - src/tests/_output/
    expire_in: 1 week

我创建了一个测试项目,只需创建一个文本文件并将其作为工件上传,它就可以按预期工作:

test:
  script: 
    - echo "test" > test.txt
    - ls -la
  artifacts:
    paths:
    - test.txt
    expire_in: 1 week
$ echo "test" > test.txt
Uploading artifacts...
Runtime platform                                    arch=amd64 os=linux pid=101330 revision=d0b76032 version=12.0.2
test.txt: found 1 matching files                   
Uploading artifacts to coordinator... ok            id=11946 responseStatus=201 Created token=xmkvqina
Job succeeded

我运行的是GitLab CE 11.3.5(C74e8d9)和GitLab Runner 12.0.2(D0b76032)。各个服务器不在同一子网上。我想可能是我们的代理人,但我不知道怎么确定。此外,我的测试项目工作正常。

如何调试?
有没有办法在GitLab-ci配置中使用工件上载程序详细模式?

更新

这似乎是文件大小问题。由于某些原因,我无法上载大于63KB的文件。

stages:
  - passes
  - fails

passes:
  stage: passes
  when: always
  script:
    - dd if=/dev/urandom of=test.dat  bs=63K  count=1
  artifacts:
    paths:
      - "*.dat"

fails:
  stage: fails
  when: always
  script:
    - dd if=/dev/urandom of=test.dat  bs=64K  count=1
  artifacts:
    paths:
      - "*.dat"

推荐答案

该死的代理😓
将配置项设置中的no_proxy环境变量设置为我们的内部子域后,项目上载将按预期工作。
变量也可以在/etc/systemd/system/gitlab-runner.service.d/http-proxy.conf中设置,如the docs中所述:

[Service]
Environment="HTTP_PROXY=http://proxy.my.domain.org:8080/"
Environment="NO_PROXY=my.domain.org"

这篇关于GitLab shell运行器无法上载大于63KB的工件:&Quot;501未实现&Quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆