CICD 的新手 我正在运行 CICD 管道来扫描我的代码。扫描后测试任务失败并出现错误
gl-sast-report.json: found 1 matching artifact files and directories
WARNING: Uploading artifacts as "sast" to coordinator... POST http://172.25.64.1:8000/api/v4/jobs/142/artifacts: 500 Internal Server Error id=142 responseStatus=500 Internal Server Error status=500 token=glcbt-64
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST http://172.25.64.1:8000/api/v4/jobs/142/artifacts: 500 Internal Server Error id=142 responseStatus=500 Internal Server Error status=500 token=glcbt-64
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST http://172.25.64.1:8000/api/v4/jobs/142/artifacts: 500 Internal Server Error id=142 responseStatus=500 Internal Server Error status=500 token=glcbt-64
FATAL: invalid argument
管道作业中出现上述错误
当我检查 gitlab 服务器日志时,我看到“不存在这样的文件或目录”错误。不确定这两个错误是否相关。以下是gitlab的错误
server logs ==> /var/log/gitlab/gitlab-rails/exceptions_json.log <==
gitlab-server | {"severity":"ERROR","time":"2024-12-20T21:54:08.859Z","correlation_id":"01JFK10KG85R40P9DGAY4WMP2M","meta.caller_id":"POST /api/:version/jobs/:id/artifacts","meta.remote_ip":"172.18.0.1","meta.feature_category":"job_artifacts","meta.project":"customers-dev/clientapp12","meta.root_namespace":"customers-dev","meta.client_id":"user/1","meta.pipeline_id":40,"meta.job_id":141,"exception.class":"Errno::ENOENT","exception.message":"No such file or directory @ apply2files - /var/opt/gitlab/gitlab-rails/shared/artifacts/tmp/work/1734731648-816-0002-3020/gl-sast-report.json","exception.backtrace":["carrierwave (1.3.4) lib/carrierwave/sanitized_file.rb:319:in `chmod'","carrierwave (1.3.4) lib/carrierwave/sanitized_file.rb:319:in `chmod!'","carrierwave (1.3.4) lib/carrierwave/sanitized_file.rb:187:in `move_to'","carrierwave (1.3.4) lib/carrierwave/uploader/cache.rb:132:in `cache!'","app/uploaders/object_storage.rb:446:in `cache!'","carrierwave (1.3.4) lib/carrierwave/mounter.rb:44:in `block in cache'","carrierwave (1.3.4) lib/carrierwave/mounter.rb:42:in `map'","carrierwave (1.3.4) lib/carrierwave/mounter.rb:42:in `cache'","carrierwave (1.3.4) lib/carrierwave/mount.rb:146:in `file='","carrierwave (1.3.4) lib/carrierwave/orm/activerecord.rb:70:in `file='","activemodel (7.0.8.6) lib/active_model/attribute_assignment.rb:49:in `public_send'","activemodel (7.0.8.6) lib/active_model/attribute_assignment.rb:49:in `_assign_attribute'","activerecord (7.0.8.6) lib/active_record/attribute_assignment.rb:2
以下是我的设置
如果您需要任何配置文件,请告诉我,我可以提供。不想用很多话轰炸这个地方
我没有对 gitlab 容器中的数据/配置/日志卷使用绑定挂载(这显然导致了问题),而是改用了 docker 卷。
没起作用 卷:
工作过 卷: - gitlab-config:/etc/gitlab - gitlab-data:/var/opt/gitlab
体积: gitlab-runner: 司机:本地 gitlab-配置: 司机:本地 gitlab-日志: 司机:本地 gitlab-数据: 司机:本地