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

Uploading files in shared folders is broker with NC 14.0.1 #11485

Closed
loeffelpan opened this issue Oct 1, 2018 · 17 comments
Closed

Uploading files in shared folders is broker with NC 14.0.1 #11485

loeffelpan opened this issue Oct 1, 2018 · 17 comments
Assignees
Milestone

Comments

@loeffelpan
Copy link

loeffelpan commented Oct 1, 2018

Steps to reproduce

  1. Edit: The recipient needs to have a quota of 0
  2. Share any folder with any account and give permissions to write.
  3. Try to upload any file with the account the folder is shared with.

Expected behaviour

Progress bar should appear and uploading starts.

Actual behaviour

Uploading files in any shared folder isn’t posible. After choosing a file an click “ok” - nothing happens.
Uploading file in “real” folders is working.

Server configuration

Operating system: Ubuntu 18.04

Web server: Apache

Database: MySQL

PHP version: PHP-FPM 7.2

Nextcloud version: 14.0.1

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Where did you install Nextcloud from: Web-Updater

Signing status:

Signing status
No errors have been found.

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "toothless.goip.de",
            "toothless.fritz.box"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/toothless.goip.de",
        "dbtype": "mysql",
        "version": "14.0.1.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "enable_previews": false,
        "skeletondirectory": "",
        "logtimezone": "Europe\/Berlin",
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "htaccess.RewriteBase": "\/",
        "filesystem_check_changes": 1,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": 587,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "knowledgebaseenabled": false,
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
        "data-fingerprint": "daf767cfda940da49aead6029558d893",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    },
}

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Firefox

Operating system: Windows 10

Nextcloud log (data/nextcloud.log)

Nextcloud log
Error	remote	TypeError: Argument 2 passed to OCA\DAV\Connector\Sabre\Directory::__construct() must implement interface OCP\Files\FileInfo, boolean given, called in /var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93

    /var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 93:
    OCA\DAV\Connector\Sabre\Directory->__construct(OC\Files\View {}, false)

    /var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 51:
    OCA\DAV\Upload\UploadHome->impl()

    /var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 61:
    OCA\DAV\Upload\UploadHome->getChild("web-file-up ... 8")

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 105:
    OCA\DAV\Upload\UploadHome->childExists("web-file-up ... 8")

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/Plugin.php - line 878:
    Sabre\DAV\Tree->nodeExists("uploads/Tes ... 8")

    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/DavAclPlugin.php - line 95:
    Sabre\DAVACL\Plugin->beforeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

    OCA\DAV\Connector\Sabre\DavAclPlugin->beforeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

    /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:
    call_user_func_array([ OCA\DAV\Co ... "], [ Sabre\HTTP ... }])

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466:
    Sabre\Event\EventEmitter->emit("beforeMethod", [ Sabre\HTTP ... }])

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

    /var/www/nextcloud/apps/dav/lib/Server.php - line 293:
    Sabre\DAV\Server->exec()

    /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
    OCA\DAV\Server->exec()

    /var/www/nextcloud/remote.php - line 163:
    require_once("/var/www/ne ... p")
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #10844 (14.0.0 RC 1), #3229 (NC 11.0.1 + Gallery 16.0.0: Upload button has no effect), #11443 (install fo nc 14.0.1 fails on updating apps), #10370 (14.0.0 Beta 1), and #11226 ([BUG] Share a Share (NC 14.0.0.19)).

@MorrisJobke
Copy link
Member

Progress bar should appear and uploading starts.

Just works fine here.

Error remote TypeError: Argument 2 passed to OCA\DAV\Connector\Sabre\Directory::__construct() must implement interface OCP\Files\FileInfo, boolean given, called in /var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93

Okay - this looks 🐟y ... cc @rullzer

@loeffelpan
Copy link
Author

Works fine in your instance?
Sure that you tried to upload in a shared folder with another user?
Uploading in my folders works for me, too.

@MorrisJobke
Copy link
Member

Yes - I used a folder that was shared with me on a 14 instance. That was the scenario you wrote in this ticket, right? It was also just a shared folder on the same instance and no federated one.

@loeffelpan
Copy link
Author

Hm, now this works for me as well. No error in log.
Yesterday, immediately after the update to 14.0.1 this surely didn't work.
Strange things...

Maybe cron/cleanup or something else have to run after the update to fix this?

@MorrisJobke
Copy link
Member

I’m not aware of any cleanup in this regard:/ let’s close it for now and it can be reopened once it happens again and we can properly verify it.

@neeral85
Copy link

neeral85 commented Oct 5, 2018

I have the same issue, but the error appears only on lager files~>10 MB & User is from LDAP! Also the shared folder is a goup folder.
The same error occours if a file already exitsts, the overwrite-dialog appears and you click on cancel (nothing happens).

Therefore please reopen.

Log:
/var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 93:
OCA\DAV\Connector\Sabre\Directory->__construct(OC\Files\View {}, false)
/var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 51:
OCA\DAV\Upload\UploadHome->impl()
/var/www/nextcloud/apps/dav/lib/Upload/UploadHome.php - line 61:
OCA\DAV\Upload\UploadHome->getChild("web-file-up ... 8")
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 105:
OCA\DAV\Upload\UploadHome->childExists("web-file-up ... 8")
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/Plugin.php - line 878:
Sabre\DAV\Tree->nodeExists("uploads/tte ... 8")
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/DavAclPlugin.php - line 95:
Sabre\DAVACL\Plugin->beforeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})
OCA\DAV\Connector\Sabre\DavAclPlugin->beforeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:
call_user_func_array([ OCA\DAV\Co ... "], [ Sabre\HTTP ... }])
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466:
Sabre\Event\EventEmitter->emit("beforeMethod", [ Sabre\HTTP ... }])
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})
/var/www/nextcloud/apps/dav/lib/Server.php - line 293:
Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 163:
require_once("/var/www/ne ... p")

@lubo
Copy link

lubo commented Oct 23, 2018

I'm having the same problem on FreeBSD 11.2-RELEASE-p4 and PHP 7.2 with version 14.0.1 installed from the binary repository. Just for the record, my data directory is on different ZFS dataset than the rest of the installation.

The problem seems to be in the way that version 14 handles storage quotas. In my case, everyone except admin and several managers has quota set to 0. Admin shares his folders with everybody else, so the regular users can only write to admin's folders and only these users seem to be affected by this issue.

@MorrisJobke Could you my scenario, please?

@MorrisJobke
Copy link
Member

The problem seems to be in the way that version 14 handles storage quotas. In my case, everyone except admin and several managers has quota set to 0. Admin shares his folders with everybody else, so the regular users can only write to admin's folders and only these users seem to be affected by this issue.

@MorrisJobke Could you my scenario, please?

I can reproduce, but only if the file is larger than 10 MB. Let me open a new ticket with a better description.

@MorrisJobke
Copy link
Member

I just realized that the log of the OP is the same that I got -> reopening.

@MorrisJobke
Copy link
Member

I opened #12010 which provides a better exception message, but doesn't solve the problem yet.

@MorrisJobke MorrisJobke added this to the Nextcloud 15 milestone Oct 24, 2018
@lubo
Copy link

lubo commented Oct 24, 2018

I've just upgraded to version 14.0.3 and the problem persists.

Also, when the user with quota set 0 tries to delete a file in a shared folder, the request crashes with the following error:

OCA\Files_Trashbin\Exceptions\CopyRecursiveException: 

/usr/local/www/nextcloud/apps-pkg/files_trashbin/lib/Trashbin.php - line 191:
OCA\Files_Trashbin\Trashbin::copy_recursive("admin/files ... 5", "test/files_ ... 5", OC\Files\View {})

/usr/local/www/nextcloud/apps-pkg/files_trashbin/lib/Trashbin.php - line 287:
OCA\Files_Trashbin\Trashbin::copyFilesToUser("/Data/test/ ... p", "admin", "test/lemmatization-sk.zip", "test", 1540376515)

/usr/local/www/nextcloud/apps-pkg/files_trashbin/lib/Storage.php - line 291:
OCA\Files_Trashbin\Trashbin::move2trash("test/lemmatization-sk.zip", false)

/usr/local/www/nextcloud/apps-pkg/files_trashbin/lib/Storage.php - line 185:
OCA\Files_Trashbin\Storage->doDelete("lemmatization-sk.zip", "unlink")

/usr/local/www/nextcloud/lib/private/Files/View.php - line 1146:
OCA\Files_Trashbin\Storage->unlink("lemmatization-sk.zip")

/usr/local/www/nextcloud/lib/private/Files/View.php - line 709:
OC\Files\View->basicOperation("unlink", "/test/lemmatization-sk.zip", [ "delete"])

/usr/local/www/nextcloud/apps-pkg/dav/lib/Connector/Sabre/File.php - line 379:
OC\Files\View->unlink("/test/lemmatization-sk.zip")

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179:
OCA\DAV\Connector\Sabre\File->delete()

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 291:
Sabre\DAV\Tree->delete("files/test/ ... p")

Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:
call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:
Sabre\Event\EventEmitter->emit("method:DELETE", [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/apps-pkg/dav/lib/Server.php - line 293:
Sabre\DAV\Server->exec()

/usr/local/www/nextcloud/apps-pkg/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()

/usr/local/www/nextcloud/remote.php - line 163:
require_once("/usr/local/ ... p")

Although the file gets moved to folder owner's trash bin.

@MorrisJobke
Copy link
Member

Although the file gets moved to folder owner's trash bin.

It is usually moved to both trash bins on purpose and this fails.

@MorrisJobke
Copy link
Member

Breaking commit is obviously:

0ff83f7 Do not allow folder creation with quota of 0

🙈

@rullzer
Copy link
Member

rullzer commented Oct 24, 2018

I'll look into this

rullzer added a commit that referenced this issue Oct 24, 2018
Fixes #11485

This allows uploads to shared folders.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
Copy link
Member

rullzer commented Oct 24, 2018

It is usually moved to both trash bins on purpose and this fails.

I'll look into that after #12022 is in.
Because we should not fail hard in this case.

rullzer added a commit that referenced this issue Oct 25, 2018
Fixes #11485

This allows uploads to shared folders.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
weeman1337 pushed a commit that referenced this issue Oct 28, 2018
Fixes #11485

This allows uploads to shared folders.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@lubo
Copy link

lubo commented Nov 25, 2018

Deleting files still crashes on 14.0.4 with the same trace as I've posted before. Also, I'm unable to set default quota to 0 B on 14.0.4, so I've been using 1 B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants