Skip to content

Uploading a blacklisted files via WebUI results in no/not helpful error message #4389

@individual-it

Description

@individual-it

Steps to reproduce

  1. blacklist some files in config.php e.g 'blacklisted_files' => array('.htaccess','c.png'),
  2. upload a blacklisted file via normal WebUI
  3. upload a blacklisted file via upload only share

Expected behaviour

  • Error message saying that this file cannot be uploaded
  • the blacklisted files checked by JS before uploading. fileIsBlacklisted(file) seems not to do it correctly https://github.com/nextcloud/server/blob/master/core/js/js.js#L231 oc_config.blacklist_files_regex contains only "\.(part|filepart)$"
  • server should not reply InsufficientStorage but something more useful

Actual behaviour

  1. not enough free space error message
  2. no message at all, just spinning wheel

Server configuration

Operating system:
Debian 4.8.15-2~bpo8+2
Web server:
Apache 2.0
Database:
sqlite
PHP version:
7.0.7-5
Nextcloud version: (see Nextcloud admin page)
12.0 alpha (git master)
Updated from an older Nextcloud/ownCloud or fresh install:
fresh install
Where did you install Nextcloud from:
git
List of activated apps:

App list
Enabled:
  - comments: 1.2.0
  - dav: 1.2.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_sharing: 1.4.0
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - lookup_server_connector: 1.0.0
  - provisioning_api: 1.2.0
  - sharebymail: 1.2.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.0
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - contacts
  - encryption
  - files_external
  - testing
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "ocigom9x0hj5",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "\/home\/artur\/www\/nextcloud-server\/data",
        "overwrite.cli.url": "http:\/\/localhost\/nextcloud-server",
        "dbtype": "sqlite3",
        "version": "12.0.0.14",
        "installed": true,
        "blacklisted_files": [
            ".htaccess",
            "c.png"
        ],
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
FF 52.0.2
Operating system:
Debian

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log a. normal WebUI:
{"reqId":"DqXAw2CrveyRjCOxTXZF","level":4,"time":"2017-04-19T03:15:37+00:00","remoteAddr":"::1","user":"admin","app":"webdav","method":"PUT","url":"\/nextcloud-server\/remote.php\/webdav\/c.png","message":"Exception: {\"Message\":\"HTTP\\\/1.1 507 Insufficient Storage\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InsufficientStorage\",\"Code\":0,\"Trace\":\"#0 [internal function]: OCA\\\\DAV\\\\Connector\\\\Sabre\\\\QuotaPlugin->checkQuota('\\\/c.png', Resource id #47, Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory), false)\\n#1 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1093): Sabre\\\\Event\\\\EventEmitter->emit('beforeCreateFil...', Array)\\n#3 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('c.png', Resource id #47, NULL)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#7 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(63): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/remote.php(162): require_once('\\\/home\\\/artur\\\/www...')\\n#10 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/QuotaPlugin.php\",\"Line\":113,\"User\":\"admin\"}","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:52.0) Gecko\/20100101 Firefox\/52.0","version":"12.0.0.14"}

b. upload only share:


{"reqId":"PUYPd2ifTspA5ecV5eOG","level":4,"time":"2017-04-19T03:16:18+00:00","remoteAddr":"::1","user":"--","app":"webdav","method":"PUT","url":"\/nextcloud-server\/public.php\/webdav\/c.png","message":"Exception: {\"Message\":\"HTTP\\\/1.1 507 Insufficient Storage\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\InsufficientStorage\",\"Code\":0,\"Trace\":\"#0 [internal function]: OCA\\\\DAV\\\\Connector\\\\Sabre\\\\QuotaPlugin->checkQuota('\\\/c.png', Resource id #48, Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory), false)\\n#1 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1093): Sabre\\\\Event\\\\EventEmitter->emit('beforeCreateFil...', Array)\\n#3 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('c.png', Resource id #48, NULL)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#7 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/public.php(76): require_once('\\\/home\\\/artur\\\/www...')\\n#10 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/nextcloud-server\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/QuotaPlugin.php\",\"Line\":113,\"User\":false}","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:52.0) Gecko\/20100101 Firefox\/52.0","version":"12.0.0.14"}

Browser log

Browser log a. normal WebUI:
PUT XHR http://localhost/nextcloud-server/remote.php/webdav/c.png [HTTP/1.1 507 Insufficient Storage 128ms]
Response: 
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\InsufficientStorage</s:exception>
  <s:message/>
</d:error>

GET XHR  http://localhost/nextcloud-server/index.php/apps/files/ajax/getstoragestats.php [HTTP/1.1 200 OK 75ms]
Response: 
{"data":{"uploadMaxFilesize":535822336,"maxHumanFilesize":"Upload (max. 511 MB)","freeSpace":116587892736,"usedSpacePercent":0,"owner":"admin","ownerDisplayName":"admin"},"status":"success"}

b. upload-only share:

PUT XHR http://localhost/nextcloud-server/public.php/webdav/c.png [HTTP/1.1 507 Insufficient Storage 171ms]
Response:
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\InsufficientStorage</s:exception>
  <s:message/>
</d:error>

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developAccepted and waiting to be taken care ofbugfeature: sharingpapercutAnnoying recurring UX issue with possibly simple fix.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions