amplify-backend
amplify-backend copied to clipboard
Unable to list branches while connecting to a BitBucket repository in Amplify Gen 2 console - 400 bad request error!
Environment information
System:
OS: macOS 14.4
CPU: (10) arm64 Apple M1 Pro
Memory: 178.92 MB / 16.00 GB
Shell: /bin/zsh
Binaries:
Node: 21.5.0 - ~/.nvm/versions/node/v21.5.0/bin/node
Yarn: undefined - undefined
npm: 10.2.4 - ~/.nvm/versions/node/v21.5.0/bin/npm
pnpm: undefined - undefined
NPM Packages:
@aws-amplify/backend: 0.13.0-beta.17
@aws-amplify/backend-cli: 0.12.0-beta.19
aws-amplify: 6.0.28
aws-cdk: 2.137.0
aws-cdk-lib: 2.137.0
typescript: 5.4.5
AWS environment variables:
AWS_STS_REGIONAL_ENDPOINTS = regional
AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables
Description
Issue: While fetching branches of a BitBucket repository, 400 bad request error is encountered!
Steps to reproduce: Create a sample Next.js application Add Amplify Gen 2 Configure Auth & Data (optional) Push the changes to BitBucket Go to AWS Amplify Gen 2 console Under option 2, choose "BitBucket" Login to BitBucket Choose a repository from the drop down You'll find the list of branches to be empty due to the error
I'm able to see the list of repositories in the dropdown. However, when I try to select a branch from the dropdown, there are none.
I inspected the "Network" tab in Chrome and I found that the API call to fetch branches is failing with a bad request error. Further, drilling down showed that the request has an invalid query parameter "page".
To verify the issue, I used Postman to test the same GET request with the bearer token that I got from the browser and it showed the same error message. So, I removed the query parameter page from the request and re-ran the request and it worked successfully!
So, I request you to look into this issue urgently as I'm stuck with the creation of Amplify Gen 2 app and deploy the Next.js application.
@vinothj-aa 👋 , thanks for reaching out to us. I wasn't able to reproduce the behavior outlined in this thread when connecting a Bitbucket repository to an app in the Amplify Gen 2 console. If the issue persists for you, can you try the following:
- In the Bitbucket console, navigate to
Personal Bitbucket settings - Under
Access managementsection, selectApp authorizations - Revoke the
AWS Amplify (AWS_Region)application - Retry creating a new Amplify app. Now, when you select Bitbucket as your git provider an authorization flow will initiate between the console and the provider and a new application will appear under
App authorizations. - Select the repository from the dropdown along with the git branch.
- Save and deploy.
It started working on the next day automatically and I'm surprised. I'm able to view the branches and deploy my Amplify Gen 2 application successfully without making any changes.
Glad to hear that you are unblocked and are able to connect to your Bitbucket repository. Closing this issue and feel free to open a new issue if you are experiencing any issues with Amplify.