nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.93k stars 869 forks source link

413 error when uploading file from iOS client #396

Closed ntompson closed 3 years ago

ntompson commented 6 years ago

Since upgrading to iOS 11 (11.0.2), I have found that the iOS NextCloud client is unable to upload "large" files - in my example, an 11 MB PDF file is failing to upload, with error "413" reported. I have no problem uploading the same file via the desktop client (Mac).

I am not seeing any corresponding entries in the server side log (via the NextCloud web-admin console).

I have experienced this problem on both iPhone 6 plus and iPad Pro (big one, first version). Both are at iOS 11.0.2 and have the latest NextCloud app.

I am initiating the upload using the "share sheet" in Safari with the PDF loaded in the browser. See screen shots.

img_1913 img_1914 img_1915

marinofaggiana commented 6 years ago

Hi ! why you use "Copy to Nextcloud" and not the extension provider "Nextcloud" ? ...

anyway I don't have issue of Upload file ... (10 MB is a small file).

ntompson commented 6 years ago

Uh - what do you mean "extension provider"? In any case, this workflow should still work - should it not?

marinofaggiana commented 6 years ago

U can try : Go to Settings->Advanced->Exit (this remove all file, keys, DB etc.) , remove Nextcloud and reinstall from Appstore or TestFlight.

marinofaggiana commented 6 years ago

@ntompson any new ?

morriswinkler-simple commented 6 years ago

Similar issue here, I can upload a file pressing [+->Upload a file] if I used [+->Upload photos or Videos] I get 413, I checked the logs and the 413 comes from

172.20.0.2 -  [08/Dec/2017:03:11:49 +0000] "PROPFIND /remote.php/webdav/test-2530.jpg HTTP/1.1" 404 210 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/2.18.2" "91.55.82.227"

looks like the HTTP PUT is missing so it was not uploaded,

I can see a PUT while using [+->Upload a file] after it does a PROPFIND that returns 207. BTW: my failed upload filename is test-2341.jpg

marinofaggiana commented 6 years ago

Verify (e.g.) :

in /etc/php//apache2/php.ini

; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 1000M

Dimtar commented 6 years ago

Just wanted to chime in and say I am also getting this issue. I did a little testing and it seems via either auto-upload or just straight upload through the iOS app it won't upload videos that are larger then 100MB. I get a 431 error and it just trys again.

ntompson commented 6 years ago

Apologies for the lengthy hiatus. This is still occurring for me. Upload max file size is significantly larger (10 GB from memory) than the files that trip the NextCloud app up. the iPad app often trips up in this way on a multi-MB PDF (smaller than 10, usually) with the 431 error. Not only that, the iPad app then shows a notification badge, which won't go away. Every time I open the iPad app, the app repeats the 431 error message.

bossfn commented 6 years ago

I had the same issue after setting up NextCloud through letsencrypt (nginx) reverse proxy on my unraid server.

Although everything seemed to be in order, my nextcloud site referenced a 'proxy.conf' file that I needed to edit (/appdata/letsencrypt/nginx/proxy.conf) -- changing the _client_max_bodysize 10m; to _client_max_bodysize 0; removed the 10MB limit on uploading files.

ntompson commented 6 years ago

Still not resolved for me. Interesting to note that with the new support for the iOS files app, large-ish uploads also fail, although silently from the files app.

I am also using nextcloud behind nginx reverse proxy, but already have client_max_body_size 0. Here is the rest of my proxy config in case anything jumps out:

`server {
listen 443 ssl; server_name \<\<mypublicdomain>>;

root /config/www;
index index.html index.htm index.php;

###SSL Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;

###Diffie–Hellman key exchange ###
ssl_dhparam /config/nginx/dhparams.pem;

###SSL Ciphers
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';

###Extra Settings###
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;

    ### Add HTTP Strict Transport Security ###
add_header Front-End-Https on;

client_max_body_size 0;

location / {
    proxy_pass https://<<mylocaldomain>>:444/;
    proxy_max_temp_file_size 2048m;
    include /config/nginx/proxy.conf;
}

}`

(apologies - I don’t seem capable of getting the markdown to behave...)

netpanda commented 6 years ago

Same error for me. Same file uploads without problem either on the web interface or using the linux desktop client, however on IOS, if the file is larger than 100mb the file starts to upload, it completes all the progress bar and just after reaching 100% it shows a message of 413.

netpanda commented 6 years ago

Does anybody have any clue of what could be the problem? it is only happening to me on iOS clients, not on desktop syncs.

ntompson commented 6 years ago

Yes exactly @netpanda - all platforms desktop sync works fine (any sized upload), but iOS uploads of very small sizes break. No update from me.

linxux commented 6 years ago

Same issue when I'm trying to upload the small pics to Nextcloud (which is running with docker-compose: with-nginx-proxy-self-signed-ssl).

The MAX_UPLOAD_SIZE=10GB in proxy layer is ignored by the image.

So I have to specific the configuration for the virtual_host,

echo 'client_max_body_size 10G;' > /path/to/vhost.d/app.example.com

My iPad is happy now. 😄

Dimtar commented 6 years ago

@linxux, I am running the Nextcloud pic install. I’ll look into this, thanks.

trillingsgaard commented 6 years ago

hello i am getting error 413 on my ios device when i try to upload files bigger than 10MB and that is when i connect through my reverse proxy but nothing when i connect to my internal ip can any one help me

netpanda commented 6 years ago

@trillingsgaard if you are using nginx change to client_max_body_size 0.

This thread is for a different problem that nobody seems to be able to solve. the fact that nextcloud allows to upload big files (more than 1GB) from every client (web, desktop, android) except from IOs client.

ChildLearningClub commented 5 years ago

Nextcloud for iOS 2.22.4.0 on Nextcloud Server Version 14.0.3 Files upload to server through web browser but get error code 413 using iOS Nextcloud App.

Seems to be reported on the Nextcloud Forum here as well.

https://help.nextcloud.com/t/file-upload-problem-with-the-new-ios-app-v2-22-1-0/35474

ChildLearningClub commented 5 years ago

My situation was in fact an error on my part, it was my nginx config and having the client_max_body_size set to low. Oddly however I had no problems downloading and uploading files through the browser with those low settings just with the app.

crazybadger commented 5 years ago

I know this is quite an old thread, but I think I've hit the same issue. Running Nextcloud 15.0.0 in a FreeBSD jail and connecting externally through an NGINX reverse-proxy.

I thought I'd back up the photos and videos on an iPad my daughter had been using and thought the Auto upload in Nextcloud was as good a way as any. There were less than 200 files all in, with a few of the video files around 250MB and one at 1.3GB. All of the files, except the 1.3GB file uploaded without a problem, but try as I might the 1.3GB file would not. I've checked PHP settings and it should allow uploads of up to 10GB.

I ended up using iExplorer and copying the .mov file onto my iMac and then from their uploading to Nextcloud using the WUI via Chrome. No issues at all uploading the file this way.

mattie47 commented 5 years ago

@crazybadger so you have client_max_body_size 0; set in your nginx server block?

I'm pretty sure I stopped having issues on IOS after doing this.

On Mon, 31 Dec 2018 at 7:49 AM, crazybadger notifications@github.com wrote:

I know this is quite an old thread, but I think I've hit the same issue. Running Nextcloud 15.0.0 in a FreeBSD jail and connecting externally through an NGINX reverse-proxy.

I thought I'd back up the photos and videos on an iPad my daughter had been using and thought the Auto upload in Nextcloud was as good a way as any. There were less than 200 files all in, with a few of the video files around 250MB and one at 1.3GB. All of the files, except the 1.3GB file uploaded without a problem, but try as I might the 1.3GB file would not. I've checked PHP settings and it should allow uploads of up to 10GB.

I ended up using iExplorer and copying the .mov file onto my iMac and then from their uploading to Nextcloud using the WUI via Chrome. No issues at all uploading the file this way.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/ios/issues/396#issuecomment-450579516, or mute the thread https://github.com/notifications/unsubscribe-auth/AEerXWdSFX9zWZJzpAdyR7DAKU0PofdXks5u-QqxgaJpZM4P88qg .

crazybadger commented 5 years ago

Yes, I already have that in my NGINX server block.

On 30 Dec 2018, at 23:35, mattie47 notifications@github.com wrote:

client_max_body_size 0

netpanda commented 5 years ago

yeap.. I could never fixed this.. I need to sync large videos with Itunes and then upload them through a web browser on my PC, the iOS client was never able to upload large files from my iphone.

Vertux commented 5 years ago

I just run into this issues when I tried to upload a >500MB video via the iOS 12.1.3 client. PHP and Ngnix are configured for 10GB uploads. It looks like the problem still persists.

mangelajo commented 5 years ago

I’m experiencing the same issue. From android Or desktop it os fine,iOS fails

dmitry84 commented 5 years ago

Same issue. Tested on: iPhone 5 iOS v10.0.2 iPhone 7 iOS v12.1 In both cases, images uploaded without any issues, but a video with approx 30mb fails. On the same server installation uploads from desktop or Android (Sams s9) works ok.

driesmp commented 5 years ago

Can confirm this issue, iPhone XS iOS v12.1.2

runningdave commented 5 years ago

I have had the same problem with the iOS App. I couldn't upload images only small text files. The PHP values where all OK. Upload form webbrowser was fine. Apache error log has said this:

request body exceeds maximum size (131072) for SSL buffer could not buffer message body to allow SSL renegotiation to proceed

So I have added this line to my apache directory conf:

SSLRenegBufferSize 100000000

And now the iOS App is working fine.

I am not shure, if this is still an error of the app, because webbrowsers don't need an ssl buffer as big as the file to upload. maybe they send the files in small pieces and the ios app does not?

rkratochvil commented 5 years ago

I’m also having the same issue that many others have stated here. I can upload a 1+gb file over web with a pc, but cannot upload over the iOS app. Running nginx webserver setup. Client max body size is confirmed set to 0. I’ve also tried setting it to 10gb. Still won’t work.

netpanda commented 5 years ago

I have had the same problem with the iOS App. I couldn't upload images only small text files. The PHP values where all OK. Upload form webbrowser was fine. Apache error log has said this:

request body exceeds maximum size (131072) for SSL buffer could not buffer message body to allow SSL renegotiation to proceed

So I have added this line to my apache directory conf:

SSLRenegBufferSize 100000000

And now the iOS App is working fine.

I am not shure, if this is still an error of the app, because webbrowsers don't need an ssl buffer as big as the file to upload. maybe they send the files in small pieces and the ios app does not?

My apache is not handling SSL, the SSL connection ends on my NGINX. I still have the same problem with Nextcloud 15.. Every client except the IOS one, are able to upload files bigger than 100, IOS fails.

Vertux commented 5 years ago

I have just checked it too, Nexcloud 15 does not solve the problem.

Dimtar commented 5 years ago

Out of interest is anyone running their Nextcloud instance behind Cloudflare caching? I am trying my NC instance without Cloudflare because I found that it was breaking my iOS upload. It seems Cloudflare has a limit of 100MB per file on the free tier. Maybe the web and desktop versions didn't run into these issues because they were breaking the files into smaller chunks and the iOS version isn't?

Vertux commented 5 years ago

@Dimtar I personally do not use Cloudflare

nikkolasg commented 5 years ago

Same issue here as well. Works fine with browser, but not iOS.

ArnaudFeld commented 5 years ago

Same issue here as well. Works fine with browser, but not iOS.

For me the Same. Tried also the TestFlight Version. Last Version from Nextcloud Version: 15.0.5.3 Provider: all-inkl.com

mattie47 commented 5 years ago

Hi all,

Can I suggest you make a review/comment on the iOS app store about this? I can't seem to see another way of getting nextcloud to fix this or acknowledge the problem...

ArnaudFeld commented 5 years ago

@mattie47 Done already some minutes ago. Make a comment with 1star only the we get heard

marinofaggiana commented 5 years ago

Hi all, who can create an account test for me ? but before if this problem is the limit of mb of upload file please this is not an issue of Nextcloud iOS, and please close this.

marinofaggiana commented 5 years ago

Hi all,

Can I suggest you make a review/comment on the iOS app store about this? I can't seem to see another way of getting nextcloud to fix this or acknowledge the problem...

We have over 800.000 users ... maybe the problem is not the iOS ... have you thought about it ?

netpanda commented 5 years ago

Marino, there is definitely a difference on how the iOS clients uploads files and how the browser does.. This thread is from 2017, with multiple reports of the same issue, and nobody seems to provide any insight about what can be the cause. I personally tried the Android App, and it has no issue at all either, so who do you think that we should direct our questions if it is not to the iOS app?

marinofaggiana commented 5 years ago

@netpanda but your issue is : no upload any files or not upload files with size > x MB ?

runningdave commented 5 years ago

@marinofaggiana In my case (and I think in the other cases, too) small files are OK bigger ones failed. I had to tweek the ssl buffer of my nextcloud server. The buffer has to be bigger than the size of the uploaded file. (witch is not standard as far as I know) So i think this problem only occurs with encrypted file uploads.

netpanda commented 5 years ago

@marinofaggiana In my case: PC with Firefox, chrome, edge = All files ( Larger than 100 mb) Desktop Client (Windows, Linux, Mac) = All files (Larger than 100 mb) Android App = All files (Larger than 100 mb) iOS App = Only files smaller than 100 mb

Nextcloud configuration:

Nextcloud 15 served by apache2 with Nginx Proxy in front.

The question: Why it works on every environment except in iOS? what iOS is doing differently on the uploads? Im sure that is something that we can fix with some tweaking on Nginx or Apache, but without knowing what is doing differently, I cannot play with that config.

Thanks.

ChildLearningClub commented 5 years ago

I can confirm exactly as above, I thought I had it fixed a long time ago, but I had not. Everything but the iOS app loads larger files without a problem. I have changed the Nginx settings and the upload file size in Nextcloud but still does not work.

rkratochvil commented 5 years ago

Marino,

This issue is definitely with the iOS version of the app. It seems to be pretty easily repeatable. Many, inlcuding myself have laid out all the changes we have made. I personally am using all of the settings and suggested configuration from linuxserver.io. I’m running this in a docker container. I think nextcloud doesn’t care about iOS and this issue as most people are either using this just for downloading or on Android/pc. I as well have given the app a 1 star on the App Store. I’m about ready to scrap the whole setup and move to something else.

marinofaggiana commented 5 years ago

@netpanda create an account for me, I can try with a file > 100 MB.

send: to ios at nextcloud dot com

mattie47 commented 5 years ago

I tried having a look at this yesterday to see if I could reproduce the problem (I normally don't have videos or large files uploading from my iPhone), but I didn't have much luck.

I tried uploading from my phone some 400MB videos but had no issues doing so in the app. I then tried doing the exact same steps as @ntompson's first post in safari with a 22MB PDF but still no problem.

This is with iPhone 7 IOS 11.3.1.

I was originally following this ticket from when I hadn't done the nginx document size changes, meanwhile a few months later I had some 413 errors uploading any files to nextcloud. However, I can no longer reproduce the errors on this ticket.

@netpanda and others above, perhaps create a debug account for @marinofaggiana above to troubleshoot directly..

rkratochvil commented 5 years ago

@marinofaggiana I have sent you an email with test account information.

Thanks, Ryan

xthursdayx commented 5 years ago

I'm having this same problem when trying to upload files to my server via a LetsEncrypt/NGINX reverse proxy, however it is happening with the camera auto-upload function (as some people have previously mentioned). My client_max_body_size is already set to 0 in both the nextcloud server block and my proxy.conf. Could it be possible that the proxy_max_temp_file_size setting in the nextcloud server block needs to be changed?

ArnaudFeld commented 5 years ago

@marinofaggiana any news for us?