WebDav client Can't upload files >1 MB in NC15

I get the same [webdav] error logs, same feof() and Sabre\DAV\Exception as OP. BUT only if the file is >1MB. All files smaller go right through.

When trying to upload a >1MB file via the portal it stays at “a few seconds” and never completes and stays at ~5% complete forever.

When trying to upload a <1MB file via the portal it completes with no problem.

Disable/enable/remove antivirus has no impact on the outcome. Additionally this has be reproduced on fresh 15.0.0 install on three separate new docker containers.

I can see in /apps/dav/lib/Connector/Sabre/File.php at the feof() on line 171 this is all related to parts of files. Can I infer that the parts are 1MB and if thats correct can we change to a larger value to see if the problem follows partitioning the file?

We had many of such reports. If you have different php-runtime settings/proxy-settings/…, probably somewhere in the chain you run into this limit, and people tend to tell you only half of the story:

Hi tflidd,
I figured out, what my problem was. It was a limit at the http-proxy level. I mentioned it later in an answer.
thanks for looking at my post.

Yes and it is great for others that you shared this information :+1: . But from the initial post it is hard to guess like in this post.

I was excited that might be it as I do have nginx but installed in ubuntu instead of docker. Alas that didin’t fix it.

I already have the following: (Formatting altered by this site)

Nginx.conf

server {
listen 443 ssl http2;
server_name xxx.xxxx.com;
client_max_body_size 8M;
client_body_in_file_only clean;
client_body_buffer_size 32K;
sendfile on;
send_timeout 300s;
location / {
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 64;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
fastcgi_hide_header X-Powered-By;
add_header Front-End-Https on;
# whatever the IP of your cloud server is
proxy_pass http://xxx.xxx.xxx.xxx;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location = /.well-known/carddav {
  return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
  return 301 $scheme://$host/remote.php/dav;
}

location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
    deny all;
}

location ~ ^/(?:updater|ocs-provider)(?:$|/) {
    try_files $uri/ =404;
    index index.php;
}

}

/etc/php/7.2/fpm/php.ini

post_max_size = 18M;

My setup is as follows.

Ubuntu 18.04 LTS
Nginx
Docker nextcloud:15.0.0
Docker 1:10.3.11+maria~bionic

Any guidance please?

Turns out I had:

client_max_body_size = xxxx

defined in two locations. Ref: Fix on Reddit

Everything works perfectly now.

Hey Guys,

I just wanted to publish my solution, especially because I’m using Apache as webserver. I wasted now almost a whole day to find this actually obvious solution, so I hope this helps one or the other to solve the problem quicker:
In my case it was the “LimitRequestBody” function of Apache. After i changed it from default to “0” (=unlimited) it works fine now!

You can do this rather in the “/etc/apache2/sites-available/nextcloud.conf” (respectively corresponding file) or directly in the “.htaccess” of your NC installation root directory. The first one is the better way I think, because it’s update-save.

Code-Example for “/etc/apache2/sites-available/nextcloud.conf”:

<Directory /var/www/nextcloud/>
      Options +FollowSymlinks +Includes
      LimitRequestBody 0
      AllowOverride All

      <IfModule mod_dav.c>
        Dav off
      </IfModule>

      SetEnv HOME /var/www/nextcloud
      SetEnv HTTP_HOME /var/www/nextcloud
</Directory>