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

#1

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.

#2

Same here!

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

#3

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
#4

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”}

#5

Exactly the same here. Upgraded to 12 yesterday

#6

Same over here as well…

#7

And another one with the same problem.

#8

And another one with the same problem.

#9

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.

#10

And another one with the same problem.

I use Android App 1.4.3

#11

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

#12

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

#13

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
#14

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

#15

It should have been fixed with 12.0.1: https://github.com/nextcloud/activity/blob/v12.0.1/lib/FilesHooks.php#L141

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.

#16

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.

#17

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

#18

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).

#19

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.

#20

Same Problem with the 12.0.2