nextcloud / nextcloud/activity

[Bug]: v34 - Activity - Failed to format activity notification | Value provided for subject is not valid

Open
#2,648 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
145
Forks
72
Avg merge
6d 9h
Merged PRs (30d)
42

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Log gets clogged every scheduler cycle with:

{
  "reqId": "53F66PXRKyUIMuEba42d",
  "level": 3,
  "time": "2026-06-09T12:53:51+00:00",
  "remoteAddr": "redacted",
  "user": "Nadine",
  "app": "activity",
  "method": "GET",
  "url": "/ocs/v2.php/apps/notifications/api/v2/notifications?format=json",
  "scriptName": "/ocs/v2.php",
  "message": "Failed to format activity notification",
  "userAgent": "Mozilla/5.0 (Macintosh) mirall/33.0.5 (Nextcloud, macos-25.4.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
  "version": "34.0.0.12",
  "clientReqId": "fa7b0a43-0c4e-4149-9978-1cd0812529f0",
  "exception": {
    "Exception": "OCP\\Notification\\InvalidValueException",
    "Message": "Value provided for subject is not valid",
    "Code": 0,
    "Trace": [
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php",
        "line": 57,
        "function": "setSubject",
        "class": "OC\\Notification\\Notification",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php",
        "line": 130,
        "function": "getNotificationForEvent",
        "class": "OCA\\Activity\\NotificationGenerator",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php",
        "line": 122,
        "function": "getDisplayNotificationForEvent",
        "class": "OCA\\Activity\\NotificationGenerator",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Notification/Manager.php",
        "line": 351,
        "function": "prepare",
        "class": "OCA\\Activity\\NotificationGenerator",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/notifications/lib/Controller/EndpointController.php",
        "line": 105,
        "function": "prepare",
        "class": "OC\\Notification\\Manager",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 165,
        "function": "listNotifications",
        "class": "OCA\\Notifications\\Controller\\EndpointController",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 78,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/App.php",
        "line": 137,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Route/Router.php",
        "line": 324,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/ocs/v1.php",
        "line": 63,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/ocs/v2.php",
        "line": 10,
        "args": [
          "/usr/local/www/apache24/noexec/sys/domain.de/cloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Notification/Notification.php",
    "Line": 157,
    "message": "Failed to format activity notification",
    "exception": "{\"class\":\"OCP\\\\Notification\\\\InvalidValueException\",\"message\":\"Value provided for subject is not valid\",\"code\":0,\"file\":\"/usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Notification/Notification.php:157\",\"trace\":\"#0 /usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php(57): OC\\\\Notification\\\\Notification->setSubject()\\n#1 /usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php(130): OCA\\\\Activity\\\\NotificationGenerator->getNotificationForEvent()\\n#2 /usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/activity/lib/NotificationGenerator.php(122): OCA\\\\Activity\\\\NotificationGenerator->getDisplayNotificationForEvent()\\n#3 /usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Notification/Manager.php(351): OCA\\\\Activity\\\\NotificationGenerator->prepare()\\n#4 /usr/local/www/apache24/noexec/sys/domain.de/cloud/apps/notifications/lib/Controller/EndpointController.php(105): OC\\\\Notification\\\\Manager->prepare()\\n#5 /usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\\\\Notifications\\\\Controller\\\\EndpointController->listNotifications()\\n#6 /usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#7 /usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/AppFramework/App.php(137): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#8 /usr/local/www/apache24/noexec/sys/domain.de/cloud/lib/private/Route/Router.php(324): OC\\\\AppFramework\\\\App::main()\\n#9 /usr/local/www/apache24/noexec/sys/domain.de/cloud/ocs/v1.php(63): OC\\\\Route\\\\Router->match()\\n#10 /usr/local/www/apache24/noexec/sys/domain.de/cloud/ocs/v2.php(10): require_once('...')\\n#11 {main}\"}",
    "CustomMessage": "Failed to format activity notification"
  },
  "id": "6a280d14048b6"
}
Steps to reproduce
  1. Open Log
  2. Wait for Cycle
Expected behavior

No error

Nextcloud Server version

34

Operating system

Other

PHP engine version

PHP 8.4

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
Passwort: 
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.domain.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.domain.de",
        "dbtype": "mysql",
        "version": "34.0.0.12",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\APCu",
        "installed": true,
        "maintenance": false,
        "filelocking.enabled": true,
        "log_type": "file",
        "logfile": "\/usr\/local\/www\/apache24\/data\/sys\/cloud.domain.de\/nextclouddata\/nextcloud.log",
        "loglevel": 3,
        "logdateformat": "F d, Y H:i:s",
        "tempdirectory": "\/usr\/local\/www\/apache24\/data\/sys\/cloud.domain.de/.temp",
        "has_internet_connection": "true",
        "updater.release.channel": "beta",
        "mysql.utf8mb4": true,
        "default_phone_region": "DE",
        "maintenance_window_start": 1,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "versions_retention_obligation": "auto, 128",
        "preview_concurrency_all": 4,
        "preview_concurrency_new": 2,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "preview_max_x": 1080,
        "preview_max_y": 1920,
        "jpeg_quality": 90,
        "preview_max_filesize_image": 5,
        "preview_max_memory": 256,
        "metadata_max_filesize": 256,
        "data-fingerprint": "c75a585b676b4deca4768adb852c686b",
        "app_install_overwrite": [],
        "theme": "",
        "mail_smtpsecure": "ssl",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}
List of activated Apps
occ app:list
Enabled:
  - activity: 7.0.0
  - admin_audit: 1.24.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - calendar: 6.4.2
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - contacts: 8.6.0-rc.1
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.39.0
  - deck: 1.18.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0-dev.0
  - files_lock: 34.0.0
  - files_pdfviewer: 7.0.0-dev.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - firstrunwizard: 7.0.0-dev.0
  - forms: 5.3.0
  - groupfolders: 22.0.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - mail: 5.9.1
  - nextcloud_announcements: 6.0.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - photos: 7.0.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0-dev.0
  - related_resources: 5.0.0-dev.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - support: 6.0.0
  - survey_client: 6.0.0-dev.0
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0
  - tables: 2.2.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - app_api: 34.0.0 (installed 32.0.0)
  - drawio: 4.2.3 (installed 4.2.3)
  - encryption: 2.22.0
  - files_external: 1.26.0 (installed 1.23.0)
  - files_reminders: 1.7.0 (installed 1.4.0)
  - tasks: 0.17.1 (installed 0.17.1)
  - testing: 1.23.0
  - twofactor_nextcloud_notification: 8.0.0
  - user_ldap: 1.25.0
Nextcloud Signing status

Nextcloud Logs
see above
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/activity/lib/NotificationGenerator.php at lines 57, 122, and 130, then inspect lib/private/Notification/Notification.php at line 157. Reproduce the notifications API request and identify which activity event produces the invalid subject value. Done means the scheduler cycle no longer logs “Failed to format activity notification”.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.