File Sharing. Internal Error WebDAV service. Error Code: 413

Created:

2016-11-16 13:09:58 UTC

Modified:

2017-08-08 13:36:42 UTC

0

Was this article helpful?


Have more questions?

Submit a request

File Sharing. Internal Error WebDAV service. Error Code: 413

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

  1. When trying to upload files larger than 128MiB in File Sharing operation finishes with an error:

    Internal Error WebDAV service. Error Code: 413
  2. Also, in /var/log/plesk/panel.log the following message can be observed:

    ERR [panel] File upload failed : sharing type=private, folder=admin, error=Request Entity Too Large

Cause

Upload is prevented either by a system limitation or a Mod_Security rule.

Resolution

Check through system limitations:

  1. check sw-cp-server limits

    # grep client_max_body_size /etc/sw-cp-server/config
    client_max_body_size 0;
  2. check sw-engine limits

    # egrep -i 'upload_max_filesize|post_max_size|memory_limit' /usr/local/psa/admin/conf/php.ini
    memory_limit = 2560M
    post_max_size = 2147483647
    upload_max_filesize = 2147483647
  3. check nginx limit

    # grep client_max_body_size /etc/nginx/nginx.conf
    client_max_body_size 0;
    # grep client_max_body_size /var/www/vhosts/system/domain.tld/conf/*nginx*
    /var/www/vhosts/system/domain.tld/conf/nginx_ip_default.conf: client_max_body_size 2048m;
    /var/www/vhosts/system/hyacademy-dev.de/conf/nginx_ip_default.conf: client_max_body_size 2048m;

    That limit can be changed in /usr/local/psa/admin/conf/panel.ini config file. Add the following lines:

    [webserver]nginxClientMaxBodySize = 2048m

  4. check Apache limit

    # grep -ir LimitRequestBody /etc/apache2/apache2.conf
    LimitRequestBody 2147483647

Check limitations by Mod_Security rule

If altering none of the above settings helped, check Mod_Security audit log in /var/log/modsec_audit.log :

    --f736050c-F--
HTTP/1.1 413 Request Entity Too Large
Content-Length: 452
Connection: close
Content-Type: text/html; charset=iso-8859-1

--f736050c-H--
Message: Request body (Content-Length) is larger than the configured limit (134217728).
Stopwatch: 1464084427248896 367 (- - -)
Stopwatch2: 1464084427248896 367; combined=17, p1=2, p2=0, p3=0, p4=11, p5=4, sr=0, sw=0, l=0, gc=0
Producer: ModSecurity for Apache/2.9.0 (http://www.modsecurity.org/); 201605211946.
Server: Apache
Engine-Mode: "ENABLED"

In case you see messages with the same content:

Request Entity Too Large, Request body (Content-Length) is larger than the configured limit (134217728) ,

then the upload is blocked by Web Application Firewall ( i.e . Mod_Security) which will allow to transfer only 128MiB of data.

At this point one can either disable Web Application Firewall for a particular domain or edit Mod_Security rules manually.

To disable Mod_Security for a domain, navigate to Home > Subscriptions > Domains > Web Application Firewall

Have more questions? Submit a request
Please sign in to leave a comment.