mitodl / open-discussions

BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

ProgramItem.MultipleObjectsReturned: get() returned more than one ProgramItem -- it returned 2! #2623

Open sentry-io[bot] opened 4 years ago

sentry-io[bot] commented 4 years ago

Sentry Issue: DISCUSSIONS-2D1

ProgramItem.MultipleObjectsReturned: get() returned more than one ProgramItem -- it returned 2!
  File "toolz/functoolz.py", line 781, in __call__
    return self.func(*args, **kwargs)
  File "course_catalog/etl/loaders.py", line 245, in load_program
    defaults={"position": position},
  File "django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "django/db/models/query.py", line 554, in update_or_create
    obj = self.select_for_update().get(**kwargs)
  File "django/db/models/query.py", line 412, in get
    (self.model._meta.object_name, num)

Error loading program
odlbot commented 4 years ago

➤ Peter Pinch commented:

This seems to happen about once a day, but only on CI (or possibly someone's dev environment)