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

Bitbucket Rest API error Something Went Wrong when requesting changes from a repository

bdbowen June 29, 2021

I am trying to get changes for a certain repository between certain dates. I am using the url:

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo-slug}/issues/{id}/changes?q=created_on >= 2021-06-21 AND created_on <= 2021-06-28 AND user.uuid = {user uuid}

Every time I run this or a similar query I get an 500 Internal Server Error, "Something Went Wrong". If I remove any reference to created_on, then it works just fine, so I am not hitting my limits per hour (also I am using an authenticated request with OAuth credentials, so I shouldn't have a limit anyway). 

Can anyone help me know what to do to fix this error? It seems to only be happening when using >,<,>=, or <= with created_on in just the issue/{issue_id}/changes endpoint because any other search criteria within the changes endpoint works, and any other endpoint, such as issues or issues/{issue_id}/comments, works with created_on and comparators.

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 2, 2021

Hi @bdbowen,

When there is a 500 response from an API call there is usually an "id" in the response along with the message "Something went wrong".

Could you please post the value of the "id" from one of these calls, so I can check it in our system for further info?

Kind regards,
Theodora

bdbowen July 2, 2021

@Theodora Boudale I called it many times, and each time gave a distinct ID I noticed. Here is the value of one of the errors that I saved: "aa33d0a31f8e44e69f78bb5b2eed7567". I don't have any others of the ids because I didn't save them all. 

At the time of this request I had moved on my testing to see if I could get an exact match, so I did a query for changes with just a uuid, and copied a time, then tried to see if it would allow me to search for an exact created_on. This was the URL that I requested that returned that error:

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo-slug}/issues/{issue-id}/changes?q=created_on=2021-06-25T21:52:30.254236 AND user.uuid = "{valid user uuid}"

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2021

Hi @bdbowen,

Thank you for the info.

This looks to be a bug with the endpoint, so I went ahead and created a bug report in our issue tracker:

I'm afraid that there is no workaround at the moment for this.

Our development team tracks bugs over there and will post an update on that bug report when this is fixed. Please note though that we don't provide ETAs and bug fixing is implemented as per our policy here.

You can add yourself as a watcher (by selecting the Start watching this issue link in the bug report) if you'd like to get notified via email on any updates. You can also select the Vote for this issue link to indicate you are affected by this issue.

If you have any further questions, please feel free to let me know.

Kind regards,
Theodora

bdbowen July 8, 2021

@Theodora Boudale Thanks for your response. I found a non efficient work around for now. What I ended up doing is querying the issues that were updated on or created on a certain date, then going through the changes for each of those issues in a for each loop and filtering for if they were after the date. Because my assumption is that whenever a "change" is made to the  issue, a change endpoint is added, but also the updated_on field of the issue itself is updated. Obviously not super effective in the long haul or with big O, but it works for now until this bug is fixed!

Dan Fraser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 8, 2021

Hi @bdbowen

 

I'm a dev on the team which owns the bbql library. I've patched the issue this week, could you please confirm it's fixed your problem?

Edit: Sorry, we've had to hold off on the rollout of this. I'll continue to look into this next week.

Edit: The changes are live as of 3:00pm Sydney time 15th July. Feel free to give it a go @bdbowen and let us know if it's solved your problem!

 

Best regards,

Dan

Like Theodora Boudale likes this
bdbowen July 15, 2021

@Dan Fraser It worked! Thanks so much!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events