Jenkins Pipeline 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
具体是推送触发吗?webhook响应结果是什么?方便的话给下插件的日志打印
还有一点是
这个配置与webhook触发无关,这是用于推送评论、或者自动合并PR的操作,即使不配置也可以正常响应webhook
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
事件: Push
Response 200
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)
stdout: remotes/origin/test_version^{commit}
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 有问题
登录 后才可以发表评论