Skip to content

Author.MultipleObjectsReturned in OpenAlex Enrichment #3194

Description

@koutst

Bugfix

Sentry Issue: RESEARCHHUB-BACKEND-4KQ0
Occurrences: 34,649
First Seen: 2026-01-10
Culprit: paper.ingestion.services.openalex_enrichment.OpenAlexEnrichmentService.process_authors

Problem

In openalex_enrichment.py (line 244), update_or_create uses openalex_ids (an ArrayField) as the lookup:

_, created = Author.objects.update_or_create(
    openalex_ids=author_instance.openalex_ids, defaults=defaults
)

Multiple Author records exist with the same openalex_ids array, causing MultipleObjectsReturned when update_or_create internally calls .get().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions