Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupted file download doesn't stop Nextcloud reading and sending files. #15055

Closed
vfreex opened this issue Apr 11, 2019 · 1 comment
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@vfreex
Copy link

vfreex commented Apr 11, 2019

If a user downloads a large file (let's say, > 10GB) then immediately interrupts the download, Nextcloud will continue to read and send the served file, which causes unnecessary I/O. If the user repeats the action, the server will be overwhelmed and download speed is low due to busy I/O. (Unfortunately, this is common when using Nextcloud dav as the media streaming backend)

After investigation, I found this issue is caused by ignore_user_abort(true) function calls in those files:

apps/dav/appinfo/v2/direct.php
apps/dav/appinfo/v2/remote.php
apps/dav/appinfo/v1/webdav.php
lib/private/legacy/files.php
lib/private/Files/View.php

After changing to ignore_user_abort(false), this problem will not persist.

But, my assumption is that Nextcloud uses ignore_user_abort(true) to do some cleanups, so naively changing it to false could cause some resource leaks.

Is there any graceful way to solve this?

Steps to reproduce

  1. Download a large file with dav, then immediately interrupt the download.
  2. Check I/O operation on the server

Expected behaviour

Tell us what should happen
The server should stop reading the served file from storage.

Actual behaviour

Tell us what happens instead
The server continue to read the served file from storage.

Server configuration

Operating system:
CentOS 7.6 in container
Web server:
apache
Database:
postgresql 9.6
PHP version:
7.2
Nextcloud version: (see Nextcloud admin page)
15
Updated from an older Nextcloud/ownCloud or fresh install:
fresh
Where did you install Nextcloud from:
nextcloud/docker
Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@vfreex vfreex added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 11, 2019
@skjnldsv
Copy link
Member

#interrupteddown
As the version of the software you've reported this for has reached end of life, I will close this ticket. If this is still happening after an upgrade to the latest version, feel free to reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

3 participants