OC 8 Alpha 1: Files for User are not shown (unbekannter Fehler)
Steps to reproduce
- LogIn and go to files App
- Just one user is affected, see the Logs
Expected behaviour
Show users Files
Actual behaviour
Users Files are not shown, "Unbekannter Fehler" is thrown in the UI. This only happens for one user, all the others are not affected. Please look at the log below (unauthenticated user...)
Server configuration
Operating system: Ubuntu 14.04 Web server: apache2 Database: mySQL PHP version: PHP 5.5.9-1ubuntu4.5 ownCloud version: Owncloud 8 Alpha 1 Updated from an older ownCloud or fresh install: update from master from 22.12. Are you using external storage: yes, local file system Are you using encryption: no
Logs
{"reqId":"80ed4c39a6f230382edb0a527a4b855b","remoteAddr":"2a02:2450:102d:1fd:9ef3:87ff:feb2:3d02","app":"files_external","message":"Not authenticated","level":3,"time":"January 03, 2015 12:57:14"}
{"reqId":"80ed4c39a6f230382edb0a527a4b855b","remoteAddr":"2a02:2450:102d:1fd:9ef3:87ff:feb2:3d02","app":"files_external","message":"Not authenticated","level":3,"time":"January 03, 2015 12:57:14"}
{"reqId":"80ed4c39a6f230382edb0a527a4b855b","remoteAddr":"2a02:2450:102d:1fd:9ef3:87ff:feb2:3d02","app":"files_external","message":"Not authenticated","level":3,"time":"January 03, 2015 12:57:14"}
{"reqId":"80ed4c39a6f230382edb0a527a4b855b","remoteAddr":"2a02:2450:102d:1fd:9ef3:87ff:feb2:3d02","app":"files","message":"Exception: {\"Message\":\"Not authenticated\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Client.php(179): Sabre\\\\DAV\\\\Client->request('PROPFIND', '', '<?xml version=\\\"...', Array)\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/dav.php(463): Sabre\\\\DAV\\\\Client->propFind('', Array)\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/scanner.php(98): OC\\\\Files\\\\Storage\\\\DAV->getPermissions('')\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/scanner.php(115): OC\\\\Files\\\\Cache\\\\Scanner->getData('')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1027): OC\\\\Files\\\\Cache\\\\Scanner->scanFile('')\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(795): OC\\\\Files\\\\View->getDirectoryContent('\\\/', '')\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/lib\\\/helper.php(176): OC\\\\Files\\\\Filesystem::getDirectoryContent('\\\/')\\n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/ajax\\\/list.php(28): OCA\\\\Files\\\\Helper::getFiles('\\\/', 'name', false)\\n#8 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(135) : runtime-created function(1): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 [internal function]: __lambda_func(Array)\\n#10 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(250): call_user_func('?lambda_267', Array)\\n#11 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(748): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/aja...')\\n#12 \\\/var\\\/www\\\/owncloud\\\/index.php(28): OC::handleRequest()\\n#13 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Client.php\",\"Line\":422}","level":4,"time":"January 03, 2015 12:57:15"}
Edit: i think i had an owncloud share to a OC 7.0.4 folder active before updating from 18.12. master to 8alpha1...
@icewind1991 can you please have a look at this as well? THX
To clarify, the logs tells that it's a server to server share (a remote share), which is what @derkostka meant with "ownCloud share".
Maybe the saved credentials for the remote share aren't valid any more or corrupt ?
@derkostka did that remote share have a password set ?
as far as i can remember, i only had an outgoing share to another oc7 instance. this share is done by link and password protected. anyway, even if th share is nonexistent, i shall be able to see the users files, right ? What can i investigate to bring this one to an end ?
If the share is non-existant, the remote folder should actually disappear from your file list. Or when you navigate inside it should say something like "Storage is not available any more".
So this is weird, if i scan files via occ, everything is found. The owncloud data folder ie also okay which makes me wonder were the problem may be ...
Can you post the content of oc_share_external to find out what server to server shares are mounted ?
Sure:

remote is an OC instance at www.cloudstaerke.de running 7.0.4
an then, a file is shared by another (local) user (also me, in fact):

Are these two shares still accessible ?
Does it still happen with 8.0.0beta1 ?
Nice... I managed to reproduce this on master (with this applied: https://github.com/owncloud/core/pull/13506)
What I did:
- As "user1": create a folder "folder"
- Share "folder" with link, set a password
- Log out
- As "user2" on the same instance, open the link
- Add to ownCloud (the same instance)
- Getting "unknown error"
Note that I also enabled the external storage app.
It seems that there are two issues:
- password auth somehow doesn't work, possibly related to @LukasReschke's recent findings
- even with that issue, the files app should still continue to work
This is what I get when mounting the folder:
{"reqId":"0a75dbcbf1557247ced4272b6b14aff1","remoteAddr":"127.0.0.1","app":"no app in context","message":"Accessing the server container is deprecated. Use type annotations to inject core services instead!","level":0,"time":"2015-01-20T17:08:33+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_sharing\/external"}
{"reqId":"15b662b406ae36d2b8618953d494a469","remoteAddr":"127.0.0.1","app":"no app in context","message":"Accessing the server container is deprecated. Use type annotations to inject core services instead!","level":0,"time":"2015-01-20T17:08:34+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_sharing\/shareinfo?t=wNN0001MDhGfTpx"}
{"reqId":"15b662b406ae36d2b8618953d494a469","remoteAddr":"127.0.0.1","app":"core-preview","message":"Passed token parameter is not valid","level":0,"time":"2015-01-20T17:08:34+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_sharing\/shareinfo?t=wNN0001MDhGfTpx"}
{"reqId":"0a75dbcbf1557247ced4272b6b14aff1","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 [internal function]: OCA\\\\Files_Sharing\\\\External\\\\Storage->getShareInfo()\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(466): call_user_func_array(Array, Array)\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/external\\\/scanner.php(22): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->__call('getShareInfo', Array)\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/external\\\/scanner.php(22): OCA\\\\Files_Trashbin\\\\Storage->getShareInfo()\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/ajax\\\/external.php(55): OCA\\\\Files_Sharing\\\\External\\\\Scanner->scanAll()\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(135) : runtime-created function(1): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#6 [internal function]: __lambda_func(Array)\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(250): call_user_func('\\\\x00lambda_2406', Array)\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(763): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_sha...')\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(28): OC::handleRequest()\\n#10 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/external\\\/storage.php\",\"Line\":228}","level":4,"time":"2015-01-20T17:08:34+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_sharing\/external"}
{"reqId":"e083461d1ab5640c59e0353dc488bb79","remoteAddr":"127.0.0.1","app":"no app in context","message":"Accessing the server container is deprecated. Use type annotations to inject core services instead!","level":0,"time":"2015-01-20T17:08:56+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files"}
{"reqId":"374fd0d78d4044cf301a3a1ade71ed7c","remoteAddr":"127.0.0.1","app":"no app in context","message":"Accessing the server container is deprecated. Use type annotations to inject core services instead!","level":0,"time":"2015-01-20T17:08:57+00:00","method":"GET","url":"\/owncloud\/index.php\/avatar\/user2\/128?requesttoken=5\/36Mzvn6bAkROq9GlWOd0XonsKvXJ"}
{"reqId":"23f2174df056d68558a64c7d38c7c3aa","remoteAddr":"127.0.0.1","app":"no app in context","message":"Accessing the server container is deprecated. Use type annotations to inject core services instead!","level":0,"time":"2015-01-20T17:08:57+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files_sharing\/api\/externalShares"}
And after that refreshing the files list I get "Unknown error" with these:
{"reqId":"cffa5e010df1c6744f8879c5f06145cb","remoteAddr":"127.0.0.1","app":"webdav","message":"Exception: {\"Message\":\"No basic authentication headers were found\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Auth\\\/Plugin.php(108): Sabre\\\\DAV\\\\Auth\\\\Backend\\\\AbstractBasic->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')\\n#1 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod('PROPFIND', '')\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(433): call_user_func_array(Array, Array)\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(455): Sabre\\\\DAV\\\\Server->broadcastEvent('beforeMethod', Array)\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PROPFIND', '')\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_sharing\\\/publicwebdav.php(73): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/public.php(48): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#7 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Auth\\\/Backend\\\/AbstractBasic.php\",\"Line\":73}","level":0,"time":"2015-01-20T17:08:57+00:00","method":"PROPFIND","url":"\/owncloud\/public.php\/webdav\/"}
I'll check why the files app doesn't render. The token one will need to be investigated spearately.
@PVince81 nice finding !
- the shares are not accessible, i removed them
- the problem still occurs on 8b1
- anyway, if the remote share is not existent, the files app shall render in any case and inform the user about that, i guess this is the expected behaviour
but: this matches somehow with my log´s "Not authenticated" See: {"reqId":"7ea51b7624e0d35d8dcfd682f6157568","remoteAddr":"2a02:2450:102d:1fd:219:e3ff:fe04:2514","app":"files_external","message":"Not authenticated","level":3,"time":"January 20, 2015 18:52:05"} {"reqId":"7ea51b7624e0d35d8dcfd682f6157568","remoteAddr":"2a02:2450:102d:1fd:219:e3ff:fe04:2514","app":"files_external","message":"Not authenticated","level":3,"time":"January 20, 2015 18:52:05"} {"reqId":"7ea51b7624e0d35d8dcfd682f6157568","remoteAddr":"2a02:2450:102d:1fd:219:e3ff:fe04:2514","app":"files_external","message":"Not authenticated","level":3,"time":"January 20, 2015 18:52:06"} {"reqId":"7ea51b7624e0d35d8dcfd682f6157568","remoteAddr":"2a02:2450:102d:1fd:219:e3ff:fe04:2514","app":"files_external","message":"Not authenticated","level":3,"time":"January 20, 2015 18:52:06"} {"reqId":"7ea51b7624e0d35d8dcfd682f6157568","remoteAddr":"2a02:2450:102d:1fd:219:e3ff:fe04:2514","app":"files","message":"Exception: {"Message":"Not authenticated","Code":0,"Trace":"#0 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Client.php(179): Sabre\DAV\Client->request('PROPFIND', '', '<?xml version=\"...', Array)\n#1 \/var\/www\/owncloud\/lib\/private\/files\/storage\/dav.php(463): Sabre\DAV\Client->propFind('', Array)\n#2 \/var\/www\/owncloud\/lib\/private\/files\/cache\/scanner.php(98): OC\Files\Storage\DAV->getPermissions('')\n#3 \/var\/www\/owncloud\/lib\/private\/files\/cache\/scanner.php(115): OC\Files\Cache\Scanner->getData('')\n#4 \/var\/www\/owncloud\/lib\/private\/files\/view.php(1040): OC\Files\Cache\Scanner->scanFile('')\n#5 \/var\/www\/owncloud\/lib\/private\/files\/filesystem.php(806): OC\Files\View->getDirectoryContent('\/', '')\n#6 \/var\/www\/owncloud\/apps\/files\/lib\/helper.php(176): OC\Files\Filesystem::getDirectoryContent('\/')\n#7 \/var\/www\/owncloud\/apps\/files\/ajax\/list.php(28): OCA\Files\Helper::getFiles('\/', 'name', false)\n#8 \/var\/www\/owncloud\/lib\/private\/route\/route.php(135) : runtime-created function(1): require_once('\/var\/www\/ownclo...')\n#9 [internal function]: __lambda_func(Array)\n#10 \/var\/www\/owncloud\/lib\/private\/route\/router.php(250): call_user_func('?lambda_61531', Array)\n#11 \/var\/www\/owncloud\/lib\/base.php(763): OC\Route\Router->match('\/apps\/files\/aja...')\n#12 \/var\/www\/owncloud\/index.php(28): OC::handleRequest()\n#13 {main}","File":"\/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Client.php","Line":422}","level":4,"time":"January 20, 2015 18:52:07"}
I'm still not sure why the password doesn't work, probably another issue.
It seems it's trying to do the initial scan of the share but fails due to that auth issue. And that error isn't caught in this code path, only in another one...
Yeah, if i disable the file sharing app, the issue is gone, too.
I went into the code, we should somehow catch the error within the if statement, i think (i don´t know about available operations on storage). If i leave at line 88 with a return null, file show up in the UI (as a dirty test)
https://github.com/owncloud/core/blob/master/lib/private/files/cache/scanner.php
.. please: how do i debug a php application ? can i somehow put this into eclipse and set breakpoints or something ? i want to help :8ball: ..edit: found this: http://doc.owncloud.org/server/6.0/developer_manual/app/general/debugging.html ..
question2: how do i find out, which operations "storage" provides ? Thanks !
@derkostka you need the XDebug extension.
Thanks for your info and interest in debugging.
Note that I'm already debugging this and have a fix that I'll submit soon. The problem is that storage exceptions aren't caught by the scanner.
I pushed a fix here: https://github.com/owncloud/core/pull/13525 but it will need another fix as well.
It should make the scanner fail gracefully if the remote share is broken/unavailable/invalid.
Now the second part to look into: why is a remote share with password invalid in the first place ?!
Raised invalid token issue as https://github.com/owncloud/core/issues/13526