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.
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)
Thanks, @Theodora Boudale for looking into this issue.
message: 'Something went wrong',
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.
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.
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.
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...
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