nextcloud / recognize

👁 👂 Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres
https://apps.nextcloud.com/apps/recognize
GNU Affero General Public License v3.0
539 stars 45 forks source link

Undefined variable $nodeDistance #965

Closed simonspa closed 4 months ago

simonspa commented 1 year ago

Which version of recognize are you using?

4.3.2

Enabled Modes

Face recognition

TensorFlow mode

Normal mode

Downstream App

Memories App

Which Nextcloud version do you have installed?

27.0.2

Which Operating system do you have installed?

Debian 11

Which database are you running Nextcloud on?

mysql 10.5.19

Which Docker container are you using to run Nextcloud? (if applicable)

No response

How much RAM does your server have?

32G

What processor Architecture does your CPU have?

x86_64

Describe the Bug

During crawling I find the following error in my Nextcloud 27.0.2 log:

{
    "reqId": "16dOemVBgKnSFIjoYEZb",
    "level": 3,
    "time": "2023-08-25T18:17:22+02:00",
    "remoteAddr": "",
    "user": "--",
    "app": "PHP",
    "method": "",
    "url": "--",{
    "reqId": "16dOemVBgKnSFIjoYEZb",
    "level": 3,
    "time": "2023-08-25T18:17:22+02:00",
    "remoteAddr": "",
    "user": "--",
    "app": "PHP",
    "method": "",
    "url": "--",
    "message": "Undefined variable $nodeDistance at /var/www/nextcloud/apps/recognize/lib/Clustering/MrdBallTree.php#191",
    "userAgent": "--",
    "version": "27.0.2.1",
    "data":
    {
        "app": "PHP"
    },
    "id": "64edad7e22bbe"
}
    "message": "Undefined variable $nodeDistance at /var/www/nextcloud/apps/recognize/lib/Clustering/MrdBallTree.php#191",
    "userAgent": "--",
    "version": "27.0.2.1",
    "data":
    {
        "app": "PHP"
    },
    "id": "64edad7e22bbe"
}

Not sure if related, but the last time background job ran is always shown as "never" despite them running just fine (I see new photos being tagged):

image

Expected Behavior

No log error

To Reproduce

Run background job

Debug log

No response

simonspa commented 1 year ago

There is a second place where nodeDistance does not seem to be defined:

{"reqId":"Q3PjAyCf9kJWJaGQynOd","level":3,"time":"2023-08-14T16:06:10+02:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined variable $nodeDistance at /var/www/nextcloud/apps/recognize/lib/Clustering/MstSolver.php#122","userAgent":"--","version":"27.0.1.2","data":{"app":"PHP"},"id":"64edb0387ee20"}
marcelklehr commented 1 year ago

Which PHP version are you running? Debian 11 doesn't have PHP8 by default, right?

simonspa commented 1 year ago

Hi @marcelklehr, this is PHP Version 8.1.22, installed via the regular deb.sury.org repository.

marcelklehr commented 1 year ago

@MB-Finski Any idea why that variable might be undefined there? Doesn't seem to make sense to me

Neurozone commented 5 months ago

I have the same issue Rocky linux 9.3 PHP 8.2.17 Recognize 6.1.1 Nextcloud 28

using ngxin and php-fpm

[PHP] Error: Undefined variable $nodeDistance at ***/apps/recognize/lib/Clustering/MstSolver.php#122 from ? by -- at 7 avr. 2024, 19:30:47

marcelklehr commented 4 months ago

I can't reproduce this. I believe you that you get this, but I'm gonna call this a fluke for now.