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

accessing a public link of a deleted folder via new public link webdav API results in error 500 #36055

Closed
individual-it opened this issue Aug 19, 2019 · 2 comments · Fixed by #36066 or #37625
Assignees
Labels
Milestone

Comments

@individual-it
Copy link
Member

Steps to reproduce

  1. create a public link
  2. delete the folder of that public link (not only the link the complete folder)
  3. access the public link via webdav API

Expected behaviour

404 Not Found

Actual behaviour

HTTP/1.1 500 Internal Server Error'

Logs

ownCloud log (data/owncloud.log)

{
  "reqId": "B911G6jJNL94L42B0gMX",
  "level": 4,
  "time": "2019-08-19T04:31:40+00:00",
  "remoteAddr": "127.0.0.1",
  "user": "--",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/owncloud-core/remote.php/dav/public-files/hz5nUer6Iumb2lJ",
  "message": "Exception: : {\"Exception\":\"OCP\\\\Files\\\\NotFoundException\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\/home\\/artur\\/www\\/owncloud-core\\/apps\\/dav\\/lib\\/Files\\/PublicFiles\\/PublicSharedRootNode.php(61): OC\\\\Share20\\\\Share->getNode()\\n#1 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Tree.php(204): OCA\\\\DAV\\\\Files\\\\PublicFiles\\\\PublicSharedRootNode->getChildren()\\n#2 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(895): Sabre\\\\DAV\\\\Tree->getChildren('public-files\\/hz...')\\n#3 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(977): Sabre\\\\DAV\\\\Server->generatePathNodes(Object(Sabre\\\\DAV\\\\PropFind), Array)\\n#4 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(1649): Sabre\\\\DAV\\\\Server->getPropertiesIteratorForPath('public-files\\/hz...', Array, 1)\\n#5 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/CorePlugin.php(363): Sabre\\\\DAV\\\\Server->generateMultiStatus(Object(Generator), false)\\n#6 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/event\\/lib\\/WildcardEmitterTrait.php(96): Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#7 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(464): Sabre\\\\DAV\\\\Server->emit('method:PROPFIND', Array)\\n#8 \\/home\\/artur\\/www\\/owncloud-core\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(241): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#9 \\/home\\/artur\\/www\\/owncloud-core\\/apps\\/dav\\/lib\\/Server.php(319): Sabre\\\\DAV\\\\Server->start()\\n#10 \\/home\\/artur\\/www\\/owncloud-core\\/apps\\/dav\\/appinfo\\/v2\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#11 \\/home\\/artur\\/www\\/owncloud-core\\/remote.php(165): require_once('\\/home\\/artur\\/www...')\\n#12 {main}\",\"File\":\"\\/home\\/artur\\/www\\/owncloud-core\\/lib\\/private\\/Share20\\/Share.php\",\"Line\":173}"
}

CC @DeepDiver1975

@PVince81
Copy link
Contributor

as far as I can see the new public link webdav test is still commented out: https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink2/uploadToPublicLinkShare.feature#L45

I happened to have uncommented those by mistake in #37552 and am getting this result:

upload should have failed but passed with code 500
        Failed asserting that an array contains 500. 

@individual-it can you double check ? reopening

@individual-it
Copy link
Member Author

individual-it commented Jun 25, 2020

That is true, tests for downloading a file do pass, but not for uploading.
Log output:

{"reqId":"axlpTL50IJ8ryXwQHG95","level":4,"time":"2020-06-25T06:21:07+00:00","remoteAddr":"127.0.0.1","user":"--","app":"webdav","method":"PUT","url":"\/owncloud-core\/remote.php\/dav\/public-files\/fHbdbnwv9DvGsoC\/whateverfilefortesting.txt","message":"Exception: : {\"Exception\":\"OCP\\\\Files\\\\NotFoundException\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Files\\\/PublicFiles\\\/PublicFilesPlugin.php(196): OC\\\\Share20\\\\Share->getNode()\\n#1 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): OCA\\\\DAV\\\\Files\\\\PublicFiles\\\\PublicFilesPlugin->handleBeforeCreateFile()\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1087): Sabre\\\\DAV\\\\Server->emit()\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(504): Sabre\\\\DAV\\\\Server->createFile()\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpPut()\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(470): Sabre\\\\DAV\\\\Server->emit()\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(251): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(329): Sabre\\\\DAV\\\\Server->start()\\n#8 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#9 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(165): require_once('\\\/home\\\/artur\\\/www...')\\n#10 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/private\\\/Share20\\\/Share.php\",\"Line\":173}"}
{"reqId":"XY6IxjXf8KUfo5mvwNls","level":0,"time":"2020-06-25T06:21:07+00:00","remoteAddr":"127.0.0.1","user":"--","app":"OC\\Authentication\\Token\\DefaultTokenProvider::invalidateToken","method":"DELETE","url":"\/owncloud-core\/ocs\/v2.php\/apps\/testing\/api\/v1\/lockprovisioning","message":"invalidating token 5c56fc0775639629013b00a5fd840e5901a5b0d2019b23a5a051f079bc1f4b56e72c3b4a1f76db0703f28166ad75945a573a023d96e27dd928d0986fc712d16d"}

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