Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

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

Using diffstat I get back 404 in bitbucket

fernando.biagetti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 19, 2024

Good morning, I am having a very strange error, because when using the api https://api.bitbucket.org/2.0/repositories/${workspace}/${this.repoSlug}/pullrequests/${pullRequestsId}/diffstat in my local in a library works correctly and returns me that I have deleted lines so you can not merge the pull request. Now in bitbucket when running the same script to check for deleted lines that api I mentioned above returns 404 with the same credentials, same pull request id and same repository.

2 answers

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2024

Hello @fernando_biagetti and welcome to the Community!

The error 404 usually indicates that the URL is incorrect or that the credentials you are using don't have access to a given resource.

I would suggest trying to test doing a request to that endpoint without using the library, but calling it directly using curl, as in the following example : 

curl -X GET -v -u USERNAME:APP_PASSWORD https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pullrequests/{Pull request number}/diffstat

You can test this request in your local machine, and once it works locally, include the same command in your pipeline using the same credentials, and verify if the error persists.

If the curl command succeeds on the pipeline as well, it may be the case that the library is configured to use the wrong set of credentials.

Thank you, @fernando_biagetti !

Patrik S

0 votes
fernando.biagetti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 19, 2024

<redacted> The strange thing is that it only happens in the bitbucket pipe, in my pc this error does not happen.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events