librephotos icon indicating copy to clipboard operation
librephotos copied to clipboard

When the face recognition service dies, only a backend restart brings it back

Open sefininio opened this issue 1 year ago • 3 comments

When the face recognition service dies, the logs are filled with errors like:

INFO:ownphotos:HTTPConnectionPool(host='localhost', port=8005): Max retries exceeded with url: /face-locations (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1495a6132e50>: Failed to establish a new connection: [Errno 111] Connection refused'))

If this happens during a scan - the result is a lot of these errors and no inferred faces from the scan - so a backend restart and rescan is required.

Suggestion - the code that handles the above error, can :

  • Pause the scan
  • Restart the service
  • Wait for it to be up and available
  • Retry the failed task and continue the scan.

sefininio avatar Jan 15 '24 17:01 sefininio

Hello,

I am experiencing a persistent issue with the face scanning process in LibrePhotos. Despite multiple attempts to rectify the situation, the job consistently fails to complete.

Here's a brief overview of my current setup and the problem:

  • Database Size: The database currently spans 3840 days and contains a total of 137,391 photos.
  • Issue: The 'Scan Faces' job begins but does not successfully finish; it keeps stopping prematurely.
  • Logs: Below is an excerpt from the logs indicating the problem:
INFO:ownphotos:HTTPConnectionPool(host='localhost', port=8005): Max retries exceeded with url: /face-locations (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1495a6132e50>: Failed to establish a new connection: [Errno 111] Connection refused'))
ERROR:image e1b97488677cefc9965465d5b50381eb1 - rene_libre_photos - /data/rene/2021/05/20210528_094129.mp4: scan face failed
ERROR: An error occurred: UnboundLocalError: cannot access local variable 'face_locations' where it is not associated with a value

The issue seems to be related to the face recognition service becoming unresponsive, and only a backend restart temporarily resolves the issue. However, given the large volume of assets, the scan faces job seems to break repeatedly without going through the entire dataset.

This problem has been ongoing, it appears the problem persists, and the system cannot handle larger databases efficiently for face recognition tasks.

Any insights or suggestions on how to resolve this would be greatly appreciated.

If i restart the Backend the Backend and rescan for faces it goes down after few hours

Thank you for your attention to this matter. Screenshot_20240404_085216_com android chrome

BoBBer446 avatar Apr 04 '24 07:04 BoBBer446

Same here. Also I am experiencing issue that may be related: In /settings page change the Face Recognition Model then click on Update in the pop-up dialogue. In refreshing the page the change was not persisted and in backend container logs I can see Not Found: /api/user/1/ at the time I click Update I am on 2024w05 with gpu

maciejmatuszak avatar Apr 09 '24 08:04 maciejmatuszak

Switching back to non GPU image got the faces scan completed...

maciejmatuszak avatar Apr 09 '24 08:04 maciejmatuszak