Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: No notification on comments; activity app reports InvalidObjectExeption Object is invalid, value is not a string #51427

Open
5 of 8 tasks
DrDBanner opened this issue Mar 12, 2025 · 7 comments
Assignees
Labels

Comments

@DrDBanner
Copy link

DrDBanner commented Mar 12, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

Since the 31.0.0.1 RC1 upgrade from 30.x Branch:

  • I don't get instant notifications in the browser and mobile devices
  • Notifications per mail do get delivered
  • occ push notifications test works fine
  • Log gets filled with errors within activity app
  • I do get push notifications for created calendar events!

Level: Error
App: activity

I am unsure if the error is related to the issue. I also truncated the oc_comments, oc_comments_read_markers, oc_activity and oc_activity_mq just to be sure there's no issue.

Steps to reproduce

  1. f.g. Write a comment in a deck card with and without '@' mention; files with '@' mention ;
  2. Realize you don't get a notification
  3. Open log

Expected behavior

Notification in browser and mobile devices work.

Nextcloud Server version

31

Operating system

Other

PHP engine version

PHP 8.2

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

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "REDACTED"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.somewhere.de",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "dbtype": "mysql",
        "version": "31.0.1.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "filelocking.enabled": true,
        "theme": "",
        "loglevel": 3,
        "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": 1,
        "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
    }
}

List of activated Apps

Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.2.0-rc.1
  - circles: 31.0.0-dev.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contacts: 7.0.3
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - deck: 1.15.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_bpm: 1.7.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - groupfolders: 19.0.3
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 4.3.0-rc.1
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - tables: 0.9.0
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - drawio: 3.0.3 (installed 3.0.3)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.21.0)
  - files_external: 1.23.0 (installed 1.23.0)
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{
  "reqId": "iF1X8d6WrVhIp4EeZRdw",
  "level": 3,
  "time": "2025-03-11T11:28:16+00:00",
  "app": "activity",
  "method": "GET",
  "url": "/ocs/v2.php/apps/activity/api/v2/activity/comments?format=json&previews=true&since=0",
  "message": "Object is invalid, value 240169 is not a string",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15",
  "version": "31.0.1.0",
  "exception": {
    "Exception": "OCP\\RichObjectStrings\\InvalidObjectExeption",
    "Message": "Object is invalid, value 240169 is not a string",
    "Code": 0,
    "Trace": [
      {
        "file": "lib/private/RichObjectStrings/Validator.php",
        "line": 59,
        "function": "validateParameter",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "apps/activity/lib/GroupHelper.php",
        "line": 74,
        "function": "validate",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "apps/activity/lib/GroupHelper.php",
        "line": 46,
        "function": "addEvent",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "apps/activity/lib/Data.php",
        "line": 231,
        "function": "addActivity",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "apps/activity/lib/Controller/APIv2Controller.php",
        "line": 189,
        "function": "get",
        "class": "OCA\\Activity\\Data",
        "type": "->"
      },
      {
        "file": "apps/activity/lib/Controller/APIv2Controller.php",
        "line": 136,
        "function": "get",
        "class": "OCA\\Activity\\Controller\\APIv2Controller",
        "type": "->"
      },
      {
        "file": "lib/private/AppFramework/Http/Dispatcher.php",
        "line": 200,
        "function": "getFilter",
        "class": "OCA\\Activity\\Controller\\APIv2Controller",
        "type": "->"
      },
      {
        "file": "lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "lib/private/Route/Router.php",
        "line": 307,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "ocs/v1.php",
        "line": 49,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "ocs/v2.php",
        "line": 7,
        "args": [
          "ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "lib/private/RichObjectStrings/Validator.php",
    "Line": 85,
    "message": "Object is invalid, value 240169 is not a string",
    "exception": [],
    "CustomMessage": "Object is invalid, value 240169 is not a string"
  },
  "id": "67d15c6973814"
}

Additional info

  • Console throws some 403 on some CSS files from tasks app, when loggin in.

Notifications app output in console after login:

Image

ResizeObserver error is thrown exactly the moment I open a card in the deck:

Image

RangeError: Maximum call stack size exceeded is thrown the moment I click on the notifications bell in the webinterface

Image
@DrDBanner DrDBanner added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 12, 2025
@provokateurin provokateurin self-assigned this Mar 12, 2025
@provokateurin provokateurin added 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 12, 2025
@provokateurin provokateurin moved this to 🏗️ In progress in 📁 Files team Mar 12, 2025
@provokateurin
Copy link
Member

@DrDBanner Thank you for reporting this! I'm having a hard time to understand this, because I do not understand where the invalid data is coming from.
Could you apply the following patch, test again and post the logs? Thanks!
patch.txt

@DrDBanner
Copy link
Author

Applied like this since no Git environment:

sudo patch -p1 < patch.txt 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/lib/GroupHelper.php b/lib/GroupHelper.php
|index 0d8921f7..444f7263 100644
|--- a/lib/GroupHelper.php
|+++ b/lib/GroupHelper.php
--------------------------
Patching file lib/GroupHelper.php using Plan A...
Hunk #1 succeeded at 71.
Hmm...  Ignoring the trailing garbage.
done

Console output (came after the patch):

Image

log output:

[PHP] Fehler: Cannot modify header information - headers already sent by (output started at /usr/local/www/apache24/noexec/cloud.somewhere.de/apps/activity/lib/GroupHelper.php:74) at /usr/local/www/apache24/noexec/cloud.somewhere.de/lib/private/AppFramework/Http/Output.php#51
	GET /ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity
	von IP von user um 12.03.2025, 14:57:53

I guess the patch did not do what it should?

@provokateurin
Copy link
Member

Eh yes sorry 😬
Depending on where you do it var_dump does the wrong thing.
Please revert it!

While I was working on this, I created #51442 to make future debugging.
Could you apply that instead (download from https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/51442.patch) and post the logs?

@DrDBanner
Copy link
Author

no "tests" in path hence the patch fails

@provokateurin
Copy link
Member

Ah forgot about that, now this one should really work now™:
patch.txt

@DrDBanner
Copy link
Author

DrDBanner commented Mar 13, 2025

@provokateurin GM ...

I updated to RC2 and reapplied the patch. Then I disabled deck, just to be sure, because I get a lot of nextcloud/deck#6815 these.

Then I truncated oc_comments, oc_comments_read_markers, oc_activity. Then I created a new folder as admin and created a new textfile within. I shared the folder with my user and added a comment as admin to my user. I did get a notification on all devices instant -ONCE. The DB entry looks normal to me, but I do get this one:

[activity] Fehler: Object for placeholder file is invalid, value 243822 for key id is not a string
	GET /ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity
	von XXXum 13.03.2025, 08:22:17

which lead to a notification mail with

Rich subject or a parameter for "{author} hat {file} kommentiert" is malformed

and this is the full error

{
  "reqId": "CxDjUJdMl1PGfyzgy4RN",
  "level": 3,
  "time": "2025-03-13T07:22:17+00:00",
  "remoteAddr": "77.20.2.109",
  "user": "XXX",
  "app": "activity",
  "method": "GET",
  "url": "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity",
  "message": "Object for placeholder file is invalid, value 243822 for key id is not a string",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0",
  "version": "31.0.1.1",
  "exception": {
    "Exception": "OCP\\RichObjectStrings\\InvalidObjectExeption",
    "Message": "Object for placeholder file is invalid, value 243822 for key id is not a string",
    "Code": 0,
    "Trace": [
      {
        "file": "/usr/local/www/apache24/noexec/XXX/lib/private/RichObjectStrings/Validator.php",
        "line": 59,
        "function": "validateParameter",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/apps/activity/lib/GroupHelper.php",
        "line": 74,
        "function": "validate",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/apps/activity/lib/GroupHelper.php",
        "line": 46,
        "function": "addEvent",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/apps/activity/lib/Data.php",
        "line": 231,
        "function": "addActivity",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/apps/activity/lib/Dashboard/ActivityWidget.php",
        "line": 136,
        "function": "get",
        "class": "OCA\\Activity\\Data",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/apps/dashboard/lib/Controller/DashboardApiController.php",
        "line": 119,
        "function": "getItemsV2",
        "class": "OCA\\Activity\\Dashboard\\ActivityWidget",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 200,
        "function": "getWidgetItemsV2",
        "class": "OCA\\Dashboard\\Controller\\DashboardApiController",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/lib/private/Route/Router.php",
        "line": 307,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/ocs/v1.php",
        "line": 49,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/usr/local/www/apache24/noexec/XXX/ocs/v2.php",
        "line": 7,
        "args": [
          "/usr/local/www/apache24/noexec/XXX/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/usr/local/www/apache24/noexec/XXX/lib/private/RichObjectStrings/Validator.php",
    "Line": 85,
    "message": "Object for placeholder file is invalid, value 243822 for key id is not a string",
    "exception": [],
    "CustomMessage": "Object for placeholder file is invalid, value 243822 for key id is not a string"
  },
  "id": "67d287ae18b04"
}

Now the log gets flooded with that even if I delete the file from the Webinterface. (maybe a good idea prevent that in the future as well; If a resource is marked deleted do not try to execute jobs on them or related to them)

Image

Truncating the activity table stops the execution and production of the error.

@provokateurin
Copy link
Member

Thanks! I won't get to it this week, but with this information I should be able to find the source of the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🏗️ In progress
Development

No branches or pull requests

3 participants