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

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache #1166

Closed
alphamat opened this issue Aug 29, 2016 · 43 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@alphamat
Copy link

alphamat commented Aug 29, 2016

Operating system: Debian 8
Web server: Apache 2.4
Database: mysql 5.5.49-0+deb8u1
PHP version: 7.02
Nextcloud version: 10 / 9.1.0.16 - was also in 9.0.53

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/htdocs/lib/private/Files/Filesystem.php:773 Stack trace: #0 /var/www/htdocs/lib/private/Files/View.php(2034): OC\Files\Filesystem::normalizePath('/MaT/files/Musi...') #1 /var/www/htdocs/lib/private/Files/View.php(1152): OC\Files\View->unlockFile('/Music - World/...', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /var/www/htdocs/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/htdocs/lib/private/Files/Filesystem.php#773

This happens with the audioplayer app from Rello -> https://github.com/Rello/audioplayer

He told me it is an core related issue and not with the app - he cannot resolve it

I found the issue now also when i click normal songs in folders switch from one to the other by short click

@alphamat
Copy link
Author

in OC is the same issue - owncloud/core#22370
i think they find a way to reproduce it/find more info about

i hope this can help NC too to resolve this issue

@blizzz
Copy link
Member

blizzz commented Sep 1, 2016

cc @icewind1991

@blizzz blizzz added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 1, 2016
@milgner
Copy link

milgner commented Sep 1, 2016

Encountering the same issue without any additional apps, only the files app and the Windows client. The file is shared by [user] to [another user].

Sep 01 17:51:39 Nextcloud[54349]: {PHP} fopen(/var/storage/nextcloud/[user]/files/[path]): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/files/storage/local.php#261
Sep 01 17:51:39 Nextcloud[54349]: {webdav} Exception: {"Message":"HTTP\/1.1 503 Could not open file","Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Code":0,"Trace":"#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(83): OCA\\DAV\\Connector\\Sabre\\File->get()\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpGet(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/nextcloud\/remote.php(138): require_once('\/var\/www\/nextcl...')\n#7 {main}","File":"\/var\/www\/nextcloud\/apps\/dav\/lib\/connector\/sabre\/file.php","Line":306,"User":"[another_user]"}
Sep 01 17:51:39 Nextcloud[50767]: {PHP} fopen(/var/storage/nextcloud/[user]/files/[path]): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/files/storage/local.php#261
Sep 01 17:51:39 Nextcloud[50767]: {webdav} Exception: {"Message":"HTTP\/1.1 503 Could not open file","Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Code":0,"Trace":"#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(83): OCA\\DAV\\Connector\\Sabre\\File->get()\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpGet(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/nextcloud\/remote.php(138): require_once('\/var\/www\/nextcl...')\n#7 {main}","File":"\/var\/www\/nextcloud\/apps\/dav\/lib\/connector\/sabre\/file.php","Line":306,"User":"[another_user]"}
Sep 01 17:51:47 php-fpm7.0[52286]: ool www[52286]: {PHP} Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/files/filesystem.php:798

It seems a bit strange that there seem to be so many PIDs reporting the problem with the first message being repeated.

@milgner
Copy link

milgner commented Sep 6, 2016

More details on this issue: it looks like the server is trying to access a file that is supposed to be in the data folder of the share owner but somehow (in the filesystem) wound up in the data folders of one of the users the folder is shared with. Then, when trying to read the file from the filesystem it crashes with the above error. The database looks correct but the files in the data folder are all in different directories from where they are supposed to be.

Is there any way to easily find out which files are affected and move them back to the share owners data directory? Any information I could provide to help debugging this?

@milgner
Copy link

milgner commented Sep 6, 2016

Here is what I think happened (as relevant for the server): due to user problem or a client bug, some shared folders were deleted. Afterwards we restored the folders using the trashbin view. Apparently the files were not restored into the data directory of the share owner but into the data directory of the share recipient.

Not sure if that makes sense to you, but, as I mentioned, feel free to ask me for further information if it can help you to debug it.

@MorrisJobke
Copy link
Member

I also found this in our logs:

Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in lib/private/Files/Filesystem.php:773
Stack trace:
#0 lib/private/Files/View.php(2034): OC\\Files\\Filesystem::normalizePath('/icewind/files/...')
#1 lib/private/Files/View.php(1152): OC\\Files\\View->unlockFile('/Photos/San Fra...', 1)
#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()
#3 3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))
#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()
#5 {main}
thrown at lib/private/Files/Filesystem.php#773

This was a PROPFIND against remote.php/webdav by @rullzer

@MorrisJobke
Copy link
Member

It also only happened once in the past 30 days. Looks like a race condition 😢

@icewind1991
Copy link
Member

Afaik this is a race condition in php's garbage collection on scrim exit, if we have a CallbackWrapper stream that is garbage collected after Filesystem::$normalizedPathCache has been gc'd

The solution to this is making sure we close streams before exiting the script, this used to be fairly consistent with webdav but was fixed by closing the output stream in sabre/dav

@MorrisJobke
Copy link
Member

@icewind1991 Please check out the issue at owncloud. There are some reproduction steps.

@MorrisJobke
Copy link
Member

Ping @icewind1991

@burningjoe
Copy link

I encountered the same problem while copying files to nextcloud via the builtin webdav-client in Mac OS Sierra. It was a batch of 300 pictures and it slowed down the process tremendously. Seems like it happened on almost every file.

Maybe you can find anything useful in there.

This is from nextcloud.log
Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in \/var\/www\/nextcloud\/lib\/private\/Files\/Filesystem.php:773\nStack trace:\n#0 \/var\/www\/nextcloud\/lib\/private\/Files\/View.php(2034): OC\\Files\\Filesystem::normalizePath('\/jonathan\/files...')\n#1 \/var\/www\/nextcloud\/lib\/private\/Files\/View.php(1152): OC\\Files\\View->unlockFile('\/Photos\/Fotos2b...', 1)\n#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()\n#3 \/var\/www\/nextcloud\/3rdparty\/icewind\/streams\/src\/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#5 {main}\n thrown at \/var\/www\/nextcloud\/lib\/private\/Files\/Filesystem.php#773","level":3,"time":"2016-11-08T14:40:29+00:00","method":"PUT","url":"\/remote.php\/webdav\/Photos\/Fotos2b\/02%20Wandertag\/Besuch%20bei%20Josef%20(21).JPG","user":"jonathan"}

And from Apache:
[Tue Nov 08 16:04:39.766925 2016] [:error] [pid 1611] [client 192.168.1.2:50756] PHP Fatal error: Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:773\nStack trace:\n#0 /var/www/nextcloud/lib/private/Files/View.php(2034): OC\\Files\\Filesystem::normalizePath('/jonathan/files...')\n#1 /var/www/nextcloud/lib/private/Files/View.php(1152): OC\\Files\\View->unlockFile('/Photos/Fotos2b...', 1)\n#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()\n#3 /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#5 {main}\n thrown in /var/www/nextcloud/lib/private/Files/Filesystem.php on line 773

@Clevero
Copy link

Clevero commented Nov 30, 2016

I have the same problem here.

Files cannot be downloaded via IE 9. Firefox and Chrome are working as expected (on desktop)

Nextcloud version: 10.0.1
Two instances have the same behavior

  1. git stable10
  2. installed via zip from nextcloud.com

PHP version: PHP 7 (7.0.12-1)

Apache error log:
[Wed Nov 30 10:51:36.451557 2016] [:error] [pid 18721] [client 127.0.0.1:50089] PHP Fatal error: Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in /opt/nextcloud-share/public/lib/private/Files/Filesystem.php:776\nStack trace:\n#0 /opt/nextcloud-share/public/lib/private/Files/View.php(2034): OC\\Files\\Filesystem::normalizePath('/marcel/files/t...')\n#1 /opt/nextcloud-share/public/lib/private/Files/View.php(1152): OC\\Files\\View->unlockFile('/test-share2/Ne...', 1)\n#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()\n#3 /opt/nextcloud-share/public/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#5 {main}\n thrown in /opt/nextcloud-share/public/lib/private/Files/Filesystem.php on line 776

nextcloud.log
{"reqId":"\/CVc\/qCRcgykbjeE8J8k","remoteAddr":"127.0.0.1","app":"PHP","message":"Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in \/opt\/nextcloud-share\/public\/lib\/private\/Files\/Filesystem.php:776\nStack trace:\n#0 \/opt\/nextcloud-share\/public\/lib\/private\/Files\/View.php(2034): OC\\Files\\Filesystem::normalizePath('\/marcel\/files\/t...')\n#1 \/opt\/nextcloud-share\/public\/lib\/private\/Files\/View.php(1152): OC\\Files\\View->unlockFile('\/test-share2\/Ne...', 1)\n#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()\n#3 \/opt\/nextcloud-share\/public\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#5 {main}\n thrown at \/opt\/nextcloud-share\/public\/lib\/private\/Files\/Filesystem.php#776","level":3,"time":"2016-11-30T10:36:00+00:00","method":"PROPFIND","url":"\/remote.php\/webdav\/","user":"marcel","version":"9.1.1.5"}

Both given logs are from the instance installed via git

Would be very happy if somebody can fix this. I have several users which are restricted to use IE9

@NiTRoeSE
Copy link

NiTRoeSE commented Dec 19, 2016

Hi, i noticed that i have the same messages in Logfile with Nextcloud 11:

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath('/thorsten.hense...') #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile('/Snowboard.mkv', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806 2016-12-19T06:18:57+0100

Operating system: CentOS 7
Web server: Apache 2.4.6
Database: Ver 15.1 Distrib 5.5.52-MariaDB
PHP version: PHP 7.0.14
Nextcloud version: 11

The File in the error message is shared by me with other users and the error message came up in NC 11 log file when these users access NC11 with the Nextcloud-Sync Clients.

@blizzz blizzz added this to the Nextcloud 11.0.1 milestone Dec 19, 2016
@geiseri
Copy link

geiseri commented Dec 20, 2016

I saw this same problem when copying a large number of files via gvfs with webdavs. About 1k of the files transferred correctly, but once it his this error about 5 times the connection locked until i killed the gvfs process.

@enoch85
Copy link
Member

enoch85 commented Dec 22, 2016

Just to confirm this as well:

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 
Stack trace: 
#0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath('/daniel@en0ch.s...') 
#1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile('/_VMs/Nextcloud...', 1) 
#2 [internal function]: OC\Files\View->OC\Files\{closure}() 
#3 /var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) 
#4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() 
#5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806

There have been some debugging here: owncloud/core#22370 And @PVince81 created some PRs to fix this:
owncloud/core#26775
icewind1991/Streams#5
owncloud/core#26762

Nextcloud 11
Ubuntu Server 16.04
Apache 2.4
MySQL 5.7

@blizzz
Copy link
Member

blizzz commented Dec 23, 2016

And another one

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/minion/ovin-11.0.0.9/lib/private/Files/Filesystem.php:806
Stack trace:
#0 /var/www/minion/ovin-11.0.0.9/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath('/arthur/files/P...')
#1 /var/www/minion/ovin-11.0.0.9/lib/private/Files/View.php(1156): OC\Files\View->unlockFile('/Public/release...', 1)
#2 [internal function]: OC\Files\View->OC\Files\{closure}()
#3 /var/www/minion/ovin-11.0.0.9/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))
#4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close()
#5 {main}
  thrown at /var/www/minion/ovin-11.0.0.9/lib/private/Files/Filesystem.php#806

Ping @icewind1991

@MorrisJobke
Copy link
Member

@icewind1991 Didn't you mention that you have an idea what this could cause?

@euh2
Copy link

euh2 commented Jan 14, 2017

I have the same issue. I'm wondering if it somehow is connected to using php7?

Look here

@enoch85
Copy link
Member

enoch85 commented Jan 18, 2017

ownCloud solved it it seems: owncloud/core#22370 (comment)

@Clevero
Copy link

Clevero commented Jan 18, 2017

That sounds great! :)

@MorrisJobke
Copy link
Member

That means updating icewind/streams to 0.5.2 and then apply owncloud/core#26775

@icewind1991 Can you check this out please?

@ryannix123
Copy link

Will this fix work for version 11.0.1?

@JulienPalard
Copy link

@ryannix123 tried 11.0.1, still have the error in my logs.

@icewind1991
Copy link
Member

It will land in 11.0.2 earliest

@MorrisJobke
Copy link
Member

Fix is in #3160

Merged -> will be in 12.0. Let's see if we want to backport this. cc @karlitschek

@enoch85
Copy link
Member

enoch85 commented Jan 27, 2017

Please backport! :)

@karlitschek
Copy link
Member

yes. please backport

@Wonderfall
Copy link
Member

Error still present in 11.0.2.

@enoch85
Copy link
Member

enoch85 commented Feb 28, 2017

Not backported yet. :(

@enoch85
Copy link
Member

enoch85 commented Mar 23, 2017

It's backported: #3293

@Steve8291
Copy link

Sorry if this is a dumb question but I can't figure out how to download a backported version of 11.0.2
I'd like to get more involved in testing patches like this. Is there an easy way to download the individual files that were changed or do I get the whole package somewhere?

@enoch85
Copy link
Member

enoch85 commented Mar 26, 2017

@Steve8291 This will be released in 11.0.3, and if you want the changes right now you have to change the files as it's changed here: https://github.com/nextcloud/server/pull/3293/files or apply a patch with git.

@Wonderfall
Copy link
Member

@Steve8291 You can also use Nextcloud daily packages (the script targets the stable branch). I've tried and now Nextant works. :)

@aronovgj
Copy link

@Steve8291 You can also use Nextcloud daily packages (the script targets the stable branch). I've tried and now Nextant works. :)

Used that and I get still the same error.
All changes from the pull request seem to be there.

Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath('/me/files/and...') #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile('/android/cracke...', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806

@enoch85
Copy link
Member

enoch85 commented Apr 24, 2017

Still in 11.0.3 @icewind1991 :(

{"reqId":"ohJj0U04682MubsHahot","remoteAddr":"93.244.11.162","app":"PHP","message":"Uncaught Error: Access to undeclared static property: OC\\Files\\Filesystem::$normalizedPathCache in \/var\/www\/nextcloud\/lib\/private\/Files\/Filesystem.php:806\nStack trace:\n#0 \/var\/www\/nextcloud\/lib\/private\/Files\/View.php(2018): OC\\Files\\Filesystem::normalizePath('\/daniel@en0ch.s...')\n#1 \/var\/www\/nextcloud\/lib\/private\/Files\/View.php(1156): OC\\Files\\View->unlockFile('\/_VMs\/Nextcloud...', 1)\n#2 [internal function]: OC\\Files\\View->OC\\Files\\{closure}()\n#3 \/var\/www\/nextcloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/CallbackWrapper.php(109): call_user_func(Object(Closure))\n#4 [internal function]: Icewind\\Streams\\CallbackWrapper->stream_close()\n#5 {main}\n  thrown at \/var\/www\/nextcloud\/lib\/private\/Files\/Filesystem.php#806","level":3,"time":"2017-04-24T21:44:07+02:00","method":"GET","url":"\/\/ocs-provider\/","user":"--","version":"11.0.3.2"}

@enoch85 enoch85 reopened this Apr 24, 2017
@yp05327
Copy link

yp05327 commented Apr 25, 2017

@enoch85
Hi, I saw the method in owncloud/core#22370 (comment)
(you commented on 18 Jan)

Fixes were merged and backported, closing.

For stable9.1 it was these two PRs:

update icewind/streams lib: owncloud-archive/3rdparty#284
prevent fclose to be skipped when PHP connection lost: owncloud/core#26939

I found that in 11.0.3, icewind/streams lib has been updated but doesn't do the second step.
And I fixed the problem after do the second step. :)

@MorrisJobke
Copy link
Member

cc @icewind1991

@enoch85
Copy link
Member

enoch85 commented Apr 25, 2017

@yp05327 Thanks! Will patch it. To bad that was missed in the merge for Nextcloud. :/

@enoch85
Copy link
Member

enoch85 commented Apr 25, 2017

Just to confirm, adding owncloud/core#26939 solved it, finally no more spamming!

@icewind1991
Copy link
Member

#4491

@MorrisJobke
Copy link
Member

#4491

Backport to stable11 was merged - will be released as 11.0.4

@Webbeh
Copy link

Webbeh commented Apr 27, 2017

Manually applied the patch yesterday and can't find any error yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests