Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/src#post

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,
Theodora

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 https://api.bitbucket.org/2.0/repositories/<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,
Theodora

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,
Theodora

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

322 views 2 10
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