Troubleshooting Heroku Deployment Error 400 in Bitbucket Cloud

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

   

Purpose

The purpose of this KB article is to explain a potential cause behind the Heroku deployment error 400 and provide a solution for resolving it.

Diagnosis

You execute a build that deploys to Heroku, instead of completing - the build fails and produces some variant of the following error:

error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

Procedure

A potential root cause of this issue is related to the Heroku deployment token defined in your Bitbucket Cloud repository/workspace variables. This token might either have an incorrect value on the Bitbucket Cloud side or, while having the correct value, is not scoped for the necessary privileges on the Heroku side.

To troubleshoot and resolve:

  1. Check the deployment token in Heroku. If uncertain, ensure it matches the deployment token in Bitbucket Cloud by copying it from Heroku and replacing the existing Bitbucket Cloud token variable.

  2. If the problem persists, reach out to Heroku Support for further troubleshooting. It's possible that the token lacks the proper read/write scope of permissions or other issues are present.

Heroku is a third-party integration, and support for it is not provided by Atlassian. Contact Heroku support for assistance. If advised by Heroku that the issue is related to Bitbucket Cloud, you can raise a support ticket or a community support ticket  for further assistance.

DescriptionError 400 deploying to Heroku
ProductBitbucket Cloud
Last modified on Jan 26, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.