nextcloud / activity

:zap: Activity app for Nextcloud
113 stars 63 forks source link

Error while parsing activity event: log gets flooded with "InvalidArgumentException: Unknown app" errors for each e-mail notification #1585

Closed mrclschstr closed 5 months ago

mrclschstr commented 6 months ago

Description

I updated to Nextcloud version 27.1.7 a few days ago. I don't check the Nextcloud logs too regularly, but since the update I have noticed that the log is flooded with the following messages:

{
  "reqId": "ILU3wt9oaXW8LFYWzGrY",
  "level": 4,
  "time": "2024-03-03T10:50:02+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "activity",
  "method": "",
  "url": "--",
  "message": "Error while parsing activity event",
  "userAgent": "--",
  "version": "27.1.7.2",
  "data": {
    "exception": "{\"class\":\"InvalidArgumentException\",\"message\":\"Unknown app\",\"code\":0,\"file\":\"/path/to/nextcloud/apps/settings/lib/Activity/Provider.php:88\",\"trace\":\"#0 /path/to/nextcloud/apps/activity/lib/MailQueueHandler.php(468): OCA\\Settings\\Activity\\Provider->parse()\\n#1 /path/to/nextcloud/apps/activity/lib/MailQueueHandler.php(368): OCA\\Activity\\MailQueueHandler->parseEvent()\\n#2 /path/to/nextcloud/apps/activity/lib/MailQueueHandler.php(165): OCA\\Activity\\MailQueueHandler->sendEmailToUser()\\n#3 /path/to/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php(60): OCA\\Activity\\MailQueueHandler->sendEmails()\\n#4 /path/to/nextcloud/lib/private/BackgroundJob/Job.php(54): OCA\\Activity\\BackgroundJob\\EmailNotification->run()\\n#5 /path/to/nextcloud/lib/private/BackgroundJob/TimedJob.php(60): OC\\BackgroundJob\\Job->execute()\\n#6 /path/to/nextcloud/cron.php(152): OC\\BackgroundJob\\TimedJob->execute()\\n#7 {main}\"}",
    "app": "activity"
  }
}

As far as I can tell, the errors are generated when an email notification is sent, e.g. due to a changed appointment. Approximately 20 messages are generated in the log for each e-mail notification sent. My Nextcloud log has now grown to several megabytes.

The only strange thing is that I haven't noticed any direct errors in connection with the e-mail notifications. The mails arrive normally and I haven't noticed any other problems. I have only noticed that the log is flooded with messages. Should I be worried?

Steps to reproduce

Change or create an appointment in a shared calendar. The other person(s) should have configured a corresponding e-mail notification.

Expected/Actual behaviour

As I have already described above, I cannot detect any errors in the functions. I have only noticed that for each email notification about 20 errors are generated in the Nextcloud log (see log above).

Server configuration

Operating system: Ubuntu

Web server: Apache

Database: MariaDB (10.6.17)

PHP version: 8.2.16

Nextcloud version: 27.1.7

Where did you install Nextcloud from: Archive and manual install (several years ago)

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - breezedark: 27.0.0
  - bruteforcesettings: 2.7.0
  - calendar: 4.6.5
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.5.2
  - contactsinteraction: 1.8.0
  - cospend: 1.6.0
  - dav: 1.27.0
  - emlviewer: 1.0.9
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_markdown: 2.4.1
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.9.2
  - notifications: 2.15.0
  - oauth2: 1.15.2
  - password_policy: 1.17.0
  - photos: 2.3.0
  - previewgenerator: 5.4.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - twofactor_webauthn: 1.3.2
  - updatenotification: 1.17.0
  - viewer: 2.1.0
  - workflowengine: 2.9.0
Disabled:
  - dashboard: 7.7.0 (installed 7.0.0)
  - encryption: 2.15.0 (installed 2.12.0)
  - support: 1.10.0 (installed 1.0.0)
  - survey_client: 1.15.0 (installed 0.1.5)
  - suspicious_login: 5.0.0
  - user_ldap: 1.17.0
  - user_status: 1.7.0 (installed 1.0.1)
  - weather_status: 1.7.0 (installed 1.0.0)

Nextcloud configuration:

Relevant? I can add it later, when needed.

Are you using an external user-backend, if yes which one: No

Jolopu commented 5 months ago

I have exactly the same issue since updating to 27.1.7. Before it was ok.

solracsf commented 5 months ago

This is what is causing these messages: https://github.com/nextcloud/activity/pull/1561 So, errors were already there before, they we're simply not catched & logged.

Fix at https://github.com/nextcloud/activity/pull/1586