[NC12 Beta2][Activity] Error - PHP - Undefined offset: 3 at /path/to/nextcloud/apps/activity/lib/FilesHooks.php#620

Hey there,

I am currently uploading a huge amount of files (mainly documents and pictures) to a non-admin account via windows client version 2.3.0rc1 (build 4) and nextcloud log shows the following error every some minutes:

Error PHP Undefined offset: 3 at /path/to/nextcloud/apps/activity/lib/FilesHooks.php#620

So it has something to do with the activity app. As far as I can see there are also some of the files missing in the related users activity list.
But the upload works fine beside this, so count this more as report than as help request. If I should create an issue on github, I will do so.

I run Nextcloud 12 Beta 2
on a Raspberry Pi 2
with up to date Raspbian Jessie
on Linux kernel 4.9.25-v7+,
Apache/2.4.25
mod_php 7.0.18-1
MariaDB 10.0.30.

Same here!

I updated to 12 today, so might or might not be related to that… Not sure.

Still face that with the newest nc 12 release. During uploading files, also single large ones, this error occurs sometimes several times a minute.

Just to give an example:

Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:25:07+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:25:07+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:25:07+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:48+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:48+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:38+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:38+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:38+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:15+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:15+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:24:15+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:50+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:50+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:50+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:27+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:27+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:27+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:09+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:09+0200
Error	PHP	Undefined offset: 3 at /var/www/owncloud/apps/activity/lib/FilesHooks.php#620	2017-05-23T23:23:07+0200

Same here when uploading large files (nc 12.0.0.29 and 2.3.1 (build 8) nc client):

{“reqId”:“ibI2Ql1P1TGzBAKDlXK3”,“level”:3,“time”:“2017-05-26T11:54:26+00:00”,“remoteAddr”:“a.b.c.d”,“user”:“MYUSER”,“app”:“PHP”,“method”:“PUT”,“url”:"/nextcloud/remote.php/dav/uploads/MYUSER/1805211762/00000466",“message”:“Undefined offset: 3 at /srv/www/htdocs/nextcloud/apps/activity/lib/FilesHooks.php#620”,“userAgent”:“Mozilla/5.0 (Windows) mirall/2.3.1 (build 8) (Nextcloud)”,“version”:“12.0.0.29”}

Exactly the same here. Upgraded to 12 yesterday

Same over here as well…

And another one with the same problem.

And another one with the same problem.

Just to compare: I used desktop client 2.3.0rc1 (build 4) to upload the files.
On what upload method/version does the error occur for you guys?

The newer stable 2.3.1 was not offered to me through the client. I will install it now and see, if the error persists. If so, I will create a github issue.

And another one with the same problem.

I use Android App 1.4.3

Okay, so doesn’t seem to have something to do with the client. Just wanted to get sure.

Having same issue since upgrading to NC12. Was not there previously

Reported on github: https://github.com/nextcloud/activity/issues/163

Any additional informations could be helpful. Error occurs for me during image and video files upload, did not observe large files of different kinds (e.g. archives) so far. Some documents were also uploaded, but since they are very small, I cannot assure, that the error was caused by them.

€: Was already fixed: https://github.com/nextcloud/activity/pull/157/files
It’s just simple to modify the line by oneself to get rid of the problem :).

1 Like

Is this a problem you solved?
I’m a 12.0.1 stable version, but the same error occurred. It doesn’t occur frequently, but sometimes it appears in the log.

Undefined offset: 3 at /var/www/vhosts/NEXTCLOUD/apps/activity/lib/FilesHooks.php#620

It should have been fixed with 12.0.1: activity/lib/FilesHooks.php at v12.0.1 · nextcloud/activity · GitHub

Check line 141 of your /path/to/nextcloud/apps/activity/lib/FilesHooks.php if it looks like the one in the link:
`

  if ($path === '/' || $path === '' || $path === null) {

`

I changed that manually in 12.0.0 and this fixed the problem for me. With 12.0.1 this should have been included.

If this is already applied, it would be great, if you could find out during what kind of (most likely) file uploads this occurs. Maybe there is another kind of invalid $path not yet excluded in the code.

The 141 line of my file is the same as that.

At that time the user was mounting Nextcloud on Windows (WebDAV) and editing file with Excel application. Probably… Or user have opened a spreadsheet file using Collabora Online.

So the user didn’t use nextcloud desktop client? I could imagine some error with the temporary ms/libre/whatever office files. Those are by default excluded via desktop client, maybe via other webdav they cause issues.

I forwarded this to github and hope that it will be recognized there, as the issue was already closed :wink: : https://github.com/nextcloud/activity/issues/163

We don’t use any Nextcloud client application by anyone. WebDAV errors often occurred in older versions, but now there are no errors related to WebDAV (in the log).

I also can confirm that this error persists in 12.0.1
We are only using the official client applications (Windows, Android and Apple). No direct access via WebDAV.
Sadly I can not reproduce the exact circumstances that triggered it. I only know that my father moved large amounts of files yesterday (10.000+) and I now have about 50 lines with this error in the logs.

Checked the file. Can confirm that line 141 looks exactly like this.

Same Problem with the 12.0.2