Bitbucket Cloud サービスのトラブルシューティング

Deprecated

Creation of new service integrations has been deprecated in favor of Bitbucket Cloud's webhooks, Connect integration framework, and email notifications.

There are several things that can go wrong when configuring your  Bitbucket Cloud service to send commit data to a service such as Jenkins, your own server via a POST service, or any of our other services. We've collected a few common cases here for testing and verifying what may be going on. If you come across any other things to be aware of or suggestions on improving this doc, comment below!

What triggers a post-receive service?

A service runs once Bitbucket Cloud receives data from you and other contributors to your project. Because of the decentralized nature of Git and Mercurial, you can commit something locally without notifying Bitbucket. It is not until you push your changesets to Bitbucket, that you actually connect to our servers and upload the commit data.  

A service broker receives the push data only after the Bitbucket server successfully receives it.  Since a push can contain multiple changesets, a service may receive more than one changeset. Some of the services take the number of changsets into consideration. For example, the email broker constructs different email messages based on the number of changesets.

How to test a service manually

While we work on adding a feature to test services, you can test a service manually from your command line. Manually testing involves creating a new file or committing a change to a file and then pushing the change to the server.  The test example below creates a new file.

For Git repositories, do the following from your local repo:

  1. Change directory to the repository root. 

    $ cd mybb101-repo 
  2. Create a new file called servicetest.txt.

    $ cat /dev/null > servicetest.txt
    $ cat "this is a test" >> servicetest.txt
  3. Add the file to staging.

    git add servicetest.txt
  4. Commit the new file.

    git commit -m "Testing the services"
  5. Push the change to Bitbucket.

    git push
  6. Verify the commit appears in the Bitbucket Commits tab.
  7. Check on your service and verify it received the commit data.

For Mercurial repositories, do the following from your local repo:

  1. Change directory to the repository root. 

    $ cd myquotefork
  2. Create a new file called servicetest.txt.

    $ cat /dev/null > servicetest.txt
    $ cat "this is a test" >> servicetest.txt
  3. Add the file to Mercurial (the add is only necessary for new files not for updates).

    hg add servicetest.txt
  4. Commit the new file.

    hg commit -m "Testing the services"
  5. Push the change to Bitbucket.

    hg push
  6. Verify the commit appears in the Bitbucket Commits tab.
  7. Check on your service and verify it received the commit data.

Things you can try if the manual test fails

If your commits aren't reaching your service target, check the following:

  • We fail any request that does not respond with an http status code between 200 and 399. Additionally, there is a timeout of 20 seconds. Be sure your application can always reply in that time.
  • Are you using the Jira DVCS Connector with a behind the firewall version of Jira Software? If so, be sure the POST service can reach your Jira Software instance. URLs like http://localhost:8080/ or  http://office-pc/ won't work.
  • Check your logs! Nearly everything out there that accepts and routes http traffic can also log it. Take a look and see if you see traffic coming from our IP addresses. See the page What are the Bitbucket Cloud IP addresses I should use to configure my corporate firewall?, for our current IP addresses. 
  • If you simply aren't seeing anything hitting your server or service, configure the POST service to send to http://posttestserver.com/post.php and run the test again. Bitbucket triggers all services simultaneously. If the the test server receives your post, your service should have also received it. Recheck your service configuration.
  • If all else fails, please check for reports of similar issues in the Atlassian Community or open a Support request.
最終更新日 2017 年 9 月 13 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

Not finding the help you need?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.