Recognize app: Undefined variable $nodeDistance

Hi,
A few hours after trying to restart recognize for my photo collection I am getting the messages in the admin settings and the log.
Thank you for any help on this!
kr,
Martin

Nextcloud version : 27.1.4
Operating system and version: Debian 13
Apache or nginx version: nginx 1.25.3
PHP version : 8.2.13
Recognize app: 5.0.3

The issue you are facing:
In the admin settings:

An error occurred during face recognition, please check the Nextcloud logs.

Face recognition: 32682 Queued files, Last classification: 6 hours ago, Scheduled background jobs: 0,

There are queued files in the face recognition queue but no background job is scheduled to process them.

Face clustering: 163 faces left to cluster, Last clustering run: 6 hours ago, Scheduled background jobs: 0,
A minimum of 120 faces per user is necessary for clustering to kick in

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. run recognize app

The output of your Nextcloud log in Admin > Logging:
16x

[PHP] Error: Undefined variable $nodeDistance at /var/www/nextcloud/apps/recognize/lib/Clustering/MrdBallTree.php#191

at 2023-12-12T22:55:21+01:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'installed' => true,
  'instanceid' => '*************',
  'maintenance' => false,
  'version' => '27.1.4.1',
  'dbtype' => 'mysql',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncdbuser',
  'dbpassword' => '******************',
  'data-fingerprint' => '*********************',
  'passwordsalt' => '**************************',
  'secret' => '***********************************',
  'datadirectory' => '/data/ncdata',
  'tempdirectory' => '/data/ncdata/tmp',
  'logfile' => '/data/ncdata/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
  'log_rotate_size' => 10485760,
  'trusted_domains' => 
  array (
    0 => 'localhost/nc',
    5 => 'nextcloudpi.local/nc',
    7 => 'nextcloudpi/nc',
    8 => 'nextcloudpi.lan/nc',
    1 => '10.0.0.54',
    2 => 'example.example.com',
  ),
  'overwrite.cli.url' => 'https://example.example.com',
  'htaccess.RewriteBase' => '/nextcloud',
  'enable_previews' => true,
  'preview_max_x' => 1024,
  'preview_max_y' => 1024,
  'preview_max_filesize_image' => -1,
  'preview_concurrency_all' => 3,
  'preview_concurrency_new' => 2,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\OpenDocument',
    10 => 'OC\\Preview\\Krita',
    11 => 'OC\\Preview\\Movie',
    12 => 'OC\\Preview\\PDF',
    13 => 'OC\\Preview\\TIFF',
    14 => 'OC\\Preview\\SVG',
    15 => 'OC\\Preview\\MP4',
    16 => 'OC\\Preview\\Image',
    17 => 'OC\\Preview\\MKV',
    18 => 'OC\\Preview\\Illustrator',
    19 => 'OC\\Preview\\MSOffice2003',
    20 => 'OC\\Preview\\MSOffice2007',
    21 => 'OC\\Preview\\MSOfficeDoc',
    22 => 'OC\\Preview\\Photoshop',
    23 => 'OC\\Preview\\Postscript',
    24 => 'OC\\Preview\\StarOffice',
    25 => 'OC\\Preview\\Font',
  ),
  'jpeg_quality' => '90',
  'overwriteprotocol' => 'https',
  'theme' => '',
  'mail_sendmailmode' => 'smtp',
  'ldapIgnoreNamingRules' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'whoever',
  'mail_domain' => 'gmail.com',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'example@gmail.com',
  'mail_smtppassword' => '************************',
  'app_install_overwrite' => 
  array (
    0 => 'files_external_gdrive',
    1 => 'files_external_onedrive',
    2 => 'occweb',
    3 => 'dashboard',
    4 => 'keeweb',
    5 => 'cookbook',
    6 => 'files_bpm',
  ),
  'forwarded_for_headers' => 
  array (
    0 => 'HTTP_X_FORWARDED',
    1 => 'HTTP_FORWARDED_FOR',
  ),
  'default_phone_region' => 'AT',
  'music.cover_size' => 500,
  'music.podcast_auto_update_interval' => 0.5,
  'music.lastfm_api_key' => '*********************',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    13 => 'example.example.com',
    0 => '10.0.0.54',
  ),
  'defaultapp' => 'dashboard,files',
  'knowledgebaseenabled' => true,
  'trashbin_retention_obligation' => 'auto, 90',
  'logtimezone' => 'Europe/Vienna',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '**************************',
  ),
  'activity_expire_days' => 20,
  'allow_user_to_change_display_name' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

-

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

-

Hey @martingwb

this is sort of a known issue, but we’ve been at a loss so far why it would happen