nextcloud / nextcloud/mail

Dataset must contain samples with exactly 3 dimensions, 4 given

Open
#6,146 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature:priority inbox
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Have users on your installation with set up mail accounts
  2. Have suspicious login also enabled (might be important)
  3. Run cron jobs
Expected behavior

Nothing happens in the logs

Actual behavior

Our log shows this error 506 times for the last 2 weeks:

{
  "reqId": "jF18I3StppDQxCchnn0q",
  "level": 3,
  "time": "2022-03-22T16:50:50+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "mail",
  "method": "",
  "url": "--",
  "message": "Cron mail sync failed for account 65",
  "userAgent": "--",
  "version": "23.0.3.2",
  "exception": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Sync failed for 65:INBOX: Dataset must contain samples with exactly 3 dimensions, 4 given.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
        "line": 135,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->"
      },
      {
        "file": "/var/www/html/apps/mail/lib/BackgroundJob/SyncJob.php",
        "line": 109,
        "function": "syncAccount",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->"
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/Job.php",
        "line": 79,
        "function": "run",
        "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
        "type": "->"
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
        "line": 95,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/html/cron.php",
        "line": 150,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
    "Line": 249,
    "Previous": {
      "Exception": "Rubix\\ML\\Exceptions\\IncorrectDatasetDimensionality",
      "Message": "Dataset must contain samples with exactly 3 dimensions, 4 given.",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/html/apps/suspicious_login/vendor/rubix/ml/src/Classifiers/GaussianNB.php",
          "line": 297,
          "function": "check",
          "class": "Rubix\\ML\\Specifications\\DatasetHasDimensionality",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/Service/Classification/ImportanceClassifier.php",
          "line": 327,
          "function": "predict",
          "class": "Rubix\\ML\\Classifiers\\GaussianNB",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/Listener/NewMessageClassificationListener.php",
          "line": 118,
          "function": "classifyImportance",
          "class": "OCA\\Mail\\Service\\Classification\\ImportanceClassifier",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
          "line": 87,
          "function": "handle",
          "class": "OCA\\Mail\\Listener\\NewMessageClassificationListener",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 251,
          "function": "__invoke",
          "class": "OC\\EventDispatcher\\ServiceEventListener",
          "type": "->"
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 73,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 88,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 380,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 230,
          "function": "runPartialSync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 135,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/html/apps/mail/lib/BackgroundJob/SyncJob.php",
          "line": 109,
          "function": "syncAccount",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/public/BackgroundJob/Job.php",
          "line": 79,
          "function": "run",
          "class": "OCA\\Mail\\BackgroundJob\\SyncJob",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
          "line": 95,
          "function": "execute",
          "class": "OCP\\BackgroundJob\\Job",
          "type": "->"
        },
        {
          "file": "/var/www/html/cron.php",
          "line": 150,
          "function": "execute",
          "class": "OCP\\BackgroundJob\\TimedJob",
          "type": "->"
        }
      ],
      "File": "/var/www/html/apps/suspicious_login/vendor/rubix/ml/src/Specifications/DatasetHasDimensionality.php",
      "Line": 64
    },
    "CustomMessage": "Cron mail sync failed for account 65"
  },
  "id": "623a30d26bda1"
}

Note at the end that the DatasetHasDimensionality seems to be loaded from another app, so there might be a different version?

      "File": "/var/www/html/apps/suspicious_login/vendor/rubix/ml/src/Specifications/DatasetHasDimensionality.php",
      "Line": 64
Mail app version

1.11.7

Mailserver or service

mx.nc.c

Operating system

Ubuntu

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database

MariaDB

Additional info

suspicious_login: 4.1.0

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/mail/lib/Service/Classification/ImportanceClassifier.php and apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php, following the reported calls at lines 327 and 249. Compare the classification path with the suspicious_login Rubix ML dependency shown in the trace, then reproduce through cron mail sync. Done means synchronization no longer logs the dimensionality error for affected accounts.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.