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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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

Bitbucket REST API Post File Something went wrong


I am trying to push a file using the{org}/{repo}/src endpoint and I'm getting the following error 



"error": {

  "message":"Something went wrong",




The file in question is a 2.6 Gb zip file. Trying to push a smaller archive results in success.

Trying the request in insomnia results in success, however, it takes 300+ seconds to POST.

Code used:

$client = new Client();

$headers = [
'Content-Type' => 'multipart/form-data'

$options = [
'multipart' => [
'name' => ARCHIVE_NAME,
'contents' => FILE_CONTENTS
'name' => 'message',
'contents' => COMMIT_MESSAGE

$request = new Request('POST', '{org}/{repo}/src', $headers);
$res = $client->sendAsync($request, $options)->wait();

cURL equivalent:

curl --request POST \
--url{org}/{repo}/src \
--header 'Authorization: Basic {token}' \
--header 'Content-Type: multipart/form-data' \
--form message=COMMIT_MESSAGE

Any suggestions would be greatly appreciated.

2 answers

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 20, 2022

Hi, @Alexandru Branescu, welcome to the community! 

Checking the id you shared with us, I can see it means a RequestTimeoutError

Could you please tell me if you are versioning this 2.6 GB file? Because in case you are not, I would advise you to move this file to Git LFS. Here you can read more about how to use Git LFS on Bitbucket Cloud: 

Also, based on this public bug, it looks like we have a limitation on the size of the file we can upload through API: 

I tested it myself and received the same error (RequestTimeoutError) using curl and Insomnia. However, I was able to add the file using a git push, but as I said before, we don't recommend keeping a file of this size in your repo, as if your repository reaches the 4GB limit, your ability to push to the repository will be disabled. You can read more about our limits in this document:

I hope this helps, but do let me know if you have any questions. 

Kind regards,

Hi @Caroline R ,


Thank you for your response. I used to be able to push the file using insomnia, but now I get the same error, so I guess the issue is recent.

We've reduced the size of the file to ~600 MB, but it still seems it exceeds the 500 MB limit.

We do not need versioning, we're generating the file from a web app and need it to be available in git to be pulled in our jenkins pipeline.

Could LFS be used with the rest API, and if so, could you please link some documentation for the usage?


Thank you,

Alex Branescu

Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 03, 2022

Hi, @Alexandru Branescu

As you confirmed you do not need versioning and were able to reduce the file to ~600 MB, I would recommend you to upload this file to your repository using the Downloads section (you can simply access the Downloads section in your repository > click Add files to upload this file), and then use our API endpoint to get the file in Jenkins:

This is an example of a request you could follow: 

curl -X GET -u XXX:XXX "{workspace}/{repo}/downloads/" >>

Please let me know how it goes and feel free to ask any additional questions regarding this case.

Kind regards,

Extra debugging information after setting Guzzle Client debug to true:

* Connected to ( port 443 (#0) 
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Atlassian, Inc.; CN=*.b
* start date: Jul 1 00:00:00 2022 GMT
* expire date: Jul 21 23:59:59 2023 GMT
* subjectAltName: host "" matched cert's "*
* issuer: C=US; O=DigiCert Inc;; CN=DigiCert SHA2 High
Assurance Server CA
* SSL certificate verify ok.
> POST /2.0/repositories/{org}/{repo}/src HTTP/1.1
Expect: 100-Continue
User-Agent: GuzzleHttp/6.5.5 curl/7.74.0 PHP/8.0.21
Content-Type: multipart/form-data; boundary=6e12d08d-ea97-43cd-ba63-80da19e
Accept: application/json
Authorization: Basic {token}
Content-Length: 649360296

* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< Server: nginx
< Vary: Authorization, Origin
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Content-Type: application/json; charset=utf-8
< X-OAuth-Scopes: webhook, pullrequest:write, project, team, account
< X-B3-TraceId: 915b79dcd8428168
< X-Usage-Output-Ops: 2518832
< X-Dc-Location: Micros-3
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Date: Wed, 14 Sep 2022 17:23:54 GMT
< X-Usage-User-Time: 29.324385
< X-Usage-System-Time: 2.774709
< X-Served-By: 4df28947ebce
< Expires: Wed, 14 Sep 2022 17:23:54 GMT
< X-Sentry-ID: 2ae380433bc54e3c92a21be477dce8f5
< X-View-Name: bitbucket.apps.repo2.api.v20.src.CommitBuilderHandler
< X-Static-Version: 8332847e6078
< X-Accepted-OAuth-Scopes: repository:write
< X-Credential-Type: apppassword
< X-Render-Time: 38.111363887786865
< Connection: close
< X-Usage-Input-Ops: 24
< X-Frame-Options: SAMEORIGIN
< X-Version: 8332847e6078
< X-Request-Count: 716
< Content-Length: 99
* Closing connection 0

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events