jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

Did not find any jobs with GenericTrigger configured!\nA token was supplied.\n #316

Closed CarryWll closed 4 days ago

CarryWll commented 4 days ago

Jenkins and plugins versions report

curl -v "http://JENKINS-SERVER/generic-webhook-trigger/invoke?token=123456" -H "Content-Type: application/json" -d "{\"ref\": \"refs/heads/master\"}"

response result:

{"jobs":null,"message":"Did not find any jobs with GenericTrigger configured!\nA token was supplied.\n"}
  1. When I build an ordinary pipeline, select and configure it on the page, it can be successfully called.

image

tomasbjerre commented 4 days ago
tomasbjerre commented 4 days ago

You give it the master branch in your example, you should change that to refs/heads/dev.

curl -v "http://JENKINS-SERVER/generic-webhook-trigger/invoke?token=123456" -H "Content-Type: application/json" -d "{\"ref\": \"refs/heads/dev\"}"

You also need to scan with multibranch pipeline. After that, verify that the job is created and with the intended configuration.

Once you have a job configured, try with the curl command again.

CarryWll commented 4 days ago

You give it the master branch in your example, you should change that to refs/heads/dev.

curl -v "http://JENKINS-SERVER/generic-webhook-trigger/invoke?token=123456" -H "Content-Type: application/json" -d "{\"ref\": \"refs/heads/dev\"}"

You also need to scan with multibranch pipeline. After that, verify that the job is created and with the intended configuration.

Once you have a job configured, try with the curl command again.

I changed master to dev, still the same error result.

{"jobs":null,"message":"Did not find any jobs with GenericTrigger configured!\nA token was supplied.\n"}

and My multi-branch pipeline has been successfully configured, but it is not editable on the interface. It is automatically generated from Jenkinsfile. 1719841264264

tomasbjerre commented 4 days ago

You can try restart Jenkins. If that solves it, it might be same problem as #311 #312

CarryWll commented 4 days ago

You can try restart Jenkins. If that solves it, it might be same problem as #311 #312

Thank you @tomasbjerre , The problem was successfully solved after restart.