Server: PHP 7.4: Trying to access array offset on value of type int at lib/private/Files/Node/Node.php#327

Created on 20 Jan 2020  路  49Comments  路  Source: nextcloud/server

How to use GitHub

  • Please use the 馃憤 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

Hi, after upgrading not NC 18 and PHP 7.4, I have got some error messages that are apparently related to this new PHP version:

{"reqId":"AAA","level":3,"time":"20-Jan-2020 08:36:15","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Trying to access array offset on value of type int at /srv/http/nextcloud/lib/private/Files/Node/Node.php#327","userAgent":"--","version":"18.0.0.10"}
{"reqId":"BBB","level":3,"time":"20-Jan-2020 09:03:12","remoteAddr":"192.168.1.69","user":"admin","app":"PHP","method":"GET","url":"/apps/logreader/get?offset=0&count=50&levels=11111","message":"Trying to access array offset on value of type null at /srv/http/nextcloud/apps/logreader/lib/Log/LogIterator.php#78","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10"}
{"reqId":"CCC","level":3,"time":"20-Jan-2020 09:10:44","remoteAddr":"192.168.1.69","user":"me","app":"PHP","method":"GET","url":"/apps/spreed/","message":"Trying to access array offset on value of type null at /srv/http/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10"}
{"reqId":"DDD","level":3,"time":"20-Jan-2020 09:12:32","remoteAddr":"192.168.1.69","user":"me","app":"PHP","method":"GET","url":"/apps/mail/","message":"Trying to access array offset on value of type null at /srv/http/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10"}
{"reqId":"EEE","level":3,"time":"20-Jan-2020 09:13:34","remoteAddr":"192.168.1.69","user":"jean","app":"PHP","method":"GET","url":"/apps/contacts/","message":"Trying to access array offset on value of type null at /srv/http/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10"}

Errors are from apps:

  • AAA: core server
  • BBB: Logreader (even if approuved in #18146)
  • CCC: Talk (not listed in #18146)
  • DDD: Mail (not listed in #18146)
  • EEE: Contact (not listed in #18146)

Apprarently there is an issue in /3rdparty/leafo/scssphp/src/Compiler.php.

0. Needs triage bug

Most helpful comment

Having the same issue here.

NC 19.0 and php 7.4

All 49 comments

Duplicate of #18996

@J0WI OK it's a duplicate of #18996 for messages CCC, DDD and EEE.

But it's not a duplicate for log AAA and log BBB.

Please open a separate issue in https://github.com/nextcloud/logreader for BBB.

Thanks for reporting :+1:

https://github.com/nextcloud/server/blob/5bf3d1bb384da56adbf205752be8f840aac3b0c5/lib/private/Files/Node/Node.php#L327-L329

OK. Current implementation will prepend a '/' if the first character is not '/' or evaluates to false.

        if (!$path || strpos($path, '/') !== 0) {
            $path = '/' . $path;
        }

That's the same without the array integer warning. Actually the documentation says that isValidPath should be called with a string but somehow it's called with an integer. Probably a faulty type conversion somewhere.

Index: lib/private/Files/Node/Node.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/private/Files/Node/Node.php (revision 06c20a5138a0189047c26b6480cbf285a00bc449)
+++ lib/private/Files/Node/Node.php (date 1579613413639)
@@ -324,7 +324,14 @@
     * @return bool
     */
    public function isValidPath($path) {
-       if (!$path || $path[0] !== '/') {
+       if (is_int($path)) {
+           try {
+               throw new \LogicException('$path is a integer: ' . $path);
+           } catch (\LogicException $e) {
+               \OC::$server->getLogger()->logException($e);
+           }
+       }
+       if (!$path || strpos($path, '/') !== 0) {
            $path = '/' . $path;
        }
        if (strstr($path, '/../') || strrchr($path, '/') === '/..') {

Would be nice to test this patch with additional logging. It will throw a exception if $path is an integer, catch the exception and forward it to the logs. We need the exception then to see where this faulty integer is coming from. Thanks :+1: (Don't forget the backups just in case)

Similar to: https://github.com/nextcloud/server/pull/18926

Hi thank for re-opening this issue 馃憤

I am not comfortable with testing a patch on my only NC setup which is in production 馃槦

Can you reproduce this issue?
Anyway it does make sense to catch if $path is something else than a string before the condition $path[0] !== '/', right?

Can you reproduce this issue?

No luck :man_shrugging:

If you keep if (!$path || $path[0] !== '/') { and not replace with if (!$path || strpos($path, '/') !== 0) { there should be no impact. The try-catch logic (if $path is numeric) is there to draw a stack trace. Stack trace will show the requests path. I guess other people will run into this issue too. Probably someone else has a testing setup to apply the patch.

Hi @kesselb !
I got this in to my logs. Hopefully this is what you want to see.

{"reqId":"M9muiDyZWTtHrsJrBfJV","level":3,"time":"2020-01-23T19:05:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Trying to access array offset on value of type int at /home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Node.php#327","userAgent":"--","version":"18.0.0.10"}
{"reqId":"4NEiKit2Q87PQK6Xm0E2","level":3,"time":"2020-01-23T19:09:10+00:00","remoteAddr":"11.22.33.44","user":"admin","app":"no app in context","method":"GET","url":"/apps/text/session/create?fileId=425&guestName=null&forceRecreate=false","message":{"Exception":"LogicException","Message":"$path is a integer: 425","Code":0,"Trace":[{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/SimpleFS/SimpleFolder.php","line":74,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Service/DocumentService.php","line":151,"function":"getFile","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Service/ApiService.php","line":87,"function":"createDocument","class":"OCA\\Text\\Service\\DocumentService","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Controller/SessionController.php","line":49,"function":"create","class":"OCA\\Text\\Service\\ApiService","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"create","class":"OCA\\Text\\Controller\\SessionController","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Route/Router.php","line":299,"function":"call_user_func"},{"file":"/home/nginx/domains/mydomain.net/public/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; CrOS x86_64 12607.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.86 Safari/537.36","version":"18.0.0.10"}
{"reqId":"4NEiKit2Q87PQK6Xm0E2","level":3,"time":"2020-01-23T19:09:10+00:00","remoteAddr":"11.22.33.44","user":"admin","app":"no app in context","method":"GET","url":"/apps/text/session/create?fileId=425&guestName=null&forceRecreate=false","message":{"Exception":"LogicException","Message":"$path is a integer: 425","Code":0,"Trace":[{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Folder.php","line":181,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Files/SimpleFS/SimpleFolder.php","line":84,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Service/DocumentService.php","line":153,"function":"newFile","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Service/ApiService.php","line":87,"function":"createDocument","class":"OCA\\Text\\Service\\DocumentService","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/apps/text/lib/Controller/SessionController.php","line":49,"function":"create","class":"OCA\\Text\\Service\\ApiService","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"create","class":"OCA\\Text\\Controller\\SessionController","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/lib/private/Route/Router.php","line":299,"function":"call_user_func"},{"file":"/home/nginx/domains/mydomain.net/public/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/nginx/domains/mydomain.net/public/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/nginx/domains/mydomain.net/public/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; CrOS x86_64 12607.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.86 Safari/537.36","version":"18.0.0.10"}

Thanks @MeiRos :+1:

https://github.com/nextcloud/text/blob/936225d69d2ac0546d4d83048817273950979193/lib/Service/DocumentService.php#L150-L154

cc @juliushaertl Please pass a string to getFile and newFile ;)

Hi
Any ETA for a fix ? :)

Why is it closed ? I'm still having the error, and my NC instance is up to date.

As you may have seen I did some debugging with @MeiRos and traced this error down to a specific code path. That faulty code has been fixed (by the linked pull request). The pull request is merged and the code shipped with 18.0.1 hence I closed this issue.

Feel free to patch your instance the same way and add more logs to find more faulty places. We can reopen than.

Just got this error today :

{
"reqId": "ZoHJpUomOyEaZo7zMuJS",
"level": 3,
"time": "2020-03-18T15:17:26+01:00",
"remoteAddr": "",
"user": "--",
"app": "PHP",
"method": "",
"url": "--",
"message": "Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#327",
"userAgent": "--",
"version": "18.0.2.2",
"id": "5e7236d8f2a9b"
}

And since you fixed it in 18.0.1 and i'm using 18.0.2.2, then issue is not fixed. Unless I've missed something ?

And since you fixed it in 18.0.1 and i'm using 18.0.2.2, then issue is not fixed. Unless I've missed something ?

As you may have seen I did some debugging with @MeiRos and traced this error down to a specific code path. Feel free to patch your instance the same way and add more logs to find more faulty places.

There are nothing about node.php in my log. It's fixed for me.

I have errors about compiler.php, but that's the other story..

Still in my logs today.
@kesselb you mean, if people doesn't want to have errors in logs, they have to download and install Nexctcloud, then patch manually a file to fix the issue ?
wtf, It seems i've missed something... why not release the fix in the code directly ?

https://github.com/nextcloud/server/issues/19010#issuecomment-576683752

Is the explanation there not clear to you? It's important to figure out which code calls the method in a wrong way.

True, I didn't realize that the patch was for extra logging. Thought it was a fix.
Ok, It's patched. Will wait for more logs now... (I don't know how to trigger the error manually.)

Ok @kesselb I think I've some stuff for you^^

{"reqId":"YSaEubAD9ntxMOVTWTIg","level":3,"time":"2020-03-20T07:15:59+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 1","Code":0,"Trace":[{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Mount/MountProvider.php","line":183,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Mount/MountProvider.php","line":124,"function":"getFolder","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/VersionsBackend.php","line":160,"function":"getMount","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":62,"function":"getAllVersionedFiles","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/TimedJob.php","line":55,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/cron.php","line":125,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"--","version":"18.0.2.2","id":"5e74ba1b60ab9"}
{"reqId":"YSaEubAD9ntxMOVTWTIg","level":3,"time":"2020-03-20T07:15:59+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 21975","Code":0,"Trace":[{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/VersionsBackend.php","line":64,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":66,"function":"getVersionsForFile","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/TimedJob.php","line":55,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/cron.php","line":125,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"--","version":"18.0.2.2","id":"5e74ba1b60a67"}
{"reqId":"YSaEubAD9ntxMOVTWTIg","level":3,"time":"2020-03-20T07:15:59+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 21981","Code":0,"Trace":[{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/VersionsBackend.php","line":64,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":66,"function":"getVersionsForFile","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/TimedJob.php","line":55,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/cron.php","line":125,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"--","version":"18.0.2.2","id":"5e74ba1b60a21"}
{"reqId":"YSaEubAD9ntxMOVTWTIg","level":3,"time":"2020-03-20T07:15:59+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 21993","Code":0,"Trace":[{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/VersionsBackend.php","line":64,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":66,"function":"getVersionsForFile","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/lib/private/BackgroundJob/TimedJob.php","line":55,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud.d-c.fr/cron.php","line":125,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud.d-c.fr/lib/private/Files/Node/Node.php","Line":330,"CustomMessage":"--"},"userAgent":"--","version":"18.0.2.2","id":"5e74ba1b609db"}

Can you please reopen the issue ?

Thanks

I have the same issue.

{"reqId":"MEaKnizVSCRKfkvNYLRm","level":3,"time":"April 28, 2020 20:49:29","remoteAddr":"XX.XX.XX.XX","user":"xx","app":"PHP","method":"GET","url":"/apps/logreader/get?offset=0&count=50&levels=11111","message":"Trying to access array offset on value of type null at /var/www/nextcloud/apps/logreader/lib/Log/LogIterator.php#78","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36","version":"18.0.4.2"}

Same issue in NC 18.0.4 fresh install.
Trying to access array offset on value of type null at /var/www/nextcloud/apps/logreader/lib/Log/LogIterator.php#78

Same issue. NC 18.0.4.2
Error PHP Trying to access array offset on value of type int at /var/www/html/nextcloud/lib/private/Files/Node/Node.php#327 |

{"reqId":"ezsRaBOHF1ixdoauyxaj","level":3,"time":"2020-06-04T06:40:01+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 1","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Files/Node/Folder.php","line":59,"function":"isValidPath","class":"OC\Files\Node\Node","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Node/Folder.php","line":137,"function":"getFullPath","class":"OC\Files\Node\Folder","type":"->"},{"function":"get","class":"OC\Files\Node\Folder","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":72,"function":"call_user_func_array"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":144,"function":"__call","class":"OCA\GroupFolders\Helper\LazyFolder","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":184,"function":"get","class":"OCA\GroupFolders\Helper\LazyFolder","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":124,"function":"getFolder","class":"OCA\GroupFolders\Mount\MountProvider","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":160,"function":"getMount","class":"OCA\GroupFolders\Mount\MountProvider","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":62,"function":"getAllVersionedFiles","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/html/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\GroupFolders\BackgroundJob\ExpireGroupVersions","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":55,"function":"execute","class":"OC\BackgroundJob\Job","type":"->"},{"file":"/var/www/html/nextcloud/cron.php","line":125,"function":"execute","class":"OC\BackgroundJob\TimedJob","type":"->"}],"File":"/var/www/html/nextcloud/lib/private/Files/Node/Node.php","Line":329,"CustomMessage":"--"},"userAgent":"--","version":"18.0.4.2"}

Similar problem here with latest 18.0.5. It's with GroupFolders this time.
See new issue #21236

@glamarini I recommend you post your log there, too, as it seems to be a similar problem. This issue is closed.

Similar problem after updating til latest 18.0.6.

[PHP 7.4] Error: Trying to access array offset on value of type null at /var/www/html/nextcloud/apps/logreader/lib/Controller/LogController.php#100

{"reqId":"XuErhlh17DyUmWFmXoK0OwAAAMc","level":3,"time":"2020-06-10T20:50:57+02:00","remoteAddr":"xx.xx.xx.xx","user":"XXXX","app":"PHP","method":"GET","url":"/index.php/apps/logreader/poll?lastReqId=XuErO1h17DyUmWFmXoK0FwAAANg","message":"Trying to access array offset on value of type null at /var/www/html/nextcloud/apps/logreader/lib/Controller/LogController.php#100","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"18.0.6.0","id":"5ee12c3c9c9b8"}

Same for me with latest 19.0.0:

{"reqId":"pevUP37AnCb1xLMMoCZe","level":3,"time":"2020-06-17T04:30:12+02:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#328","userAgent":"--","version":"19.0.0.12","id":"5ee9ab2a63c0a"}

Edit:
I didnt notice this before updating from php7.2 to php7.4

Nextcloud 19 php 7.4 and still the same :/ I am considering downgrade to php 7.2

Same issue here, moreover, I have some phantom (non-existent) dirs from an external storage. Tried to occ file:clean but no result.
NC 19.0.0, php 7.4

Having the same issue here.

NC 19.0 and php 7.4

No solutions for this problem?

Asking for a solution on a closed issue is not the best way to get an reply. I suggest you open a new issue if there is not already one open. Good luck 馃嵑

I do not know why it is closed when it is not fixed and several other user still have the same problem with NC 18 even with NC 19

@kesselb can you take a look on latest comments on this issue?

Trying to access array offset on value of type null at /srv/http/nextcloud/apps/logreader/lib/Log/LogIterator.php#78

https://github.com/nextcloud/logreader/issues/352

Trying to access array offset on value of type null at /var/www/html/nextcloud/apps/logreader/lib/Controller/LogController.php#100

https://github.com/nextcloud/logreader/issues/354

Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#328

@Burschi500 https://github.com/nextcloud/server/issues/19010#issuecomment-576683752

Nextcloud 19 php 7.4 and still the same :/ I am considering downgrade to php 7.2

Same issue here, moreover, I have some phantom (non-existent) dirs from an external storage. Tried to occ file:clean but no result. NC 19.0.0, php 7.4

Having the same issue here.

@TorinKR @vanyolai @Chris-A-sc

  1. check your logs (like most of the other people)
  2. look for a similar code places (e.g. Node.php#328 or LogController.php#100)
  3. If there is already a report for the code places in this thread
    3.1. use GitHub reactions to show that you are affected as well
    3.2. otherwise https://github.com/nextcloud/server/issues/19010#issuecomment-576683752

thank for the help @kesselb 馃嵑

@kesselb I guess I fixed the problem with Node.php#328 as described #19010
But LogController.php#100 I did not fix. How to fix that?

Just updated to version 18.0.7 and the bug is back. Trying to access array offset on value of type int at /var/www/html/nextcloud/lib/private/Files/Node/Node.php#327
Now it's line 327 instead of 328. I'll check the code tomorrow and try if the last patch of you works.

I don't understand why you didn't fix it in the new version?

NC 19.0.1 PHP 7.4.8

Trying to access array offset on value of type int at /var/www/vhosts//httpdocs/lib/private/Files/Node/Node.php#328

If you still see this issue happening, please apply the patch from @kesselb and paste the verbose logging output, as the error message in general is not pointing to the original location where the issue is happening: https://github.com/nextcloud/server/issues/19010#issuecomment-576683752

Did apply the patch after I got the issue back in 18.0.7. It worked fine. Upgraded to 19.0.1 and issue was back again. Now I applied the patch once again. It looks like the issue disappeared. If not I'll report again with verbose logging output.

Here is the output from the logs after applying the patch from kesselb:

Error
- no app in context -
{"reqId":"ljghvZVCq2FPwlEFlmTC","level":3,"time":"2020-08-07T12:20:03+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 2","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":60,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":138,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":72,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":144,"function":"__call","class":"OCA\\GroupFolders\\Helper\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":184,"function":"get","class":"OCA\\GroupFolders\\Helper\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":124,"function":"getFolder","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":160,"function":"getMount","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":62,"function":"getAllVersionedFiles","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":62,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":57,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":126,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":331,"CustomMessage":"--"},"userAgent":"--","version":"19.0.1.1","id":"5f2d2ad3dd472"}

Error
- no app in context- 
{"reqId":"ljghvZVCq2FPwlEFlmTC","level":3,"time":"2020-08-07T12:20:03+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"LogicException","Message":"$path is a integer: 1","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":60,"function":"isValidPath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":138,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":72,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Helper/LazyFolder.php","line":144,"function":"__call","class":"OCA\\GroupFolders\\Helper\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":184,"function":"get","class":"OCA\\GroupFolders\\Helper\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php","line":124,"function":"getFolder","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":160,"function":"getMount","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":62,"function":"getAllVersionedFiles","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":57,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":40,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":62,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":57,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":126,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":331,"CustomMessage":"--"},"userAgent":"--","version":"19.0.1.1","id":"5f2d2ad3dd505"}

These two error messages are triggered by the cronjob and therefore appear every 5 minutes.

System:
Operating System: | ArchLinux 5.4.55-1-lts x86_64
Memory: | 15.53 GB

PHP:
Version: 7.4.9
Memory Limit: 1 GB
Max Execution Time: 3600

Ah I see https://github.com/nextcloud/groupfolders/pull/942 was not released yet as a fix for the groupfolders app.

Same issue here... (also groupfolders)


JSON-Object:

{"reqId":"xEIL38IsJazQ0iUo73FZ","level":3,"time":"2020-08-24T16:40:05+00:00","remoteAddr":"[redacted]","user":"server","app":"no app in context","method":"PUT","url":"/remote.php/dav/files/server/[redacted]","message":{"Exception":"LogicException","Message":"$path is a integer: 45314","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":63,"function":"normalizePath","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":138,"function":"getFullPath","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":96,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php","line":93,"function":"createVersion","class":"OCA\\GroupFolders\\Versions\\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":207,"function":"createVersion","class":"OCA\\Files_Versions\\Versions\\VersionManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Hooks.php","line":61,"function":"store","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":110,"function":"write_hook","class":"OCA\\Files_Versions\\Hooks","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":381,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":162,"function":"emitPreHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1143,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":515,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":320,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":307,"CustomMessage":"--"},"userAgent":"curl/7.68.0","version":"19.0.1.1","id":"5f43ed65cf231"}


Stacktrace

LogicException: $path is a integer: 45314
/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 63:
OC\Files\Node\Node->normalizePath()
/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 138:
OC\Files\Node\Folder->getFullPath()
/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php - line 96:
OC\Files\Node\Folder->get()
/var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php - line 93:
OCA\GroupFolders\Versions\VersionsBackend->createVersion()
/var/www/nextcloud/apps/files_versions/lib/Storage.php - line 207:
OCA\Files_Versions\Versions\VersionManager->createVersion()
/var/www/nextcloud/apps/files_versions/lib/Hooks.php - line 61:
OCA\Files_Versions\Storage::store()
/var/www/nextcloud/lib/private/legacy/OC_Hook.php - line 110:
OCA\Files_Versions\Hooks::write_hook()
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 381:
OC_Hook::emit()
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 162:
OCA\DAV\Connector\Sabre\File->emitPreHooks()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1143:
OCA\DAV\Connector\Sabre\File->put()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 515:
Sabre\DAV\Server->updateFile("*** sensiti ... *")
/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpPut()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
Sabre\DAV\Server->emit()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
Sabre\DAV\Server->invokeMethod()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
Sabre\DAV\Server->start()
/var/www/nextcloud/apps/dav/lib/Server.php - line 320:
Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 167:
require_once("/var/www/ne ... p")

Thanks a lot @Pingger I moved it to https://github.com/nextcloud/groupfolders/issues/1023

Mh, I noticed a high cpu-usage of the cron-job on my instance (v 19.0.2) and saw the trying to access ...-error very often in my logs.
After a upgrade to v 19.0.3 it seems, that the error was disappeared.

(I have no groupfolders installed)

@AndreKoepke See https://github.com/nextcloud/server/issues/19010#issuecomment-670370540 for additional steps to generate some useful log output.

@juliushaertl thanks for the hint.
After a few days the error occurs again and starting eating my cpu.
But I noticed that failure happens in a other class.

I will open a new ticket for it.

Was this page helpful?
0 / 5 - 0 ratings