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

[Bug]: Nextcloud does not properly support large files. #35264

Closed
6 of 9 tasks
SebastienCaunes opened this issue Nov 18, 2022 · 2 comments
Closed
6 of 9 tasks

[Bug]: Nextcloud does not properly support large files. #35264

SebastienCaunes opened this issue Nov 18, 2022 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@SebastienCaunes
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

This issue is not only software, it is clearly a problem with the Nextcloud team.
I experienced the issue, I looked for it, it has been reported plenty of times and always closed without proper solution.
Users are still complaining in the issue after it is closed but the team may not see it as it is closed.

CPU resources are not released when a download of large file and video is interrupted. This leads to high CPU usage and unusable server.

Exemples of user report closed without bugfix :

And firstly, why does the simple streaming of file require this much CPU ?
It look like the file is streamed through php process, which is inefficient. Why not letting apache serve this file directly ?
If user request a file bigger than 10MB then create a temp folder, inside this temp folder create a symlink to the file (with same name) then redirect user to this file served directly by apache.
Then the cron job will periodically delete all temp folders older than 24h.

Steps to reproduce

  1. upload a large file video
  2. start downloading or watching it
  3. then stop
  4. the CPU is not released and server rapidly become unusable

Expected behavior

When the user stops watching the video or downloading the file, the process should be stopped.

Installation method

Official All-in-One appliance

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "x.x.x.x",
            "nextcloud.xxx.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.7.1",
        "overwrite.cli.url": "https:\/\/nextcloud.xxx.org",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "skeletondirectory": "",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0
        },
        "mysql.utf8mb4": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "onlyoffice",
            "ocsms"
        ],
        "has_rebuilt_cache": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "updater.release.channel": "stable",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "default_phone_region": "FR"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - announcementcenter: 6.3.1
  - apporder: 0.15.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.5.2
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.2
  - drawio: 1.0.5
  - event_update_notification: 2.0.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_automatedtagging: 1.14.0
  - files_mindmap: 0.0.27
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - groupfolders: 12.0.2
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - onlyoffice: 7.5.8
  - password_policy: 1.14.0
  - passwords: 2022.11.21
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - sociallogin: 5.1.2
  - socialsharing_email: 2.5.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - encryption: 2.4.0
  - files_external
  - files_trackdownloads: 1.11.0
  - firstrunwizard: 2.5.0
  - spreed: 14.0.6
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"fLwPfGNF1tX5PJU78Nzx","level":3,"time":"2020-02-16T03:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":646,"function":"checkInstalled","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":1078,"function":"init","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/cron.php","line":41,"args":["\/var\/www\/nextcloud\/lib\/base.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/lib\/base.php","Line":277,"CustomMessage":"--"},"userAgent":"--","version":""}
{"reqId":"mwMpBj2qRxAr9wlUZMzm","level":3,"time":"2020-02-16T03:15:50+00:00","remoteAddr":"90.76.33.45","user":"--","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin\/overview","message":"touch(): Utime failed: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.106 Safari\/537.36","version":""}
{"reqId":"mwMpBj2qRxAr9wlUZMzm","level":3,"time":"2020-02-16T03:15:50+00:00","remoteAddr":"90.76.33.45","user":"--","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin\/overview","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#241","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.106 Safari\/537.36","version":""}
{"reqId":"mwMpBj2qRxAr9wlUZMzm","level":3,"time":"2020-02-16T03:15:50+00:00","remoteAddr":"90.76.33.45","user":"--","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin\/overview","message":"chmod(): Operation not permitted at \/var\/www\/nextcloud\/lib\/private\/Config.php#244","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.106 Safari\/537.36","version":""}
{"reqId":"mwMpBj2qRxAr9wlUZMzm","level":3,"time":"2020-02-16T03:15:50+00:00","remoteAddr":"90.76.33.45","user":"--","app":"index","method":"GET","url":"\/index.php\/settings\/admin\/overview","message":{"Exception":"OC\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/lib\/private\/Config.php","line":132,"function":"writeData","class":"OC\\Config","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/private\/SystemConfig.php","line":111,"function":"setValue","class":"OC\\Config","type":"->","args":["instanceid","ocd936kso2vv"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/legacy\/util.php","line":1152,"function":"setValue","class":"OC\\SystemConfig","type":"->","args":["instanceid","ocd936kso2vv"]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":415,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":642,"function":"initSession","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":1078,"function":"init","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/index.php","line":40,"args":["\/var\/www\/nextcloud\/lib\/base.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/lib\/private\/Config.php","Line":251,"Hint":"This can usually be fixed by giving the webserver write access to the config directory. See https:\/\/docs.nextcloud.com\/server\/17\/go.php?to=admin-dir_permissions","CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.106 Safari\/537.36","version":""}
{"reqId":"mwMpBj2qRxAr9wlUZMzm","level":3,"time":"2020-02-16T03:15:50+00:00","remoteAddr":"90.76.33.45","user":"--","app":"index","method":"GET","url":"\/index.php\/settings\/admin\/overview","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: could not find driver","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php","line":1040,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php","line":216,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php","line":683,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php","line":151,"function":"setTransactionIsolation","class":"Doctrine\\DBAL\\Connection","type":"->","args":[2]},{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DriverManager.php","line":195,"function":"__construct","class":"OC\\DB\\Connection","type":"->","args":[{"adapter":"OC\\DB\\AdapterSqlite","driver":"pdo_sqlite","wrapperClass":"OC\\DB\\Connection","user":"","password":"","path":"\/var\/www\/nextcloud\/data\/owncloud.db","tablePrefix":"oc_","sqlite.journal_mode":"WAL","defaultTableOptions":{"collate":"utf8_bin","tablePrefix":"oc_"},"platform":{"__class__":"OC\\DB\\OCSqlitePlatform"}},{"__class__":"Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver"},{"__class__":"Doctrine\\DBAL\\Configuration"},{"__class__":"Doctrine\\Common\\EventManager"}]},{"file":"\/var\/www\/nextcloud\/lib\/private\/DB\/ConnectionFactory.php","line":158,"function":"getConnection","class":"Doctrine\\DBAL\\DriverManager","type":"::","args":[{"adapter":"OC\\DB\\AdapterSqlite","driver":"pdo_sqlite","wrapperClass":"OC\\DB\\Connection","user":"","password":"","path":"\/var\/www\/nextcloud\/data\/owncloud.db","tablePrefix":"oc_","sqlite.journal_mode":"WAL","defaultTableOptions":{"collate":"utf8_bin","tablePrefix":"oc_"},"platform":{"__class__":"OC\\DB\\OCSqlitePlatform"}},{"__class__":"Doctrine\\DBAL\\Configuration"},{"__class__":"Doctrine\\Common\\EventManager"}]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":635,"function":"getConnection","class":"OC\\DB\\ConnectionFactory","type":"->","args":["sqlite",{"user":"","password":"","path":"\/var\/www\/nextcloud\/data\/owncloud.db","tablePrefix":"oc_","sqlite.journal_mode":"WAL","defaultTableOptions":{"collate":"utf8_bin","tablePrefix":"oc_"},"platform":{"__class__":"OC\\DB\\OCSqlitePlatform"}}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":120,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OCP\\IDBConnection"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":161,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OCP\\IDBConnection"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":120,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["DatabaseConnection"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":1554,"function":"query","class":"OC\\ServerContainer","type":"->","args":["DatabaseConnection"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":458,"function":"getDatabaseConnection","class":"OC\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":120,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\AppConfig"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":689,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\AppConfig"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":120,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\App\\AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":161,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\App\\AppManager"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":120,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":1725,"function":"query","class":"OC\\ServerContainer","type":"->","args":["AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/legacy\/template.php","line":284,"function":"getAppManager","class":"OC\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/index.php","line":51,"function":"printErrorPage","class":"OC_Template","type":"::","args":["Can't write into config directory!","This can usually be fixed by giving the webserver write access to the config directory. See https:\/\/docs.nextcloud.com\/server\/17\/go.php?to=admin-dir_permissions",503]}],"File":"\/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php","Line":64,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.106 Safari\/537.36","version":""}

Additional info

We love you thank you for this work !

@SebastienCaunes SebastienCaunes added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 18, 2022
@kesselb
Copy link
Contributor

kesselb commented Nov 18, 2022

Huge download: File gets completely read even after download is cancelled #8161

This one is not closed?

Extremely high IO usage when deal with large files #22334

The issue author decided to close it. Technically, it was most likely a duplicate of #8161.

[Bug]: Windows11+WSL2 server: High cpu&disk usage after seeking/switching large video. #34979

We do not support WSL2. And even if we would, it would be still a duplicate of #8161.

Video files still being load in background even file isn't viewed anymore viewer#894

The viewer maintainer provided a patch for it and closed the issue.

Your report is just another duplicate of #8161.
Why don't you close your report and add your ideas to #8161?
Also pull requests are always welcome 👋

@violethaze74
Copy link

👍🏻

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