Nextcloud version (eg, 10.0.2): 11.0.3
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.18
PHP version (eg, 5.6): 7.0.21
Is this the first time you’ve seen this error?: Yes
Can you reliably replicate it? (If so, please outline steps): Click on the activity icon and get a spinning circle
The issue you are facing:
I have upgraded from OwnCloud 8.0 through OC8.1 - OC8.2 - OC9.1.4 - NC10.0.5 - NC11.0.3 and after completing the upgrade, the activity app does not load events anymore. When I check directly on files or folders, I am able to see some activities, though.
The output of your Nextcloud log in Admin > Logging:
TypeError: Argument 2 passed to OC\Activity\Event::setSubject() must be of the type array, null given, called in /var/www/nextcloud/apps/activity/lib/GroupHelper.php on line 151 at /var/www/nextcloud/lib/private/Activity/Event.php#210
Update: I just ran a test and did a quick switch from PHP 7.0 to 5.6, and even though the same errors still show in the logs, it displayed some activities under the app.
Update: I have manged to find out how to remove the broken activity ID but once I removed it, I got another one, and another one etc., dozens of them, so I got tired of it and dropped the whole table to start fresh. Not what I wanted but there must be something there that it did not like since they were regular activities for link sharing.
I have added the code and I got this broken activity ID:
Error no app in context Broken activity: 634519
Could you please advise on how I could drop it manually? Unfortunately, I am not a developer, so I would not know how to do that.
To further help with identifying the issue, I just tried two different upgrading paths:
OC8.0 - OC8.1 - OC8.2 - OC 9.0 - OC9.1 - NC10.0.5 - NC11.0.3
OC8.0 - OC8.1 - OC8.2 - NC 9.0.58 - NC10.0.5 - NC11.0.3
In both cases the Activity app worked find until the upgrade from NC10.0.5 to NC11.0.3. Apparently there is schema update during that step for the Activity table and that might be breaking something.
With PHP 5.6 it still shows the main activity but it cannot pull the name of the file that got shared, created etc., so it says only ‘downloaded via public link’, ‘You created’, ‘You deleted’, and no file names or references.
The logs show this error first:
Error PHP Call to a member function getCache() on null at /var/www/nextcloud/apps/files_sharing/lib/Cache.php#69
Then a bunch of these:
Error PHP Argument 2 passed to OC\Activity\Event::setSubject() must be of the type array, null given, called in /var/www/nextcloud/apps/activity/lib/GroupHelper.php on line 151 and defined at /var/www/nextcloud/lib/private/Activity/Event.php#210
Error PHP Argument 2 passed to OC\Activity\Event::setMessage() must be of the type array, null given, called in /var/www/nextcloud/apps/activity/lib/GroupHelper.php on line 152 and defined at /var/www/nextcloud/lib/private/Activity/Event.php#301
I hope that it helps to narrow down where the issue is.
@shopyro thank for these detailed information. At this point, I think it is better to move this to github since it is clear that there is a bug somewhere: https://github.com/nextcloud/activity/issues (on the bug tracker it is easier to keep track of issues, if you interact with one developer here and he has no time or is not here, the issue remains hidden under a pile of new threads).