#33282: django.db.utils.ProgrammingError: more than one row returned by a 
subquery
used as an expression
-------------------------------------+-------------------------------------
     Reporter:  Antonio Terceiro     |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * cc: Simon Charette (added)
 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 The issue seems related an attempt at doing a `GROUP BY` by a subquery
 that returns more than one row. See the `GROUP BY V0."hostname", (SELECT
 U0."name" FROM "lava_scheduler_app_devicetype" ...)` part.

 The `Q(actual_device__isnull=False, actual_device__in=accessible_devices)`
 lookup in `RestrictedTestJobQuerySet.accessible_by_user` is causing that
 somehow, and I assume `Device.objects.accessible_by_user` is the culprit
 as it must do a subquery annotation somehow that is not limited to one
 row.

 By giving a cursory look at your code base I couldn't identify the origin
 of the subquery annotation so I'll close with ''needsinfo'' for now but
 please re-open if you can create a minimal test case as I'll be monitoring
 this issue.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33282#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.37c092a2ec419dd1387d2f896f0f02d9%40djangoproject.com.

Reply via email to