Occ recognize:cluster killed after 30 min

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.6.
  • Operating system and version (e.g., Ubuntu 24.04):
    • ubuntu 22.04 / docker
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • never tried before
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I start the procedure and its killed after ~30 min. It has done some clustering in the past automatically in the background so to speak. I have never started in terminal. I am trying in terminal manuall now as it has stopped after processing ~3000 photos of 100.000 photos overall and its not proceding even after several weeks.

$ php occ recognize:cluster
Clustering face detections for user simon
ClusterDebug: Retrieving face detections for user simon
ClusterDebug: Found 10777 fresh detections. Adding 1981 old detections and 1930 sampled detections from already existing clusters. Calculating clusters on 14688 detections.
Killed

Steps to replicate it (hint: details matter!):

  1. Start php occ recognize:cluster in Terminal

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

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

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Batch size I believe is what you’re looking for.

-b

e.g.

Thank you, that helped. Interesting that is does not give that hint on the overview page for recognize.

It looks like the recognize:cluster command is being killed due to resource limits, likely out-of-memory (OOM) in your Docker container or host. Processing 14,000+ face detections can be very memory-intensive. I recommend increasing your container’s memory limit or running the command on a more powerful machine. Also, try breaking the task into smaller batches by clustering fewer photos at a time. Monitoring system logs (dmesg or Docker logs) during the run can confirm if OOM kills are occurring. Adjusting PHP memory and max execution time settings might also help.