Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to debug Internal server error when performing commit using REST API?

Anoop Pavuluri October 5, 2023

Hello experts,

I am trying to do a commit using the Bitbucket cloud rest api v2.0, but get an HTTP 500 error. The error response does not have enough information in it to investigate further as it just says 'Something went wrong' with a HTTP 500 (Internal server Error).

I have seen some posts in the community that mentioned a similar issue, and were able to get some insights by the message id. Hence I have pasted the id for reference. 

I have read, write, and admin access to the repository and able to do a commit manually. 

Bitbucket Internal Server Error.png

Additionally,

1. Is there is a memory limit to each commit that needs to be taken care of?

2. Is there a way for external users to investigate the detail logs using the id?

 

Any advice on how to overcome this error would be really helpful. Thanks in advance. 

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 5, 2023

Hi Anoop,

Unfortunately, as 5xx errors refer to internal errors on our side - we generally do not share detailed logging information with users as it may contain sensitive code related to our backend processes. The error code that is returned by the API endpoint is something that we can use to investigate in our backend.

From what I can see on our end, the request timed out and this is why you received this particular error message. Whilst we do not have specific limitations set for commit filesize, there is a 30-second request timeout limit so if the commit process takes longer than this - the API request will fail. 

For future reference, when running cURL commands, you can enable some cURL-specific debugging flags that may reveal more about the nature of the error:

- curl -s --fail --show-error -X POST commandgoeshere

Hope this helps, please let me know if further clarification is needed.

Cheers!

- Ben (Bitbucket Cloud Support)

Anoop Pavuluri October 6, 2023

Hi @Ben 

Thank you for replying. I understand that the logs are not accessible to external users. 

I have been trying different things but still encounter the error almost every time I do a commit(9 out of 10 times). Also, I captured the time taken for execution by the API and observed that its less than 30 seconds per commit, but I still get the same error.

Screenshot 2023-10-06 160154.png

I am trying to call the API as suggested in this link:

https://www.npmjs.com/package/bitbucket 

Screenshot 2023-10-06 152747.png

 

The restForm object contains data in the 'multipart/form-data' format and also I have declared all the params correctly as per the recommendation.

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2023

Hi Anoop,

The only official documentation we have available for creating a commit is by uploading a file to the repository source using the /2.0/repositories API endpoint (which, in turn - will create a commit):

I have tested this endpoint by uploading files to my repository and I can confirm that it functions as expected by following this documentation and using cURL commands to POST this data to the repository.

The documentation that you have provided suggests the use of a third-party script, unfortunately, I am unable to troubleshoot this as it falls outside of our support scope. I would suggest reaching out to the NPMJS community forums below if you intend to use this script:

Cheers!

- Ben (Bitbucket Cloud Support)

Anoop Pavuluri October 10, 2023

Thanks Ben!

Anoop Pavuluri October 10, 2023

Dear @Ben 

Unfortunately, it still did not work. I tried by implementing the way as suggested by the official API(the node.js example), but still get a HTTP 500 Internal server error. 

I logged the execution time in the handler but it always was less than 30 seconds, so I don't think timeout is the issue here. Could you get more information regarding the error from the log IDs below? 

something went wrong1.png something went wrong.png

Note: In my actual code, the params const is filled with data before performing the POST. Screenshot simplified just for example.

bitbucket error 500.png

Like Sabine Mayer likes this
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2023

Hey Anoop,

Our backend still reports the same (RequestTimeoutError) however I note that you are performing these queries against a paid workspace. I was not aware of this initially as the email you have used to log this ticket is not linked to such a workspace, my apologies.

As a result of this, I will be raising a support ticket on your behalf and investigating this further - as you have an entitlement to Standard-level support. 

We will need your exact commands and further information that would not be appropriate to share on a public forum, so I believe a support ticket is the best course of action here to work towards a solution.

Please check the email address that is associated with the paid workspace that you are querying to access the support ticket.

Cheers!

- Ben (Bitbucket Cloud Support)

Like Sabine Mayer likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events