Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins GitHub插件,如果标签被推送到origin/master,readTrusted阶段将以404失败_Jenkins_Github - Fatal编程技术网

Jenkins GitHub插件,如果标签被推送到origin/master,readTrusted阶段将以404失败

Jenkins GitHub插件,如果标签被推送到origin/master,readTrusted阶段将以404失败,jenkins,github,Jenkins,Github,如果将标记推送到源站/主站,Jenkins构建作业开始失败。我们使用的是私有存储库,凭据正常,验证工作正常。在提交到主构建的情况下,成功构建 复制步骤: git推送原点 按build job->将导致下面日志部分中描述的错误 管道步骤: 管道启动-(区块内5.3秒)\成功 从SCM读取受信任文件-(0.76秒自)失败 如果我删除标记并提交一些更改,新的构建将成功完成 以下是作业的日志: 17:06:49 Connecting to https://api.github.com using

如果将标记推送到源站/主站,Jenkins构建作业开始失败。我们使用的是私有存储库,凭据正常,验证工作正常。在提交到主构建的情况下,成功构建

复制步骤:

  • git推送原点
  • 按build job->将导致下面日志部分中描述的错误
管道步骤:

  • 管道启动-(区块内5.3秒)\成功
  • 从SCM读取受信任文件-(0.76秒自)失败
如果我删除标记并提交一些更改,新的构建将成功完成

以下是作业的日志:

17:06:49 Connecting to https://api.github.com using ...build/****** (*** GitHub Build User)
ERROR: Could not do lightweight checkout, falling back to heavyweight
java.io.FileNotFoundException: https://raw.githubusercontent.com/***/myrepository/7ae6037fe8/Jenkinsfile?token=ALR5FLRJSV5UVVRE442KWCC6C42PA
    at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
    at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
    at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
    at org.kohsuke.github.Requester.asStream(Requester.java:340)
Caused: org.kohsuke.github.GHFileNotFoundException: 404: Not Found

    at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
    at org.kohsuke.github.Requester.asStream(Requester.java:342)
    at org.kohsuke.github.GHContent.read(GHContent.java:117)
    at org.jenkinsci.plugins.github_branch_source.GitHubSCMFile.content(GitHubSCMFile.java:183)
    at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:335)
    at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:107)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:299)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:427)
以下是git插件配置:

以前的标签构建得很好,但无法确定更改了什么

出现这种错误的原因是什么?是否没有访问该文件的权限

更新1: 问题不在于标记,而在于重建相同的构建。当Build Now按钮再次触发时,此错误将重现


提前感谢

我会在舞台一开始就清理工作区。 在传统的自由式工作中,我会尝试工作区清理插件

在Jenkins管道DSL上,我将使用

            checkout([$class: 'GitSCM',
                branches: scm.branches,
                extensions:  scm.extensions + [[$class: 'WipeWorkspace']],
                userRemoteConfigs: scm.userRemoteConfigs
            ])