nextcloud/suspicious_login

ValueError during IPv4 background training

McSnowflake opened this issue · 1 comments

Even after more than a year the model is not trained yet. Yesterday I found the reasen in the logs (didn't look before):

It said ValueError random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max)

Here comes the detailed report:

{
  "reqId": "..",
  "level": 3,
  "time": "2024-04-11T05:25:02+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "suspicious_login",
  "method": "",
  "url": "--",
  "message": "Caught unknown error during IPv4 background training",
  "userAgent": "--",
  "version": "28.0.2.5",
  "exception": {
    "Exception": "ValueError",
    "Message": "random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max)",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/Service/NegativeSampleGenerator.php",
        "line": 74,
        "function": "random_int"
      },
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/Service/NegativeSampleGenerator.php",
        "line": 114,
        "function": "generateFromRealData",
        "class": "OCA\\SuspiciousLogin\\Service\\NegativeSampleGenerator",
        "type": "->"
      },
      {
        "function": "OCA\\SuspiciousLogin\\Service\\{closure}",
        "class": "OCA\\SuspiciousLogin\\Service\\NegativeSampleGenerator",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/Service/NegativeSampleGenerator.php",
        "line": 115,
        "function": "array_map"
      },
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/Service/DataLoader.php",
        "line": 123,
        "function": "generateShuffledFromPositiveSamples",
        "class": "OCA\\SuspiciousLogin\\Service\\NegativeSampleGenerator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/Service/TrainService.php",
        "line": 72,
        "function": "generateRandomShuffledData",
        "class": "OCA\\SuspiciousLogin\\Service\\DataLoader",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/suspicious_login/lib/BackgroundJob/TrainJobIpV4.php",
        "line": 70,
        "function": "train",
        "class": "OCA\\SuspiciousLogin\\Service\\TrainService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 81,
        "function": "run",
        "class": "OCA\\SuspiciousLogin\\BackgroundJob\\TrainJobIpV4",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/suspicious_login/lib/Service/NegativeSampleGenerator.php",
    "Line": 74,
    "message": "Caught unknown error during IPv4 background training",
    "CustomMessage": "Caught unknown error during IPv4 background training"
  },
  "id": "661aa313ee0e2"
}

I don't know if it's a bug or not, but I am willing to help finding out.

Greets

Already fixed in #745.

In >=v28.0.3