fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx
Posted 0611-_-
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx相关的知识,希望对你有一定的参考价值。
问题描述:VUE前端项目,编写GitLab流水线
.gitlab-ci.yml
文件后,执行流水线构建报错如下
Running with gitlab-runner 11.9.2 (fa86510e)
on dflq@172.00.0.0@xx xxxxxxxx
Using Shell executor...
Running on xxxxxxxxxxxx...
DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository...
Cloning into '/home/gitlab-runner/builds/b80bb1e3/0/xxxxxxxxxxxx/xxxx-xxxxx-xx'...
remote: You are not allowed to download code from this project.
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@172.00.0.0/xxxxxxxxxxxx/xxxx-xxxxx-xx.git/': The requested URL returned error: 403
bash: line 57: cd: /home/gitlab-runner/builds/xxxxxxxx/0/xxxxxxxxxxxx/xxxx-xxxxx-xx: No such file or directory
ERROR: Job failed: exit status 1
流水线脚本如下
stages:
- standalone
image: node:alpine
install_deps:
stage: standalone
script:
# - npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
- npm set registry https://registry.npm.taobao.org
- npm install --registry=http://registry.npm.taobao.org
# - VERSION=`npm run dev | awk 'ENDprint'`
# - echo "name = $CI_PROJECT_NAME, version = $VERSION"
- npm run build:prod
- docker build . --tag xxx.xxx.xxxxxxxxx.com/xxx-xxx-xxx/xxxx-xxxxx-xx:$CI_PROJECT_NAME-SNAPSHOT-$CI_BUILD_ID
- docker push xxx.xxx.xxxxxxxxx.com/xxx-xxx-xxx/xxxx-xxxxx-xx:$CI_PROJECT_NAME-SNAPSHOT-$CI_BUILD_ID
- echo xxx.xxx.xxxxxxxxx.com/xxx-xxx-xxx/xxxx-xxxxx-xx:$CI_PROJECT_NAME-SNAPSHOT-$CI_BUILD_ID
only:
- master
- develop
- 参考文章:https://stackoverflow.com/questions/40006690/gitlab-runner-the-requested-url-returned-error-403
大致意思:在项目页面中,单击设置,然后单击成员。将您自己(或生成生成版本的用户)作为成员添加到项目中,我使用了"Master"
(或意为root)角色,但根据本文档,您可能至少可以使用"Reporter"
角色,报告者角色是仍然有权访问"拉项目代码"的最低权限。这删除了我的403错误并允许我继续
再次运行流水线
Succeeded!!
以上是关于fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx的主要内容,如果未能解决你的问题,请参考以下文章
fatal: unable to access ‘https://github.com...../‘
使用github出了些问题?fatal: unable to access;Failed connect to github.com:8087;
fatal: unable to access 'https://xxxxx': SSL connect error
git clone 出现fatal: unable to access https://github 类错误解决方法
fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx
fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx