Jenkins services does not work (BB-3563)

Wichert Akkerman avatarWichert 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. Ando Roots

    Been struggling with this, too. Turn off security and it works. Unfortunately, that's unacceptable. Alternatives: manual build / polling.

  2. Wichert Akkerman

    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?

  3. Stefan Bohn

    I can confirm the POST request. Looking in tomcat/logs/localhost_access_log.*.txt shows

    63.246.22.222 - - [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 -
    
  4. 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.

  5. marcosbeirigo

    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.

  6. voxeolabs

    Any idea when this is going to be fixed ? I think we might have to take out business back to github if basic functionality like this doesn't work

  7. Marcus Bertrand

    This issue was resolved some time ago. The Jenkins service works as expected unless you have csrf enabled. Please follow https://bitbucket.org/site/master/issue/6503/jenkins-service-broker-should-support 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 support.atlassian.com 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.

  8. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.