Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting 500 Internal Server Error when trying to push changes using Bitbucket APIs

Sometimes while using this API

I am getting a response with a 500 status code. The response body does not contain enough information to debug it. Please help me in this regard.

1 answer

1 accepted

0 votes
Answer accepted

Hi @anubhav vats  and welcome to the community

1. Could you please copy-paste the full response you get (omitting sensitive info, if any)? Usually, in responses with 500 error there is an id included, which I could look up in our system for further info.

2. If you are able to reproduce this, could you check how much time it takes from the moment you execute the API call, until you get this response? One possibility is that the request may be timing out.

3. What is the approximate number of files and their size you are trying to commit/push with this endpoint, when you get these errors?

4. Since you mention "sometimes", I assume that the issue doesn't occur every time you use this endpoint, and it did not happen only once, but there were a few times that this happened, when you were trying to create different commits? (Just trying to understand the scope of the issue)

Kind regards,

Thanks, @Theodora Boudale for looking into this issue.

1. {
type: 'error',
error: {
message: 'Something went wrong',
id: '96eb231e4d684d8c978d4c0aa663bdf1'
I am getting this response. Please debug on your system why this is happening.

2. I reproduced the error and found it takes about 1696.595 ms to get a response with status code 500.

3. I am just trying to push change for one single file with a size of 2.3 KB.

4. Yes you are understanding the issue correctly. I also want to add that I get 500 for the same repository every time and I have read, write and admin access to that repo. 

Like Mudit Mehta likes this

Hi @anubhav vats ,

Thank you for the info.

I checked this error code in our system, and I see the error message:

pre-receive hook exited with 1

One of your commit messages is missing a valid issue key:

After that, a specific commit with its commit message is displayed, but I have omitted it because I am unsure if you'd like me to post it here.

Based on the error message, it looks that the option "Require issue keys in commit messages" may be enabled for this repository. This is possible if you have linked with JIRA or with another external application. You can double check that if you go to Repository settings > Links, is the option "Require issue keys in commit messages" enabled for the repo you are trying to push?

If so, you'll need to include a valid issue key in the commit message for the call to succeed.

One example:

curl -X POST -u username:app-password<workspace-id>/<repo-slug>/src -F File2.json=@File1.json -F branch=test-branch -F message="my commit message TEST-123"

Where TEST-123 replace with a valid issue key for your case.

Is this something that works for you?

Please feel free to let me know how it goes and if you need any further help.

Kind regards,

Like anubhav vats likes this

@Theodora Boudale Thanks a lot man!!! Because of your help, I was able to complete my work. Great thanks to you.

Like Theodora Boudale likes this

@anubhav vats , you are very welcome! I'm glad to have helped and that the issue is resolved.

Please feel free to reach out if you ever need anything else!

Have a nice day,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,519 views 4 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you