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

Sharing: Cannot delete files from share #1708

Closed
hoellen opened this issue Oct 11, 2016 · 8 comments
Closed

Sharing: Cannot delete files from share #1708

hoellen opened this issue Oct 11, 2016 · 8 comments
Assignees

Comments

@hoellen
Copy link
Contributor

hoellen commented Oct 11, 2016

Steps to reproduce

  1. Share folder in WebUI via link
  2. Set 'Allow editing' and password
  3. open link on another client and type in password
  4. upload file
  5. delete uploaded file

Expected behaviour

User should be able to upload files and delete them.

Actual behaviour

User can upload a file, but can't delete the uploaded file. (Notification message on top: Error deleting file "test.pdf" and one error in Nextcloud log file.)

Server configuration

Operating system:
CentOS Linux release 7.2.1511 (Core)

Web server:
nginx/1.10.1

Database:
mysql Ver 15.1 Distrib 5.5.50-MariaDB

PHP version:
PHP 7.0.11

Nextcloud version: (see Nextcloud admin page)
10.0.1 (stable)
Updated from an older Nextcloud/ownCloud or fresh install:
OC 8.x -> NC 9 -> NC 9.0.52 -> NC 10 -> NC 10.0.1

Where did you install Nextcloud from:
.tar.bz2 archive from nextcloud.com website

Signing status:

No errors have been found.

List of activated apps:

App list

Enabled:
  - activity: 2.3.2
  - admin_audit: 1.0.0
  - calendar: 1.4.0
  - comments: 1.0.0
  - contacts: 1.4.0.0
  - dav: 1.0.1
  - federatedfilesharing: 1.0.1
  - federation: 1.0.1
  - files: 1.5.2
  - files_accesscontrol: 1.1.2
  - files_automatedtagging: 1.1.1
  - files_external: 1.0.2
  - files_pdfviewer: 0.8.1
  - files_retention: 1.0.0
  - files_sharing: 1.0.0
  - files_texteditor: 2.1
  - files_trashbin: 1.0.0
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 15.0.0
  - news: 9.0.4
  - notifications: 0.3.0
  - password_policy: 1.0.0
  - provisioning_api: 1.0.0
  - serverinfo: 1.1.1
  - survey_client: 0.1.5
  - systemtags: 1.0.2
  - tasks: 0.9.3
  - templateeditor: 0.1
  - theming: 1.0.1
  - updatenotification: 1.0.1
  - workflowengine: 1.0.1
Disabled:
  - encryption
  - external
  - user_external
  - user_ldap
  - user_saml

The content of config/config.php:

Config report

<?php
$CONFIG = array (
  'instanceid' => 'secret',
  'passwordsalt' => 'verysecret',
  'secret' => 'verysecret',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.com',
  ),
  'datadirectory' => '/var/www/html/cloud/data',
  'overwrite.cli.url' => 'https://cloud.example.com',
  'dbtype' => 'mysql',
  'version' => '9.1.1.5',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'verysecret',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'php',
  'mail_domain' => 'example.com',
  'appstore.experimental.enabled' => false,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'theme' => '',
  'loglevel' => 2,
  'htaccess.RewriteBase' => '/',
  'updater.release.channel' => 'stable',
);

Are you using external storage, if yes which one:
Google Drive and Dropbox connection. But no file which is affected by this error is in the external storage.

Are you using encryption:
No.

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

Client configuration

Browser:
Firefox 49.0.1
Operating system:
Arch Linux

Logs

Web server error log

Web server error log

123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/s/eiHgvhpro9yhb07 HTTP/2.0" 200 16814 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/core/js/oc.js?v=ac7b28b071603951b84fab89322a62c3 HTTP/2.0" 200 3536 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/apps/theming/styles?v=32 HTTP/2.0" 200 1966 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/apps/theming/js/theming?v=32 HTTP/2.0" 200 717 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/download.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/logo-icon.svg?v=1 HTTP/2.0" 304 135 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/toggle-pictures.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/filetypes/folder.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/places/home.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/breadcrumb.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /index.php/apps/gallery/config.public?extramediatypes=1&token=eiHgvhpro9yhb07 HTTP/2.0" 200 600 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - eiHgvhpro9yhb07 [11/Oct/2016:21:28:15 +0200] "PROPFIND /public.php/webdav/ HTTP/2.0" 207 9415 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/add.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/checkbox.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/more.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/filetypes/application-pdf.svg HTTP/2.0" 304 135 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/triangle-s.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/triangle-n.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/rename.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/download.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/delete.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - gabriel [11/Oct/2016:21:28:24 +0200] "GET /ocs/v2.php/apps/notifications/api/v1/notifications?format=json HTTP/1.1" 200 687 "-" "Mozilla/5.0 (Linux) mirall/2.2.4 (Nextcloud)" "-"
123.123.123.123 - eiHgvhpro9yhb07 [11/Oct/2016:21:28:25 +0200] "DELETE /public.php/webdav/test.pdf HTTP/2.0" 500 8402 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/s/eiHgvhpro9yhb07 HTTP/2.0" 200 16814 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/core/js/oc.js?v=ac7b28b071603951b84fab89322a62c3 HTTP/2.0" 200 3536 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/apps/theming/styles?v=32 HTTP/2.0" 200 1966 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:13 +0200] "GET /index.php/apps/theming/js/theming?v=32 HTTP/2.0" 200 717 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/download.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/logo-icon.svg?v=1 HTTP/2.0" 304 135 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/toggle-pictures.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/filetypes/folder.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/places/home.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/breadcrumb.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /index.php/apps/gallery/config.public?extramediatypes=1&token=eiHgvhpro9yhb07 HTTP/2.0" 200 600 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - eiHgvhpro9yhb07 [11/Oct/2016:21:28:15 +0200] "PROPFIND /public.php/webdav/ HTTP/2.0" 207 9415 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/add.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/checkbox.svg HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/more.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/filetypes/application-pdf.svg HTTP/2.0" 304 135 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/triangle-s.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:15 +0200] "GET /core/img/actions/triangle-n.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/rename.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/download.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - - [11/Oct/2016:21:28:24 +0200] "GET /core/img/actions/delete.svg?v=1 HTTP/2.0" 304 134 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"
123.123.123.123 - gabriel [11/Oct/2016:21:28:24 +0200] "GET /ocs/v2.php/apps/notifications/api/v1/notifications?format=json HTTP/1.1" 200 687 "-" "Mozilla/5.0 (Linux) mirall/2.2.4 (Nextcloud)" "-"
123.123.123.123 - eiHgvhpro9yhb07 [11/Oct/2016:21:28:25 +0200] "DELETE /public.php/webdav/test.pdf HTTP/2.0" 500 8402 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"

#### Nextcloud log (data/nextcloud.log)

Nextcloud log

Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems. 
Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems. 
Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems. 
Exception: {"Exception":"TypeError","Message":"Argument 2 passed to OCA\\FilesAccessControl\\CacheWrapper::__construct() must be an instance of OCA\\FilesAccessControl\\StorageWrapper, instance of OC\\Files\\Storage\\Wrapper\\PermissionsMask given, called in \/var\/www\/html\/cloud\/apps\/files_accesscontrol\/lib\/StorageWrapper.php on line 404","Code":0,"Trace":"#0 \/var\/www\/html\/cloud\/apps\/files_accesscontrol\/lib\/StorageWrapper.php(404): OCA\\FilesAccessControl\\CacheWrapper->__construct(Object(OCA\\FilesAutomatedTagging\\CacheWrapper), Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), Object(OCA\\FilesAccessControl\\Operation))\n#1 \/var\/www\/html\/cloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(388): OCA\\FilesAccessControl\\StorageWrapper->getCache('files\/Documents...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))\n#2 \/var\/www\/html\/cloud\/lib\/private\/Files\/Storage\/Wrapper\/PermissionsMask.php(130): OC\\Files\\Storage\\Wrapper\\Wrapper->getCache('files\/Documents...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))\n#3 \/var\/www\/html\/cloud\/lib\/private\/Files\/View.php(1284): OC\\Files\\Storage\\Wrapper\\PermissionsMask->getCache('files\/Documents...')\n#4 \/var\/www\/html\/cloud\/lib\/private\/Files\/View.php(1338): OC\\Files\\View->getCacheEntry(Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), 'files\/Documents...', '\/Documents\/univ...')\n#5 \/var\/www\/html\/cloud\/lib\/private\/Preview.php(232): OC\\Files\\View->getFileInfo('\/files\/Document...')\n#6 \/var\/www\/html\/cloud\/lib\/private\/Preview.php(266): OC\\Preview->getFileInfo()\n#7 \/var\/www\/html\/cloud\/lib\/private\/Preview.php(131): OC\\Preview->setFile('\/Documents\/univ...')\n#8 \/var\/www\/html\/cloud\/lib\/private\/Preview.php(1345): OC\\Preview->__construct(false, 'files\/', '\/Documents\/univ...')\n#9 \/var\/www\/html\/cloud\/lib\/private\/Preview.php(1252): OC\\Preview::post_delete(Array, 'files\/')\n#10 \/var\/www\/html\/cloud\/lib\/private\/legacy\/hook.php(106): OC\\Preview::post_write(Array)\n#11 \/var\/www\/html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(291): OC_Hook::emit('OC_Filesystem', 'post_write', Array)\n#12 \/var\/www\/html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(207): OCA\\DAV\\Connector\\Sabre\\File->emitPostHooks(false)\n#13 \/var\/www\/html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(137): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #459)\n#14 \/var\/www\/html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1036): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('rotes-herz-2.jp...', Resource id #459)\n#15 \/var\/www\/html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(523): Sabre\\DAV\\Server->createFile('rotes-herz-2.jp...', Resource id #459, NULL)\n#16 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#17 \/var\/www\/html\/cloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#18 \/var\/www\/html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#19 \/var\/www\/html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#20 \/var\/www\/html\/cloud\/apps\/dav\/appinfo\/v1\/publicwebdav.php(95): Sabre\\DAV\\Server->exec()\n#21 \/var\/www\/html\/cloud\/public.php(77): require_once('\/var\/www\/html\/h...')\n#22 {main}","File":"\/var\/www\/html\/cloud\/apps\/files_accesscontrol\/lib\/CacheWrapper.php","Line":42} 
#### Browser log

Browser log

After the DELETE request I get as response an "Internal Server Error - 500"

Response from Firefox Network Log:

HTTP/2.0 500 Internal Server Error
Server: nginx
Date: Tue, 11 Oct 2016 19:38:54 GMT
Content-Type: text/html; charset=UTF-8
x-powered-by: PHP/7.0.11
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
X-Robots-Tag: none
x-download-options: noopen
x-permitted-cross-domain-policies: none
X-Firefox-Spdy: h2

@nickvergessen
Copy link
Member

I fail to reproduce. Does this happen for you all the time?

Can you try to replace line 42 in apps/files_accesscontrol/lib/CacheWrapper.php
before:

public function __construct(ICache $cache, StorageWrapper $storage, Operation $operation) {

after:

public function __construct(ICache $cache, \OCP\Files\Storage\IStorage $storage, Operation $operation) {

@MorrisJobke
Copy link
Member

MorrisJobke commented Oct 12, 2016

{
    "Code": 0,
    "Exception": "TypeError",
    "File": "apps/files_accesscontrol/lib/CacheWrapper.php",
    "Line": 42,
    "Message": "Argument 2 passed to OCA\\FilesAccessControl\\CacheWrapper::__construct() must be an instance of OCA\\FilesAccessControl\\StorageWrapper, instance of OC\\Files\\Storage\\Wrapper\\PermissionsMask given, called in apps/files_accesscontrol/lib/StorageWrapper.php on line 404",
    "Trace": "
    #0 apps/files_accesscontrol/lib/StorageWrapper.php(404): OCA\\FilesAccessControl\\CacheWrapper->__construct(Object(OCA\\FilesAutomatedTagging\\CacheWrapper), Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), Object(OCA\\FilesAccessControl\\Operation))
    #1 lib/private/Files/Storage/Wrapper/Wrapper.php(388): OCA\\FilesAccessControl\\StorageWrapper->getCache('files/Documents...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))
    #2 lib/private/Files/Storage/Wrapper/PermissionsMask.php(130): OC\\Files\\Storage\\Wrapper\\Wrapper->getCache('files/Documents...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))
    #3 lib/private/Files/View.php(1284): OC\\Files\\Storage\\Wrapper\\PermissionsMask->getCache('files/Documents...')
    #4 lib/private/Files/View.php(1338): OC\\Files\\View->getCacheEntry(Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), 'files/Documents...', '/Documents/univ...')
    #5 lib/private/Preview.php(232): OC\\Files\\View->getFileInfo('/files/Document...')
    #6 lib/private/Preview.php(266): OC\\Preview->getFileInfo()
    #7 lib/private/Preview.php(131): OC\\Preview->setFile('/Documents/univ...')
    #8 lib/private/Preview.php(1345): OC\\Preview->__construct(false, 'files/', '/Documents/univ...')
    #9 lib/private/Preview.php(1252): OC\\Preview::post_delete(Array, 'files/')
    #10 lib/private/legacy/hook.php(106): OC\\Preview::post_write(Array)
    #11 apps/dav/lib/Connector/Sabre/File.php(291): OC_Hook::emit('OC_Filesystem', 'post_write', Array)
    #12 apps/dav/lib/Connector/Sabre/File.php(207): OCA\\DAV\\Connector\\Sabre\\File->emitPostHooks(false)
    #13 apps/dav/lib/Connector/Sabre/Directory.php(137): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #459)
    #14 3rdparty/sabre/dav/lib/DAV/Server.php(1036): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('rotes-herz-2.jp...', Resource id #459)
    #15 3rdparty/sabre/dav/lib/DAV/CorePlugin.php(523): Sabre\\DAV\\Server->createFile('rotes-herz-2.jp...', Resource id #459, NULL)
    #16 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))
    #17 3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
    #18 3rdparty/sabre/dav/lib/DAV/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)
    #19 3rdparty/sabre/dav/lib/DAV/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))
    #20 apps/dav/appinfo/v1/publicwebdav.php(95): Sabre\\DAV\\Server->exec()
    #21 public.php(77): require_once('/var/www/html/h...')
    #22 {main}
    "
}

@hoellen What files access control rules do you have setup?

cc @nickvergessen

@nickvergessen nickvergessen added this to the Nextcloud 10.0.2 milestone Oct 12, 2016
@hoellen
Copy link
Contributor Author

hoellen commented Oct 12, 2016

@MorrisJobke I don't use the file access control at the moment. No rules are defined.
@nickvergessen I replaced the line you said and now it is working again. Thanks!
I still get this warning in the log, but it seems to me that I read in another issue that you are already solving this. And that this is not a big problem for me.

{"reqId":"jD6AfEPZ8EvrJV1x0EcG","remoteAddr":"123.123.123.123","app":"filesystem","message":"Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems.","level":2,"time":"2016-10-12T10:23:44+00:00","method":"DELETE","url":"\/public.php\/webdav\/test.pdf","user":"--"}

@nickvergessen
Copy link
Member

Btw if you are not using it, disable the app. It reduces the load on each request.

@hoellen
Copy link
Contributor Author

hoellen commented Oct 12, 2016

Good idea, I disabled 4 apps which I don't use. Thanks again.

@thomas955
Copy link

thomas955 commented Oct 21, 2016

Hi,

i can confirm this Problem:

  1. Share Folder with link
    settings: enforce pwd, enforce expiration, modifications enabled, files visible
  2. Create file (access via link and pwd).
  3. Try to remove created file -> Error (Notification message on top: Error deleting file )

owncloud log error:

  1. Warning filesystem Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems.
  2. Exception: {"Exception":"TypeError","Message":"Argument 2 passed to OCA\\FilesAccessControl\\CacheWrapper::__construct() must be an instance of OCA\\FilesAccessControl\\StorageWrapper, instance of OC\\Files\\Storage\\Wrapper\\PermissionsMask given, called in \/wwwpathtocloud\/nextcloud\/apps\/files_accesscontrol\/lib\/StorageWrapper.php on line 404","Code":0,"Trace":"#0 \/wwwpathtocloud\/nextcloud\/apps\/files_accesscontrol\/lib\/StorageWrapper.php(404): OCA\\FilesAccessControl\\CacheWrapper->__construct(Object(OC\\Files\\Cache\\Cache), Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), Object(OCA\\FilesAccessControl\\Operation))\n#1 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(388): OCA\\FilesAccessControl\\StorageWrapper->getCache('files\/testdelet...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))\n#2 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/PermissionsMask.php(130): OC\\Files\\Storage\\Wrapper\\Wrapper->getCache('files\/testdelet...', Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask))\n#3 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/View.php(1284): OC\\Files\\Storage\\Wrapper\\PermissionsMask->getCache('files\/testdelet...')\n#4 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/View.php(1338): OC\\Files\\View->getCacheEntry(Object(OC\\Files\\Storage\\Wrapper\\PermissionsMask), 'files\/testdelet...', 'testdelete123\/g...')\n#5 \/wwwpathtocloud\/nextcloud\/lib\/private\/Preview.php(1275): OC\\Files\\View->getFileInfo('\/files\/testdele...')\n#6 \/wwwpathtocloud\/nextcloud\/lib\/private\/Preview.php(1259): OC\\Preview::prepare_delete(Array, 'files\/')\n#7 \/wwwpathtocloud\/nextcloud\/lib\/private\/legacy\/hook.php(106): OC\\Preview::prepare_delete_files(Array)\n#8 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/View.php(1231): OC_Hook::emit('OC_Filesystem', 'delete', Array)\n#9 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/View.php(1109): OC\\Files\\View->runHooks(Array, '\/testdelete123\/...')\n#10 \/wwwpathtocloud\/nextcloud\/lib\/private\/Files\/View.php(691): OC\\Files\\View->basicOperation('unlink', '\/file.file', Array)\n#11 \/wwwpathtocloud\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(334): OC\\Files\\View->unlink('\/file.file')\n#12 \/wwwpathtocloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(179): OCA\\DAV\\Connector\\Sabre\\File->delete()\n#13 \/wwwpathtocloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(285): Sabre\\DAV\\Tree->delete('file.file')\n#14 [internal function]: Sabre\\DAV\\CorePlugin->httpDelete(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#15 \/wwwpathtocloud\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#16 \/wwwpathtocloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:DELETE', Array)\n#17 \/wwwpathtocloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#18 \/wwwpathtocloud\/nextcloud\/apps\/dav\/appinfo\/v1\/publicwebdav.php(95): Sabre\\DAV\\Server->exec()\n#19 \/wwwpathtocloud\/nextcloud\/public.php(77): require_once('\/wwwpathtocloud\/n...')\n#20 {main}","File":"\/wwwpathtocloud\/nextcloud\/apps\/files_accesscontrol\/lib\/CacheWrapper.php","Line":42}

If i change the line you proposed:

42 in apps/files_accesscontrol/lib/CacheWrapper.php

from:
public function __construct(ICache $cache, StorageWrapper $storage, Operation $operation) {
to:
public function __construct(ICache $cache, \OCP\Files\Storage\IStorage $storage, Operation $operation) {

i can remove the file via linkshare.
The warning Nr. 1 still appears but i can remove the file.

There is another problem which is fixed by this change with create folders inside a link share.
If a folder is created inside a shared link without the change i did, the link user cannot see (delete or enter) this new folder.
The solution above solves this also.

start

Server configuration

Operating system:
Ubuntu 16.04 4.4.0-42-generic

Web server:
Server version: Apache/2.4.18 (Ubuntu)

Database:
mysql Ver 14.14 Distrib 5.7.15

PHP version:
PHP 7.0.8-0ubuntu0.16.04.3

Nextcloud version: (see Nextcloud admin page)
10.0.1 (stable)
Fresh install from tar

.tar.bz2 archive from nextcloud.com website

Are you using encryption:
No.

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

Im using file access control:
if desktop client
if matches "https://old.internet.address/remote.php"

end

p.s. I think owncloud has a similar or the same problem.

Please keep us informed, if there is the final solution.
Thank you in advance,
Thomas

@nickvergessen
Copy link
Member

Please keep us informed, if there is the final solution.

That will be the final solution then

@thomas955
Copy link

Do you want to merge this?

p.s. There still is the warning:

Warning filesystem Storage wrapper 'sharePermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems.

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

4 participants