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

Errors caused by widget after upgrading to NC28.0.1 #1518

Closed
l3ochan opened this issue Jan 16, 2024 · 13 comments
Closed

Errors caused by widget after upgrading to NC28.0.1 #1518

l3ochan opened this issue Jan 16, 2024 · 13 comments

Comments

@l3ochan
Copy link

l3ochan commented Jan 16, 2024

Steps to reproduce

1.Upgrade to NC28.0.1
2.Have the activities app installed and activated

Expected behaviour

App should work and not generate errors

Actual behaviour

Dashboard widget generates errors

Server configuration

Operating system:
Debian

Web server:
Apache

Database:
MariaDB

PHP version:
8.1

Nextcloud version: (see Nextcloud admin page)
28.0.1

Where did you install Nextcloud from:
Community archive, manual install

Signing status:
Not encrypted

Nextcloud log (data/nextcloud.log) (only one of the errors generated, they are all the same, just wuth different reqID)

{
  "reqId": "f15K5qkNoxzHwPhr70cg",
  "level": 3,
  "time": "2024-01-16T14:32:24+00:00",
  "remoteAddr": "172.71.135.39",
  "user": "Leo",
  "app": "activity",
  "method": "GET",
  "url": "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity",
  "message": "Parameter is undefined",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
  "version": "28.0.1.1",
  "exception": {
    "Exception": "OCP\\RichObjectStrings\\InvalidObjectExeption",
    "Message": "Parameter is undefined",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/activity/lib/GroupHelper.php",
        "line": 75,
        "function": "validate",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/activity/lib/Data.php",
        "line": 248,
        "function": "addActivity",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/activity/lib/Dashboard/ActivityWidget.php",
        "line": 161,
        "function": "get",
        "class": "OCA\\Activity\\Data",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dashboard/lib/Controller/DashboardApiController.php",
        "line": 142,
        "function": "getItemsV2",
        "class": "OCA\\Activity\\Dashboard\\ActivityWidget",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "getWidgetItemsV2",
        "class": "OCA\\Dashboard\\Controller\\DashboardApiController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/ocs/v1.php",
        "line": 65,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/nextcloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/RichObjectStrings/Validator.php",
    "Line": 70,
    "message": "Parameter is undefined",
    "exception": {},
    "CustomMessage": "Parameter is undefined"
  }
}
@susnux
Copy link
Contributor

susnux commented Jan 17, 2024

Hello,
this seems to be not a problem with the widget but some application provides an invalid activity.
The activity contains a rich subject for which no rich parameter was set.

To further debug this we need some information which activity caused this issue, so maybe you can apply this patch, set the logging level to debug and report the output?

diff --git a/lib/GroupHelper.php b/lib/GroupHelper.php
index a997ff53..02e7631a 100644
--- a/lib/GroupHelper.php
+++ b/lib/GroupHelper.php
@@ -81,6 +81,13 @@ class GroupHelper {
                                                        'exception' => $e
                                                ],
                                        );
+                                       $this->logger->debug(
+                                               'Invalid rich subject or rich parameter',
+                                               [
+                                                       'subject' => $event->getRichSubject(),
+                                                       'parameters' => $event->getRichSubjectParameters(),
+                                               ]
+                                       );
                                        $event->setRichSubject('Rich subject or a parameter for "' . $event->getRichSubject() . '" is malformed', []);
                                        $event->setParsedSubject('Rich subject or a parameter for "' . $event->getRichSubject() . '" is malformed');
                                }

@l3ochan
Copy link
Author

l3ochan commented Jan 17, 2024

Hi,
Thanks foy your reply, how should I apply this patch, to which file ?

@l3ochan l3ochan closed this as completed Jan 17, 2024
@l3ochan l3ochan reopened this Jan 17, 2024
@susnux
Copy link
Contributor

susnux commented Jan 17, 2024

Please apply the patch to apps/activity/lib/GroupHelper.php

@l3ochan
Copy link
Author

l3ochan commented Jan 17, 2024

I applied the patch, logs will be with you soon

@l3ochan
Copy link
Author

l3ochan commented Jan 17, 2024

Here is the log entry

{
  "reqId": "qx7FS1tTAAr1MKD0ltvp",
  "level": 3,
  "time": "2024-01-17T12:39:55+00:00",
  "remoteAddr": "172.69.222.185",
  "user": "Leo",
  "app": "activity",
  "method": "GET",
  "url": "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity",
  "message": "Parameter is undefined",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
  "version": "28.0.1.1",
  "exception": {
    "Exception": "OCP\\RichObjectStrings\\InvalidObjectExeption",
    "Message": "Parameter is undefined",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/activity/lib/GroupHelper.php",
        "line": 75,
        "function": "validate",
        "class": "OC\\RichObjectStrings\\Validator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/activity/lib/Data.php",
        "line": 248,
        "function": "addActivity",
        "class": "OCA\\Activity\\GroupHelper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/activity/lib/Dashboard/ActivityWidget.php",
        "line": 161,
        "function": "get",
        "class": "OCA\\Activity\\Data",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dashboard/lib/Controller/DashboardApiController.php",
        "line": 142,
        "function": "getItemsV2",
        "class": "OCA\\Activity\\Dashboard\\ActivityWidget",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "getWidgetItemsV2",
        "class": "OCA\\Dashboard\\Controller\\DashboardApiController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/ocs/v1.php",
        "line": 65,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/nextcloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/RichObjectStrings/Validator.php",
    "Line": 70,
    "message": "Parameter is undefined",
    "exception": [],
    "CustomMessage": "Parameter is undefined"
  },
  "id": "65a7ca9ceab7c"
}

@solracsf
Copy link
Member

Log entry should be a debug one, not a Warning; please activate debug mode (refer to docs).

@l3ochan
Copy link
Author

l3ochan commented Jan 24, 2024

I turned on debug mode via the /config/config.php file but no debug log entry appears.

@susnux
Copy link
Contributor

susnux commented Jan 24, 2024

Did you turned the debug mode on or did you set loglevel to 0?

@l3ochan
Copy link
Author

l3ochan commented Jan 25, 2024

I turned on the debug mode with the line in /config/config.php but loglevel was at 3. Should I set it to 0?

@susnux
Copy link
Contributor

susnux commented Jan 25, 2024

Yes please set loglevel to 0 and retry :)

@l3ochan
Copy link
Author

l3ochan commented Jan 26, 2024

ok I think I know which app makes the widget freak out.
here's the log entry, I think its the deck app that has an issue here:
{ "reqId": "P3oThABZzd5dHKBl9uM6", "level": 0, "time": "2024-01-26T16:15:49+00:00", "remoteAddr": "141.101.68.231", "user": "Leo", "app": "activity", "method": "GET", "url": "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity", "message": "Invalid rich subject or rich parameter", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0", "version": "28.0.1.1", "data": { "app": "activity", "subject": "{user} has added a description to card {card} in list {stack} on board {board}", "parameters": "{\"card\":{\"type\":\"highlight\",\"id\":59,\"name\":\"Le prototype fonctionne avec de l'énergie solaire\",\"link\":\"https://cloud.nekocorp.fr/index.php/apps/deck/card/59\"},\"board\":{\"type\":\"highlight\",\"id\":7,\"name\":\"Projet SIN🌱\",\"link\":\"https://cloud.nekocorp.fr/index.php/apps/deck/#/board/7/\"},\"stack\":{\"type\":\"highlight\",\"id\":19,\"name\":\"QC/facilité d'utilisation/sécurité\"}}" }, "id": "65b3daba1489c" }

@susnux
Copy link
Contributor

susnux commented Feb 3, 2024

So this is caused by the deck app

@l3ochan
Copy link
Author

l3ochan commented May 22, 2024

I think but I don't remember, it's fixed though

@susnux susnux closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants