Skip to content

Delete: call_user_func_array() expects parameter 1 to be a valid callback #29167

Closed

Description

@mmattel

Steps to reproduce

  1. having a federated share, 10.0.2 - 10.0.3
  2. deleting a folder from the local W10 client connected via oC client to 10.0.3
  3. monitor 10.0.3 oC log activities

Expected behaviour

No errors should be logged

Actual behaviour

"user":"xyz","app":"PHP","method":"DELETE","url":"\/remote.php\/dav\/files\/xyz\/abc,"message":"call_user_func_array() expects parameter 1 to be a valid callback, class 'OCA\\Files_Sharing\\External\\Storage' does not have a method 'getFullPath' at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php#501"

Server configuration

Operating system: Ubuntu 16.04

Web server: nginx

Database: mysql

PHP version: 7.0

ownCloud version: 10.0.3

Updated from an older ownCloud or fresh install: updated

Where did you install ownCloud from: tar

Signing status (ownCloud 9.0 and above): no errors

The content of config/config.php:
config_report_20171008.txt

List of activated apps:

Enabled:
  - activity: 2.3.6
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.3.0
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_external_dropbox: 1.0.0
  - files_external_ftp: 0.2.0
  - files_pdfviewer: 0.8.2
  - files_sharing: 0.10.1
  - files_texteditor: 2.2.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 16.0.2
  - market: 0.2.2
  - music: 0.5.2
  - notifications: 0.3.1
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.1
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - files_antivirus
  - theme-example
  - user_external

Are you using external storage, if yes which one: smb, federation

Are you using encryption: no

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

Client configuration

Browser: Opera

Operating system: W10x64

ownCloud log (data/owncloud.log)

see on top

Activity

  1. PVince81 commented on Oct 10, 2017

    @PVince81
    Contributor

    Weird, I grepped the code for "getFullPath" and that method only exists as protected method in the encryption storage wrapper.

    I found this, likely related: https://github.com/owncloud/core/blob/v10.0.3/lib/private/Files/Storage/Wrapper/Encryption.php#L786. This is a recent addition.

    @sharidas please have a look.

    Not sure about a proper solution... I suggest avoiding getFullPath.

    Making getFullPath public would be an idea, but not so clean a solution.

  2. PVince81 commented on Oct 10, 2017

    @PVince81
    Contributor

    @mmattel did the deletion still go through or did it abort ?

  3. added this to the development milestone on Oct 10, 2017
  4. added
    p1-urgent
    on Oct 10, 2017
  5. PVince81 commented on Oct 10, 2017

    @PVince81
    Contributor

    setting to p1 as this could be critical, needs confirmation

  6. mmattel commented on Oct 10, 2017

    @mmattel
    ContributorAuthor

    From that what I see is, that you delete a file on the W10 machine, it gets deleted on both sides of the federation too. But I have currently no clue if there are other sideffects...
    Till now I hope and pray 😄

  7. sharidas commented on Oct 10, 2017

    @sharidas
    Contributor

    When I try to delete a folder shared using federated share, no logs are found in the log file. Unfortunately I am not able to reproduce the issue. I am using a Linux machine for testing.

  8. PVince81 commented on Oct 10, 2017

    @PVince81
    Contributor

    @mmattel is the federated share from an external storage ?

  9. mmattel commented on Oct 10, 2017

    @mmattel
    ContributorAuthor

    @PVince81
    W10 -- 10.0.3 -- 10.0.2 -- Storage backend from that what I know is local
    Will check it and respond

    @sharidas
    Do you delete via browser or client?
    I delete via client

  10. sharidas commented on Oct 10, 2017

    @sharidas
    Contributor

    Tried federated share, with external storage SFTP, the delete operation isn't hitting call_user_func_array.

  11. sharidas commented on Oct 10, 2017

    @sharidas
    Contributor

    Do you delete via browser or client?
    I delete via client

    I delete via browser.

  12. mmattel commented on Oct 10, 2017

    @mmattel
    ContributorAuthor

    Just tried it again:
    (create file = local in the filesystem W10 machine which syncs via the client)

    W10 -- 10.0.3 -- local storage
    Create file, wait for sync file, delete file after successful sync, monitor log - no entry

    W10 -- 10.0.3 -- 10.0.2
    Create file, wait for sync file, delete file after successful sync, monitor log - entry

  13. PVince81 commented on Oct 10, 2017

    @PVince81
    Contributor

    Had a chat with @sharidas with some more clues:

    So it seems that in @mmattel's setup, the received federated share doesn't have any encryption wrapper applied, which is correct. This is likely the reason why the error happens: it is trying to call a method that only exists on this wrapper, it iterates over all wrappers until it reaches the actually wrapper storage OCA\\Files_Sharing\\External\\Storage (this is the DAV federated share storage implementation) and does not find the method getFullPath.

    Now the question is why @sharidas is not able to reproduce locally. He's going to debug further to find what conditions are making the code skips the getFullPath part in his local env. Hopefully once we find the one condition we'll be able to reproduce it.

  14. mmattel commented on Oct 10, 2017

    @mmattel
    ContributorAuthor

    Just tried to delete via browser, same error gets logged

  15. sharidas commented on Oct 11, 2017

    @sharidas
    Contributor

    This looks a bit tricky to me below is another observation to share:

    1. a) Local storage is not encrypted && External storage ( which is another oC installation ) is encrypted
      Create a folder in extrenal oC storage and try to federated share with the local storage's non admin user.
      Now debugger will never fall on line https://github.com/owncloud/core/blob/v10.0.3/lib/private/Files/Storage/Wrapper/Encryption.php#L786 . The reason is we created an empty directory ( see the if condition : https://github.com/owncloud/core/blob/v10.0.3/lib/private/Files/Storage/Wrapper/Encryption.php#L772 )

      b) Now create a folder and file inside it. Lets say test/foo.txt in External oC storage. And do a federated share. Now the result was bit weird:

      
      {"reqId":"HjBb09jpMJHQ095gbvq2","level":3,"time":"2017-10-11T05:51:51+00:00","remoteAddr":"127.0.0.1","user":"user1","app":"no app in context","method":"DELETE","url":"\/testing\/remote.php\/webdav\/test","message":"Exception: {\"Exception\":\"Sabre\\\\HTTP\\\\ClientHttpException\",\"Message\":\"Internal Server Error\",\"Code\":500,\"Trace\":\"#0 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Client.php(231): Sabre\\\\HTTP\\\\Client->send(Object(Sabre\\\\HTTP\\\\Request))\\n#1 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/DAV.php(265): Sabre\\\\DAV\\\\Client->propFind('http:\\\/\\\/localhos...', Array)\\n#2 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/External\\\/Storage.php(283): OC\\\\Files\\\\Storage\\\\DAV->propfind('foo.txt')\\n#3 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Common.php(622): OCA\\\\Files_Sharing\\\\External\\\\Storage->getPermissions('foo.txt')\\n#4 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Common->getMetaData('foo.txt')\\n#5 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(459): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('foo.txt')\\n#6 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Checksum.php(190): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->getMetaData('foo.txt')\\n#7 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Checksum->getMetaData('foo.txt')\\n#8 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(113): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('foo.txt')\\n#9 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(150): OC\\\\Files\\\\Cache\\\\Scanner->getData('foo.txt')\\n#10 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(412): OC\\\\Files\\\\Cache\\\\Scanner->scanFile('foo.txt', 3, '32', NULL, true)\\n#11 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(380): OC\\\\Files\\\\Cache\\\\Scanner->handleChildren('', false, 3, '32', true, 0)\\n#12 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(314): OC\\\\Files\\\\Cache\\\\Scanner->scanChildren('', false, 3, '32', true)\\n#13 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1303): OC\\\\Files\\\\Cache\\\\Scanner->scan('', false)\\n#14 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1344): OC\\\\Files\\\\View->getCacheEntry(Object(OCA\\\\Files_Trashbin\\\\Storage), '', 'test')\\n#15 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(185): OC\\\\Files\\\\View->getFileInfo('\\\/user1\\\/files\\\/te...')\\n#16 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(178): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('test')\\n#17 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('test')\\n#18 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#19 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#20 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#21 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#22 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(63): Sabre\\\\DAV\\\\Server->exec()\\n#23 \\\/home\\\/sujith\\\/test\\\/owncloud\\\/remote.php(175): require_once('\\\/home\\\/sujith\\\/te...')\\n#24 {main}\",\"File\":\"\\\/home\\\/sujith\\\/test\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/http\\\/lib\\\/Client.php\",\"Line\":160}"}
      
      {"reqId":"HjBb09jpMJHQ095gbvq2","level":3,"time":"2017-10-11T05:51:51+00:00","remoteAddr":"127.0.0.1","user":"user1","app":"files_external","method":"DELETE","url":"\/testing\/remote.php\/webdav\/test","message":"Internal Server Error"}
      
      

     Since its a federated share, I found while debugging that the issue is hit when the code reaches https://github.com/owncloud/core/blob/v10.0.3/lib/private/Encryption/EncryptionWrapper.php#L121 and then nothing happens for a while. And later user can see the traces above.
    
     The next time when I delete... No traces and the delete happens successfully.
    
  16. sharidas commented on Oct 24, 2017

    @sharidas
    Contributor

    Another observation matrics ( this was purely experimental ) nothing significant found and couldn't reproduce the error:
    Owncloud2 (version 10.0.3 beta) and Owncloud3 (version 10.0.2)

    1. Owncloud2 is non-encrypted local storage. Owncloud3 is also non-encrypted storage.
    • Now try to add Owncloud3 as external storage to Owncloud2.
    • Create a file in Owncloud2 and delete. No log entry found
    • Create a file in Owncloud3 and delete. No log entry found
    1. Owncloud2 is non-encrypted local storage. Owncloud3 is encrypted with user specific key
      • Now try to add Owncloud3 as external storage to Owncloud2.
      • Create a file in Owncloud3 from Owncloud2. This will cause problem while file creation. Exception thrown and file creation fails.
    2. Owncloud2 is encrypted and Owncloud3 is not encrypted
      • Now try to add Owncloud3 as external storage to Owncloud2.
      • Create a file in Owncloud3 from Owncloud2 causes problem. Exception thrown and the file creation fails.

    Now back to fed shares.

  17. sharidas commented on Oct 24, 2017

    @sharidas
    Contributor

    Finally I got this piece of information in the log
    {"reqId":"Kk9ZKdERbIqr25W2wcWs","level":3,"time":"2017-10-24T10:16:13+00:00","remoteAddr":"127.0.0.1","user":"user1","app":"PHP","method":"DELETE","url":"\/testing\/remote.php\/webdav\/test\/abc.txt","message":"call_user_func_array() expects parameter 1 to be a valid callback, class 'OCA\\Files_Sharing\\External\\Storage' does not have a method 'getFullPath' at \/home\/sujith\/test\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php#501"}

  18. sharidas commented on Oct 24, 2017

    @sharidas
    Contributor

    Created PR: #29337

  19. lock commented on Aug 1, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  20. locked as resolved and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type:Bugp1-urgentregressionsev2-highstatus/STALE

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions