Activity App seems no longer working

Hallo,

Nextcloud 11
Ubuntu 14.04 TLS
PHP 7
MariaDB 5.5

It seems the Activity App no longer working by my Nextcloud environment.
In the Stream, the last activitys are from 3th Januar but in the meantime files were uploaded!

Even before the third of January the activities were not always displayed correctly.

Also the e-mail notification comes not always and partly incomplete.

No new entries about file changes are created in the database in the table: “oc_activity”!

But there activitys like add and remove favorites appear.

Something in your nextcloud.log file?

Hallo,

Yes, log say: “InvalidArgumentException: The givven affected user is invalid” many times.
[details=Summary]no app in context InvalidArgumentException: The given affected user is invalid
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 888: OC\Activity\Event->setAffectedUser(10300)
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 182: OCA\Activity\FilesHooks->addNotificationsForUser(10300, ‘created_by’, Array, 28382, ‘/10300/10302 Di…’, true, true, 0, ‘file_created’)
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 111: OCA\Activity\FilesHooks->addNotificationsForFileAction(’/10300/10302 Di…’, ‘file_created’, ‘created_self’, ‘created_by’)
/var/www/owncloud/apps/activity/lib/FilesHooksStatic.php - line 45: OCA\Activity\FilesHooks->fileCreate(’/10300/10302 Di…’)
/var/www/owncloud/lib/private/legacy/hook.php - line 106: OCA\Activity\FilesHooksStatic fileCreate(Array)
/var/www/owncloud/apps/dav/lib/Connector/Sabre/File.php - line 283: OC_Hook emit(‘OC_Filesystem’, ‘post_create’, Array)
/var/www/owncloud/apps/dav/lib/Connector/Sabre/File.php - line 215: OCA\DAV\Connector\Sabre\File->emitPostHooks(false)
/var/www/owncloud/apps/dav/lib/Connector/Sabre/Directory.php - line 137: OCA\DAV\Connector\Sabre\File->put(Resource id #82)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1072: OCA\DAV\Connector\Sabre\Directory->createFile(‘FiBu 112016.PDF’, Resource id #82)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile(‘10300/10302 Die…’, Resource id #82, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method PUT’, Array)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/owncloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/owncloud/remote.php - line 165: require_once(’/var/www/ownclo…’)
{main}[/details]

Okay found the issue, it’s because your username only contains numbers.
The fix is rather easy: https://github.com/nextcloud/activity/pull/103/files

Thank you!

Can yout tell me, how i integrate this change in my environment?

Okay, i found the file. Thanks.

Hello,

The Activity app still does not work properly.
I have second error in my log

Error while running background job (Doctrine\DBAL\Exception\SyntaxErrorException): An exception occurred while executing ‘DELETE FROM oc_activity_mq WHERE amq_timestamp <= ? AND amq_affecteduser IN ()’ with params [1484142887]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1
OCA\Activity\BackgroundJob\EmailNotification ):
/var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
/var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php - line 177: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘DELETE FROM `oc…’, Array)
/var/www/owncloud/apps/activity/lib/MailQueueHandler.php - line 334: Doctrine\DBAL\Statement->execute(Array)
/var/www/owncloud/apps/activity/lib/BackgroundJob/EmailNotification.php - line 131: OCA\Activity\MailQueueHandler->deleteSentItems(Array, 1484142887)
/var/www/owncloud/apps/activity/lib/BackgroundJob/EmailNotification.php - line 85: OCA\Activity\BackgroundJob\EmailNotification->runStep(25, 1484142887)
/var/www/owncloud/lib/private/BackgroundJob/Job.php - line 53: OCA\Activity\BackgroundJob\EmailNotification->run(NULL)
/var/www/owncloud/lib/private/BackgroundJob/TimedJob.php - line 54: OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
/var/www/owncloud/cron.php - line 145: OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
{main}

That was already fixed before:

Now i have another “no app in context” error:

no app in context InvalidArgumentException: The given affected user is invalid
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 889: OC\Activity\Event->setAffectedUser(11325)
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 490: OCA\Activity\FilesHooks->addNotificationsForUser(11325, ‘moved_by’, Array, 27480, ‘/11325/Lohn/112…’, true, true, 0, ‘file_changed’)
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 368: OCA\Activity\FilesHooks->generateMoveActivities(Array, Array, Array, 27480, ‘Berechnung Schw…’, ‘Berechnung Schw…’)
/var/www/owncloud/apps/activity/lib/FilesHooks.php - line 279: OCA\Activity\FilesHooks->fileMoving(’/11325/Lohn/Ber…’, ‘/11325/Lohn/112…’)
/var/www/owncloud/apps/activity/lib/FilesHooksStatic.php - line 77: OCA\Activity\FilesHooks->fileMovePost(’/11325/Lohn/Ber…’, ‘/11325/Lohn/112…’)
/var/www/owncloud/lib/private/legacy/hook.php - line 106: OCA\Activity\FilesHooksStatic fileMovePost(Array)
/var/www/owncloud/lib/private/Files/View.php - line 822: OC_Hook emit(‘OC_Filesystem’, ‘post_rename’, Array)
/var/www/owncloud/apps/dav/lib/Connector/Sabre/ObjectTree.php - line 268: OC\Files\View->rename(’/11325/Lohn/Ber…’, ‘/11325/Lohn/112…’)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642: OCA\DAV\Connector\Sabre\ObjectTree->move(‘11325/Lohn/Bere…’, ‘11325/Lohn/1120…’)
[internal function] Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method MOVE’, Array)
/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/owncloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/owncloud/remote.php - line 165: require_once(’/var/www/ownclo…’)
{main}