Experiencing issues integrating Bitbucket to Platform.sh ? (May 2023)

Bitbucket Integration Problem

When you try to connect Bitbucket to platform using integration you get the following error in platform.sh console once you fill the Repository name, App credential Key and App Credential Secret

“The server could not comply with the request. It is either malformed or otherwise incorrect”

To troubleshoot

1. Execute the following

curl -X POST -u "KEY:SECRET" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials

That should return something like the below

``“error”: “invalid_grant”, “error_description”: “Cannot use client_credentials with a consumer marked as "public". Calls for auto generated consumers should use urn:bitbucket:oauth2:jwt instead.”}`

Fix

In Bitbucket if you don’t select This is a private consumer when you add a consumer this issue happens. So make sure to select it.