Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Getting Something went wrong Error while fetching files in a directory


I am trying to fetch all the files from my directory. The curl which I am using is

curl -u "deepakpatankar:xxxx" -X 'GET' ''

But this request fails with the error

<!DOCTYPE html>

<html lang="en">


  <meta charset="utf-8">

  <title>Something went wrong &mdash; Bitbucket</title>

  <link rel="stylesheet" href="">


<body class="adg3 error-layout-bare ">

<div id="page" data-error-page>

  <div class="adg3-navigation-bare">

    <div class="adg3-navigation-bare--item">

      <a href="/" class="adg3-navigation-bare--link">

        <div class="adg3-navigation-bare--logo"></div>




  <div id="wrapper">

    <div id="content" role="main">

      <div class="aui-page-panel aui-page-panel-no-header">

        <div class="aui-page-panel-inner">

          <div id="error" class="500 aui-page-panel-content">

            <span class="icon icon-500"></span>



                Something went wrong




              While we check things on our end, try refreshing the page. If reloading the page doesn’t help, check our

                <a class="support-ga"


                  href="">status page</a>

              for known incidents or planned maintenance.



              <p class="status">

                If you are still experiencing issues, our support team can be reached via StatusPage.

                Use the code below when reporting your issue, this will help the team look up details of what went wrong:











<script nonce="">

  // Google Analytics tracking (BB account & BB marketing profile) = || function () {

    ( = || []).push(arguments);

  }; = +new Date();'create', 'UA-76642781-3', 'auto', 'atl');'atl.send', 'pageview', '/errors/500django');'atl.set', 'referrer', document.URL);


  document.querySelectorAll('.support-ga').forEach(link => {

    link.addEventListener('click', () => {'atl.send', 'pageview', '/support/' + link.dataset.supportGaqPage);




<script async src="" nonce=""></script>




I read the documentation at and the above curl looks correct to me. Can you please have a look and suggest why the API failed.

I tried the API to get the content of a file and it worked. The curl of that API is very similar to the one having the issue

curl -u "deepakpatankar:xxxx" -X 'GET' ''

Screenshot 2021-12-30 at 4.09.49 PM.pngScreenshot 2021-12-30 at 4.09.57 PM.png

2 answers

1 accepted

0 votes
Answer accepted

Hi @Deepak Patankar,

I believe that the reason for this error is the parameter page=1 in the URI. If you remove that, the call should succeed.

I am quoting from our documentation below:

Pagination is often page-bound, with a query parameter page indicating which page is to be returned.

However, clients are not expected to construct URLs themselves by manipulating the page number query parameter. Instead, the response contains a link to the next page. This link should be treated as an opaque location that is not to be constructed by clients or even assumed to be predictable. The only contract around the next link is that it will return the next chunk of results.


It is important to realize that Bitbucket support both list-based pagination and iterator-based pagination. List-based pagination assumes that the collection is a discrete, immutable, consistently ordered, finite array of objects with a fixed size. Clients navigate a list-based collection by requesting offset-based chunks. In Bitbucket Cloud, list-based responses include the optional size, page, and previous element. The the next and previous links typically resemble something like /foo/bar?page=4.

However, not all result sets can be treated as immutable and finite – much like how programming languages tend to distinguish between lists and arrays on one hand and iterators or stream on the other. Where an list-based pagination offers random access into any point in a collection, iterator-based pagination can only navigate forward one element at a time. In Bitbucket such iterator-based pagination contains the next link and pagelen elements, but not necessarily anything else. In these cases, the next link's value often contains an unpredictable hash instead of an explicit page number. The commits resource uses iterator-based pagination.

Kind regards,

Theodora Boudale


Thanks for the answer and explanation!!. Can we specify the pagelen in the request?

I was reading the documentation here 

It hasn't listed pagelen as a parameter, so do we have a way to control how many files we want to read ?

Hi @Deepak Patankar

Yes, it is possible to specify pagelen.

If you do, then the next field would also include the same pagelen you specified.

You are very welcome, and if you have any other questions, please feel free to let me know!

Kind regards,

Theodora Boudale Can I specify the `pagelen` as 1000? Or it can have a maximum value of 100 only?


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events