Code Monkey home page Code Monkey logo

Comments (13)

susnux avatar susnux commented on June 19, 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');
                                }

from activity.

l3ochan avatar l3ochan commented on June 19, 2024

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

from activity.

susnux avatar susnux commented on June 19, 2024

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

from activity.

l3ochan avatar l3ochan commented on June 19, 2024

I applied the patch, logs will be with you soon

from activity.

l3ochan avatar l3ochan commented on June 19, 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"
}

from activity.

solracsf avatar solracsf commented on June 19, 2024

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

from activity.

l3ochan avatar l3ochan commented on June 19, 2024

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

from activity.

susnux avatar susnux commented on June 19, 2024

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

from activity.

l3ochan avatar l3ochan commented on June 19, 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?

from activity.

susnux avatar susnux commented on June 19, 2024

Yes please set loglevel to 0 and retry :)

from activity.

l3ochan avatar l3ochan commented on June 19, 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" }

from activity.

susnux avatar susnux commented on June 19, 2024

So this is caused by the deck app

from activity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.