多分支管道共享库权限错误

如何解决多分支管道共享库权限错误

我在Docker容器中运行Jenkins,作业在单独的容器中运行。我目前在使用共享库的多分支管道上遇到错误。作业第一次克隆共享库,但是从那里开始会出现权限错误。我似乎在网上找不到类似的问题或解决方案。

Loading library <SHARED_LIBRARY>@develop
Attempting to resolve master from remote references...
 > git --version # timeout=10
using GIT_SSH to set credentials <CREDENTIAL_NAME>
 > git ls-remote -h -- <GIT_LINK> # timeout=10
Found match: refs/heads/develop revision <COMMIT_HASH>
ERROR: Checkout failed
java.nio.file.AccessDeniedException: /${ITEM_ROOTDIR}
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
    at java.nio.file.Files.createDirectory(Files.java:674)
    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
    at java.nio.file.Files.createDirectories(Files.java:767)
    at hudson.FilePath.mkdirs(FilePath.java:3260)
    at hudson.FilePath.access$1300(FilePath.java:211)
    at hudson.FilePath$Mkdirs.invoke(FilePath.java:1251)
    at hudson.FilePath$Mkdirs.invoke(FilePath.java:1247)
    at hudson.FilePath.act(FilePath.java:1075)
    at hudson.FilePath.act(FilePath.java:1058)
    at hudson.FilePath.mkdirs(FilePath.java:1243)
    at hudson.plugins.git.GitSCM.createClient(GitSCM.java:828)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1166)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:157)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:107)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:156)
    at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:96)
    at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
    at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
    at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:337)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:428)
ERROR: Checkout failed

第一次运行作业时,共享管道将在主服务器上克隆,并在路径上被克隆

<JENKINS_HOME>/jobs/<JOB_NAME>/branches/<BRANCH_NAME>/workspace/<GIT_REPO_NAME>/<SHARED_LIBRARY_BRANCH_NAME@libs/<SHARED_LIBRARY_GIT_REPO_NAME>

我在从属容器上看不到它。我相信Jenkins代理程序具有特权,因为它以admin身份运行,并且docker容器对路径具有权限。 这是第一次运行时的日志,您可以看到它可以克隆共享管道并启动从属容器,但是如果您查看该帖子(同一作业的第二次运行)。无法克隆共享管道。

Branch indexing
Running as admin
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to git@github.com:<GIT_REPO>.git
 > git config remote.origin.url git@github.com:<GIT_REPO>.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 > git --version # timeout=10
 > git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials <GITHUB_SSH_KEY>
 > git fetch --tags --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
Seen branch in repository origin/develop
Seen branch in repository origin/master
Seen 2 remote branches
Obtained Jenkinsfile from <GIT_HASH>
Running in Durability level: PERFORMANCE_OPTIMIZED
Loading library <SHARED_LIBRARY>@develop
Attempting to resolve develop from remote references...
 > git --version # timeout=10
using GIT_SSH to set credentials <GITHUB_SSH_KEY>
 > git ls-remote -h -- git@github.com:<SHARED_LIBRARY>.git # timeout=10
Found match: refs/heads/develop revision <GIT_HASH>
using credential <GITHUB_SSH_KEY>
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository git@github.com:<SHARED_LIBRARY>.git
 > git init /var/jenkins_home/jobs/<JOB_NAME/GIT_REPO_NAME>/branches/develop/workspace/<JOB_NAME/GIT_REPO_NAME>/develop@libs/<SHARED_LIBRARY> # timeout=10
Fetching upstream changes from git@github.com:<SHARED_LIBRARY>.git
 > git --version # timeout=10
using GIT_SSH to set credentials <GITHUB_SSH_KEY>
 > git fetch --no-tags --progress -- git@github.com:<SHARED_LIBRARY>.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@github.com:<SHARED_LIBRARY>.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@github.com:<SHARED_LIBRARY>.git # timeout=10
Fetching without tags
Fetching upstream changes from git@github.com:<SHARED_LIBRARY>.git
using GIT_SSH to set credentials <GITHUB_SSH_KEY>
 > git fetch --no-tags --progress -- git@github.com:<SHARED_LIBRARY>.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision <GIT_HASH> (develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f <GIT_HASH> # timeout=10
Commit message: "<SHARED_LIBRARY_COMMIT_MESSAGE>"
First time build. Skipping changelog.
[Pipeline] Start of Pipeline
[Pipeline] node
Running on android-slave on docker in /home/jenkins/workspace/<JOB_NAME>
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout

Jenkinsfile

#!groovy
@Library("<SHARED_LIBRARY>")

pipeline {
    agent {
        label 'android-slave'
    }
    stages {
        stage("Stage1") {
            steps {
                script {
                    println "Testing multi branch pipeline"
                }
            }
        }
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-