Jenkins services does not work (BB-3563)

Issue #3601 resolved
Wichert Akkerman
created an issue

The Jenkins service does not work for git repositories (it might for mercurial, I have not checked).

As a test I configured two services for a repository: //Email diff// and //Jenkins//. The //Email diff// services works perfectly: immediately after a commit I get an email with the full diff. The //Jenkins// services did not do anything. Looking at the apache logs for our (unsecured) Jenkins instance I can see that bitbucket does not attempt to do a POST (or GET or any other request).

I'm marking this as critical since the workaround is to configure polling in jenkins, which will increase the load on the bitbucket platform.

Comments (15)

  1. Wichert Akkerman reporter

    What is the status of this problem? I just tried this again and it still does not work. Could it be that the Jenkins service (and POST which appears to have the same problem) is not support on private repositories?

  2. Stefan Bohn

    I can confirm the POST request. Looking in tomcat/logs/localhost_access_log.*.txt shows - - [07/Feb/2013:20:18:35 +0100] "POST /jenkins/job/MyJob/build?token=MyToken&cause=Triggered+by+push+of+revision+CommitHash+CommitMessage+to+RepositoryURL+by+bohni HTTP/1.1" 404 949

    Seems jenkins returns a 404 for the POST request

    Get will return 302:

    IP - - [07/Feb/2013:20:27:32 +0100] "GET /jenkins/job/MyJob/build?token=MyToken&cause=Triggered+by+push+of+revision+CommitHash+CommitMessage+to+RepositoryURL+by+bohni HTTP/1.1" 302 -
  3. Ivan Borisov

    My Jenkins setup returns "HTTP Status 403 - No valid crumb was included in the request" for POST method, and sucessfully triggers build after GET. I tested it with curl [url_with_token] (GET) and curl -d "" [url_with_token] (POST). So we need an opportunity to send GET request to Jenkins.

  4. marcosbeirigo NA

    Bitbucket actually sends a post request (I can see it on my nginx log files), but Jenkins returns a 403 status. Using the Same url (as shown on nginx log) to do a POST request with CURL or postman rest client works fine.

  5. Marcus Bertrand staff

    This issue was resolved some time ago. The Jenkins service works as expected unless you have csrf enabled. Please follow for a resolution.

    If this isn't enabled, and you still have issues, please read over our guide to troubleshooting Bitbucket services.

    If that still doesn't resolve your issue, please raise a support request to by registering a FREE account. Include all the steps you tried from the above, along with your logs from your web server if you are seeing requests from us.

    This issue will now be closed.

  6. Log in to comment