Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanning faces broken: get() returned more than one Cluster -- it returned 2! #745

Closed
3 tasks done
dankasak opened this issue Feb 7, 2023 · 2 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@dankasak
Copy link

dankasak commented Feb 7, 2023

When Submitting please remove every thing above this line

πŸ› Bug Report

  • πŸ“ I've Included a ZIP file containing my librephotos log files
  • ❌ I have looked for similar issues (including closed ones)
  • 🎬 (If applicable) I've provided pictures or links to videos that clearly demonstrate the issue

πŸ“ Description of issue:

Scanning photos or faces results in a python error:

08:44,180 : face_classify.py : cluster_all_faces : 98 : ERROR : An error occurred
Traceback (most recent call last):
  File "/code/api/face_classify.py", line 84, in cluster_all_faces
    delete_clusters(user)
  File "/code/api/face_classify.py", line 176, in delete_clusters
    unknown_cluster: Cluster = get_unknown_cluster()
  File "/code/api/models/cluster.py", line 52, in get_unknown_cluster
    unknown_cluster: Cluster = Cluster.get_or_create_cluster_by_id(
  File "/code/api/models/cluster.py", line 44, in get_or_create_cluster_by_id
    return Cluster.objects.get_or_create(owner=user, cluster_id=cluster_id)[0]
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 573, in get_or_create
    return self.get(**kwargs), False
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 433, in get
    raise self.model.MultipleObjectsReturned(
api.models.cluster.Cluster.MultipleObjectsReturned: get() returned more than one Cluster -- it returned 2!
2023-02-06 21:12:42,148 : face_classify.py : cluster_all_faces : 98 : ERROR : An error occurred
Traceback (most recent call last):
  File "/code/api/face_classify.py", line 84, in cluster_all_faces
    delete_clusters(user)
  File "/code/api/face_classify.py", line 176, in delete_clusters
    unknown_cluster: Cluster = get_unknown_cluster()
  File "/code/api/models/cluster.py", line 52, in get_unknown_cluster
    unknown_cluster: Cluster = Cluster.get_or_create_cluster_by_id(
  File "/code/api/models/cluster.py", line 44, in get_or_create_cluster_by_id
    return Cluster.objects.get_or_create(owner=user, cluster_id=cluster_id)[0]
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 573, in get_or_create
    return self.get(**kwargs), False
  File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 433, in get
    raise self.model.MultipleObjectsReturned(
api.models.cluster.Cluster.MultipleObjectsReturned: get() returned more than one Cluster -- it returned 2!

πŸ” How can we reproduce it:

Scan photos or faces.

Please provide additional information:

  • πŸ’» Operating system: Linux
  • βš™ Architecture (x86 or ARM): x86
  • πŸ”’ Librephotos version: docker.io/reallibrephotos/librephotos:latest
  • πŸ“Έ Librephotos installation method (Docker, Kubernetes, .deb, etc.): podman with "docker compose"
    • πŸ‹ If Docker or Kubernets, provide docker-compose image tag: No idea. How do I find that? I spent 10 minutes looking.
  • πŸ“ How is you picture library mounted (Local file system (Type), NFS, SMB, etc.): docker mount to local filesystem
  • ☁ If you are virtualizing librephotos, Virtualization platform (Proxmox, Xen, HyperV, etc.): NA
@dankasak dankasak added the bug Something isn't working label Feb 7, 2023
@derneuere
Copy link
Member

Should be fixed now :)

@hieronymousch
Copy link

I still seem to be having this issue with the latest docker image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants