Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Webhook is now returning "Did not find any jobs to trigger" #78

Closed
lcofre opened this issue Sep 11, 2018 · 6 comments
Closed

Working Webhook is now returning "Did not find any jobs to trigger" #78

lcofre opened this issue Sep 11, 2018 · 6 comments
Labels

Comments

@lcofre
Copy link

lcofre commented Sep 11, 2018

I had a successful pipeline where the Bitbucket webhook is now returning

{
  "status": "ok",
  "data": {
    "triggerResults": {
      "ANY": "Did not find any jobs to trigger! If the job you intend to trigger has a configured token, you need to pass it like ...trigger/invoke?token=TOKENHERE"
    }
  }
}

I updated this plugin along with others in Jenkins.

The pipeline is triggered only by this plugin in the Build Triggers section. I configured it to only trigger when there's a push to the develop branch:

Post content parameters
Variable: branch
Expression: $.push.changes[0].new.links.self.href
JSONPath
Text: $branch
Optional filter
Expression: ^.*(repositories/MY_COMPANY/MY_REPO/refs/branches/develop).*$

(All other properties were left as default. Only changed the company and repo names)

Bitbucket webhook sends this body in the request (I only kept the href property as the body has many other properties. I also changed the company and repo names):

{
   "push":{
      "changes":[
         {
            "new":{
               "links":{
                  "self":{
                     "href":"https://api.bitbucket.org/2.0/repositories/MY_COMPANY/MY_REPO/refs/branches/develop"
                  }
               }
            }
         }
      ]
   }
}

Thank you very much in advance for your help.

Environment info

  • Generic Webhook Trigger Plugin: 1.44
  • Jenkins ver. 2.121.3 (Windows, jre 64bit)
@tomasbjerre
Copy link
Contributor

This message means that no jobs were found. You need to authenticate with username/password or configure a token.

See the Troubleshooting section in the readme.

@lcofre
Copy link
Author

lcofre commented Sep 11, 2018

Hi Tomas,

Thanks very much for your quick response.

When I downgrade the plugin to 1.43 and resend the post from bitbucket the pipeline is triggered. The response I get with 1.43 is:

{
  "status": "ok",
  "data": {
    "triggerResults": {
      "MY_REPO develop": {
        "id": 159,
        "regexpFilterExpression": "^.*(repositories/MY_COMPANY/MY_REPO/refs/branches/develop).*$",
        "regexpFilterText": "https://api.bitbucket.org/2.0/repositories/MY_COMPANY/MY_REPO/refs/branches/develop",
        "resolvedVariables": {
          "branch": "https://api.bitbucket.org/2.0/repositories/MY_COMPANY/MY_REPO/refs/branches/develop"
        },
        "triggered": true,
        "url": "queue/item/159/"
      }
    }
  }
}

I didn't configure the webhook with a token, but I can do it if is needed.

Thanks very much again for your help.

@tomasbjerre
Copy link
Contributor

tomasbjerre commented Sep 11, 2018 via email

@lcofre
Copy link
Author

lcofre commented Sep 11, 2018

Great! I added a token and now it's working.

Under the token field still says "Optional token". Should now say that is required if there is no "security enabled"?

Thanks very much for your help.

@tomasbjerre
Copy link
Contributor

I changed the response from the plugin. It should be clearer that one needs to use a token or provide credentials.

For the record, the change was made because of: #77

@lcofre
Copy link
Author

lcofre commented Sep 12, 2018

That's grand! Is good to know the reasons for the change, thanks for all your work and for your quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants