Pushing to BitBucket Gives "413 Request Entity Too Large" But No Large Files

Bob Hatcher October 5, 2017

I am trying to push a local repo (initial commit) into BitBucket using SourceTree. SourceTree gives the following error:

413 Request Entity Too Large

However, the largest file in my repo is 995kb and I get this even if I exclude it. The entire repo is about 36mb.

I set the http.postBuffer to some arbitrarily large value in my local git.

LFS is enabled in the repo.

I get the same error from command line.

TIA for any help.

 

2 answers

2 votes
Justin Evans
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2017

If you have a reverse proxy like Apache or Nginx sitting in front of the Bitbucket application, and you are attempting to push to http:// or https:// you'll likely have to tweak a parameter in your reverse proxy.

Nginx example:

http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

Bob Hatcher October 5, 2017

Thank you, I have referred this to the appropriate people at my company. In the meantime I was able to push using ssh.

Michael Brown [Ascend] October 7, 2017

To follow on Justin's point, we just resolved this issue for one our clients. We did so by updating the following to the NGINX  Configuration: 

  • Go to /etc/nginx
  • Open the nginx.conf
  • Add the following lines to the configuration:
    • client_max_body_size 500M;
    • client_body_timeout 120s;
  • Restart NGINX

Apache has a similar setting I believe that needs to be updated as well. 

Like # people like this
0 votes
Rasti February 4, 2021

I was experiencing the same issue, however not by pushing to Bitbucket repository, but by posting code insights via REST API as described at https://developer.atlassian.com/server/bitbucket/tutorials-and-examples/code-insights-tutorial. The posted JSON has few kilobytes. The curl was giving me just HTTP 413.

We use the Official Bitbucket Docker image, with no Apache nor Nginx in front of Bitbucket, so I was wondering, where is the error coming from. After looking into the response body it turned out to be a hard limit of annotations count allowed to be posted within the report to 1000. The response was:

{"errors":[{"context":null,"message":"Max annotation limit would be exceeded. Only 1,000 annotations can be stored for a single report","exceptionName":null}]}

 

Hope it helps someone stumbling upon a similar issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events