76 Star 483 Fork 94

开源中国 / Gitee Jenkins Plugin

 / 详情

Jenkins Pipeline WebHook 触发构建失败

已拒绝
任务
创建于  
2021-05-07 14:26

任务描述

Jenkins Pipeline WebHook 触发构建失败

手动立即构建成功、Jenkins Gitee 链接 测试成功、Gitee WebHook 测试成功
Jenkins Gitee 链接 测试成功
Gitee WebHook 测试成功

失败Console Output
Started by Gitee push by Gitee
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on node2 in /home/jenkins/workspace/java
[Pipeline] {
[Pipeline] stage
[Pipeline] { (git)
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://gitee.com/redhat/java-war-hello.git

git init /home/jenkins/workspace/java # timeout=10
Fetching upstream changes from https://gitee.com/redhat/java-war-hello.git
git --version # timeout=10
git --version # 'git version 2.20.1'
git fetch --tags --force --progress -- https://gitee.com/redhat/java-war-hello.git +refs/heads/:refs/remotes/origin/ # timeout=10
Avoid second fetch
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (mvn)
Stage "mvn" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (tomcat)
Stage "tomcat" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to node2
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:286)
at com.sun.proxy.$Proxy84.revParse(Unknown Source)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revParse(RemoteGitImpl.java:592)
at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:98)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1139)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
hudson.plugins.git.GitException: Command "git rev-parse remotes/origin/test_version^{commit}" returned status code 128:
stdout: remotes/origin/test_version^{commit}

stderr: fatal: ambiguous argument 'remotes/origin/test_version^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2639)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2569)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2565)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1951)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1963)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:1065)
at hudson.plugins.git.GitAPI.revParse(GitAPI.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:932)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:905)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:857)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Finished: FAILURE

解决方案

任务来源

评论 (6)

十里山路 创建了任务
展开全部操作日志

具体是推送触发吗?webhook响应结果是什么?方便的话给下插件的日志打印
还有一点是
输入图片说明
这个配置与webhook触发无关,这是用于推送评论、或者自动合并PR的操作,即使不配置也可以正常响应webhook

Gitee

事件: Push
Response 200

Jenkins system log

May 07, 2021 8:02:38 AM INFO com.gitee.jenkins.webhook.GiteeWebHook getDynamic
WebHook called with url: /gitee-project/java
May 07, 2021 8:02:38 AM INFO com.gitee.jenkins.trigger.handler.AbstractWebHookTriggerHandler handle
java triggered for push.
May 07, 2021 8:02:45 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
java #18 completed: FAILURE

没看到插件日志在哪里

Started by Gitee push by Gitee
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on node1 in /home/jenkins/workspace/java
[Pipeline] {
[Pipeline] stage
[Pipeline] { (git)
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Fetching changes from the remote Git repository
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (mvn)
Stage "mvn" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (tomcat)
Stage "tomcat" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from jnlp-agent.mynetwork/10.0.0.31:38980
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:286)
at com.sun.proxy.$Proxy84.revParse(Unknown Source)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revParse(RemoteGitImpl.java:592)
at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:98)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1139)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

hudson.plugins.git.GitException: Command "git rev-parse remotes/origin/test_version^{commit}" returned status code 128:

stdout: remotes/origin/test_version^{commit}

stderr: fatal: ambiguous argument 'remotes/origin/test_version^{commit}': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2639)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2569)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2565)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1951)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1963)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:1065)
at hudson.plugins.git.GitAPI.revParse(GitAPI.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:929)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:902)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:854)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:119)
at java.lang.Thread.run(Thread.java:748)

Finished: FAILURE

输入图片说明
这是日志查看方式,可以在gitee看下webhook请求的响应结果吗


May 07, 2021 9:25:29 AM INFO com.gitee.jenkins.webhook.GiteeWebHook getDynamic
WebHook called with url: /gitee-project/java
May 07, 2021 9:25:29 AM FINE com.gitee.jenkins.webhook.build.PushBuildAction
Push: {
  "ref" : "refs/heads/test_version",
  "before" : "3a6902040b2fd1e240315a84611d36eef14b4f2f",
  "after" : "ad2f7b1729eea675cd44da48f5e53abdf8f242a8",
  "created" : false,
  "deleted" : false,
  "compare" : "https://gitee.com/oschina/gitee/compare/3a6902040b2fd1e240315a84611d36eef14b4f2f...ad2f7b1729eea675cd44da48f5e53abdf8f242a8",
  "commits" : [ {
    "id" : "3a6902040b2fd1e240315a84611d36eef14b4f2f",
    "tree_id" : "ad2f7b1729eea675cd44da48f5e53abdf8f242a8",
    "parent_ids" : [ "ad2f7b1729eea675cd44da48f5e53abdf8f242a8" ],
    "distinct" : true,
    "message" : "这是一条测试 Push 类型 WebHook 触发的推送",
    "timestamp" : "2020-04-15T21:09:40+08:00",
    "url" : "https://gitee.com/oschina/gitee/commit/3a6902040b2fd1e240315a84611d36eef14b4f2f",
    "author" : {
      "time" : "2020-04-15T21:09:40+08:00",
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "committer" : {
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "added" : null,
    "removed" : null,
    "modified" : [ "README.md" ]
  } ],
  "head_commit" : {
    "id" : "3a6902040b2fd1e240315a84611d36eef14b4f2f",
    "tree_id" : "ad2f7b1729eea675cd44da48f5e53abdf8f242a8",
    "parent_ids" : [ "ad2f7b1729eea675cd44da48f5e53abdf8f242a8" ],
    "distinct" : true,
    "message" : "这是一条测试 Push 类型 WebHook 触发的推送",
    "timestamp" : "2020-04-15T21:09:40+08:00",
    "url" : "https://gitee.com/oschina/gitee/commit/3a6902040b2fd1e240315a84611d36eef14b4f2f",
    "author" : {
      "time" : "2020-04-15T21:09:40+08:00",
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "committer" : {
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "added" : null,
    "removed" : null,
    "modified" : [ "README.md" ]
  },
  "total_commits_count" : 1,
  "commits_more_than_ten" : false,
  "repository" : {
    "id" : 151,
    "name" : "Gitee FeedBack",
    "path" : "git-osc",
    "full_name" : "oschina/git-osc",
    "owner" : {
      "login" : "oschina-org",
      "avatar_url" : "https://gitee.com/assets/favicon.ico",
      "html_url" : "https://gitee.com/oschina-org",
      "type" : "User",
      "site_admin" : false,
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "private" : false,
    "html_url" : "https://gitee.com/oschina/git-osc",
    "url" : "https://gitee.com/oschina/git-osc",
    "description" : "",
    "fork" : false,
    "created_at" : "2020-04-15T21:09:40+08:00",
    "updated_at" : "2020-04-15T21:09:40+08:00",
    "pushed_at" : "2020-04-15T21:09:40+08:00",
    "git_url" : "git://gitee.com:oschina/git-osc.git",
    "ssh_url" : "git@gitee.com:oschina/git-osc.git",
    "clone_url" : "https://gitee.com/oschina/git-osc.git",
    "svn_url" : "svn://gitee.com/oschina/git-osc",
    "git_http_url" : "https://gitee.com/oschina/git-osc.git",
    "git_ssh_url" : "git@gitee.com:oschina/git-osc.git",
    "git_svn_url" : "svn://gitee.com/oschina/git-osc",
    "homepage" : null,
    "stargazers_count" : 11,
    "watchers_count" : 12,
    "forks_count" : 0,
    "language" : "ruby",
    "has_issues" : true,
    "has_wiki" : true,
    "has_pages" : false,
    "license" : null,
    "open_issues_count" : 0,
    "default_branch" : "master",
    "namespace" : "oschina",
    "name_with_namespace" : "OSCHINA/git-osc",
    "path_with_namespace" : "oschina/git-osc"
  },
  "project" : {
    "id" : 151,
    "name" : "Gitee FeedBack",
    "path" : "git-osc",
    "full_name" : "oschina/git-osc",
    "owner" : {
      "login" : "oschina-org",
      "avatar_url" : "https://gitee.com/assets/favicon.ico",
      "html_url" : "https://gitee.com/oschina-org",
      "type" : "User",
      "site_admin" : false,
      "id" : 1,
      "name" : "Gitee",
      "email" : "gitee@gitee.com",
      "username" : "oschina-org",
      "user_name" : "Gitee",
      "url" : "https://gitee.com/oschina-org"
    },
    "private" : false,
    "html_url" : "https://gitee.com/oschina/git-osc",
    "url" : "https://gitee.com/oschina/git-osc",
    "description" : "",
    "fork" : false,
    "created_at" : "2020-04-15T21:09:40+08:00",
    "updated_at" : "2020-04-15T21:09:40+08:00",
    "pushed_at" : "2020-04-15T21:09:40+08:00",
    "git_url" : "git://gitee.com:oschina/git-osc.git",
    "ssh_url" : "git@gitee.com:oschina/git-osc.git",
    "clone_url" : "https://gitee.com/oschina/git-osc.git",
    "svn_url" : "svn://gitee.com/oschina/git-osc",
    "git_http_url" : "https://gitee.com/oschina/git-osc.git",
    "git_ssh_url" : "git@gitee.com:oschina/git-osc.git",
    "git_svn_url" : "svn://gitee.com/oschina/git-osc",
    "homepage" : null,
    "stargazers_count" : 11,
    "watchers_count" : 12,
    "forks_count" : 0,
    "language" : "ruby",
    "has_issues" : true,
    "has_wiki" : true,
    "has_pages" : false,
    "license" : null,
    "open_issues_count" : 0,
    "default_branch" : "master",
    "namespace" : "oschina",
    "name_with_namespace" : "OSCHINA/git-osc",
    "path_with_namespace" : "oschina/git-osc"
  },
  "user_id" : 1,
  "user_name" : "Gitee",
  "user" : {
    "id" : 1,
    "name" : "Gitee",
    "email" : "gitee@gitee.com",
    "username" : "oschina-org",
    "user_name" : "Gitee",
    "url" : "https://gitee.com/oschina-org"
  },
  "pusher" : {
    "id" : 1,
    "name" : "Gitee",
    "email" : "gitee@gitee.com",
    "username" : "oschina-org",
    "user_name" : "Gitee",
    "url" : "https://gitee.com/oschina-org"
  },
  "sender" : {
    "login" : "oschina-org",
    "avatar_url" : "https://gitee.com/assets/favicon.ico",
    "html_url" : "https://gitee.com/oschina-org",
    "type" : "User",
    "site_admin" : false,
    "id" : 1,
    "name" : "Gitee",
    "email" : "gitee@gitee.com",
    "username" : "oschina-org",
    "user_name" : "Gitee",
    "url" : "https://gitee.com/oschina-org"
  },
  "enterprise" : {
    "name" : "OSCHINA",
    "url" : "https://gitee.com/oschina"
  },
  "hook_name" : "push_hooks",
  "hook_id" : 615600,
  "hook_url" : "https://gitee.com/redhat/java-war-hello/hooks/615600/edit",
  "password" : "e2c059fe0b4f7e8d7ce493e82e018448",
  "timestamp" : "1620379528006",
  "sign" : ""
}
May 07, 2021 9:25:29 AM INFO com.gitee.jenkins.trigger.handler.AbstractWebHookTriggerHandler handle
java triggered for push.

找到原因了,在 WebHook 点击"测试" 发送的push 有问题

silverballer 任务状态待办的 修改为已拒绝
Yashin 关联项目设置为公有云-架构

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
2102225 silverballer 1578966245 105563 redhat 1620376915
Java
1
https://gitee.com/oschina/Gitee-Jenkins-Plugin.git
git@gitee.com:oschina/Gitee-Jenkins-Plugin.git
oschina
Gitee-Jenkins-Plugin
Gitee Jenkins Plugin

搜索帮助