[Django] #29297: Exception ignored in: <generator object SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>

262 views
Skip to first unread message

Django

unread,
Apr 7, 2018, 7:54:49 AM4/7/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-----------------------------------------+------------------------
Reporter: kingctan | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
if all(self.query.alias_refcount[a] == 0 for a in
self.query.alias_map):
SystemError: error return without exception set
Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
if all(self.query.alias_refcount[a] == 0 for a in
self.query.alias_map):
SystemError: error return without exception set

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

Django

unread,
Apr 7, 2018, 8:34:41 AM4/7/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:

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 Tim Graham):

* type: Uncategorized => Bug
* component: Uncategorized => Database layer (models, ORM)


Old description:

> Exception ignored in: <generator object
> SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
> Traceback (most recent call last):
> File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
> packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
> if all(self.query.alias_refcount[a] == 0 for a in
> self.query.alias_map):
> SystemError: error return without exception set
> Exception ignored in: <generator object
> SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
> Traceback (most recent call last):
> File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
> packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
> if all(self.query.alias_refcount[a] == 0 for a in
> self.query.alias_map):
> SystemError: error return without exception set

New description:

{{{


Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
if all(self.query.alias_refcount[a] == 0 for a in
self.query.alias_map):
SystemError: error return without exception set
Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
if all(self.query.alias_refcount[a] == 0 for a in
self.query.alias_map):
SystemError: error return without exception set
}}}

--

Comment:

What are the steps to reproduce the issue?

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:1>

Django

unread,
Apr 7, 2018, 2:05:24 PM4/7/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(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 Tim Graham):

* status: new => closed
* resolution: => needsinfo


Old description:

> {{{


> Exception ignored in: <generator object
> SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
> Traceback (most recent call last):
> File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
> packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
> if all(self.query.alias_refcount[a] == 0 for a in
> self.query.alias_map):
> SystemError: error return without exception set
> Exception ignored in: <generator object
> SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
> Traceback (most recent call last):
> File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
> packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
> if all(self.query.alias_refcount[a] == 0 for a in
> self.query.alias_map):
> SystemError: error return without exception set
> }}}

New description:

{{{


Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-
packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
if all(self.query.alias_refcount[a] == 0 for a in
self.query.alias_map):
SystemError: error return without exception set
}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:2>

Django

unread,
May 11, 2018, 12:51:48 PM5/11/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
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 Shaheed Haque):

* status: closed => new
* resolution: needsinfo =>


Comment:

I'm seeing the same issue with Django 2.0.5. Unfortunately, I'm not able
to identify a precise cause, but it *might* be load related. Here is a
scenario in which I see it:

1. I have a moderately complex Django app (using amongst other things:
Jinja templates, Celery, Viewflow, django-polymorphic)
2. I run up the test suite. This includes django-webtest and selenium-
based tests which (amongst other things) exercises both the admin and non-
admin pages.
3. I run the app under the PyCharm debug environment.
4. Some - variable - number of the tests run clean in that the console
records HTTP traffic as expected.
5. After a while, I start to see some combination of the above exception
and this one:

{{{


Exception ignored in: <generator object

_salt_cipher_secret.<locals>.<genexpr> at 0x7f803ac785c8>


Traceback (most recent call last):

File "/usr/local/lib/python3.6/dist-packages/django/middleware/csrf.py",
line 51, in <genexpr>
pairs = zip((chars.index(x) for x in secret), (chars.index(x) for x in
salt))


SystemError: error return without exception set
}}}

6. The frequency of the exceptions seems to increase, and the
responsiveness of Django decreases. For example, a 400s test run takes
800s.

If I rerun the tests without restarting Django, the exceptions start
immediately. If I restart Django, the tests start clean again and slowly
degrade as before. It *is* possible that there is some memory pressure on
my Ubuntu Bionic system, but top rarely shows less than abut 800MB free,
with about 2GB in buffer cache so this might be a red herring.

FWIW, the problem is also present in 2.0.2.

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:3>

Django

unread,
May 11, 2018, 5:29:12 PM5/11/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(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):

* status: new => closed
* resolution: => needsinfo


Comment:

Hello Shaheed,

Unfortunately I'm afraid there isn't much we can do as nothing seems to
indicate Django is the culprit. We'd need a simplified and reproducible
test case to figure out whether or not it's something that should be fixed
in Django and not in order of the many libraries your are using.

Errors like `SystemError('error return without exception set')` are
usually raised when an issue happens internally in C land (CPython, C
library interfaced with Python bindings) which support the thesis that it
has little to do with Django.

From the `SystemError`'s
[https://docs.python.org/3/library/exceptions.html?highlight=systemerror#SystemError
documentation]

> Raised when the interpreter finds an internal error, but the situation
does not look so serious to cause it to abandon all hope. The associated
value is a string indicating what went wrong (in low-level terms).
>
> You should report this to the author or maintainer of your Python
interpreter. Be sure to report the version of the Python interpreter
(sys.version; it is also printed at the start of an interactive Python
session), the exact error message (the exception’s associated value) and
if possible the source of the program that triggered the error.

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:4>

Django

unread,
May 14, 2018, 11:17:59 AM5/14/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(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
-------------------------------------+-------------------------------------

Comment (by Shaheed Haque):

I see, thanks.

I've Google'd around, and see other references to the contract of th C API
being broken. Sadly, I don't see any obvious way to narrow down the
cuplrit short of strace.

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:5>

Django

unread,
May 15, 2018, 1:32:46 PM5/15/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(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
-------------------------------------+-------------------------------------

Comment (by Shaheed Haque):

One observation is that when I run the server WITHOUT the PyCharm
debugger, these errors seem not to occur.

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:6>

Django

unread,
Jun 8, 2018, 2:19:54 PM6/8/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(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
-------------------------------------+-------------------------------------

Comment (by Rubi Mazaki):

Had the same issue too. I am accessing db through multiple threads (via
APScheduler) and got the very same "ignored exception" as described above.

YET, Seems it is a PyCharm debugger issue. I followed the link given
above: [https://youtrack.jetbrains.com/issue/PY-30036]

Setting the evironment variable PYDEVD_USE_FRAME_EVAL=NO to the debug
configuration of pycharm **Fixed It!

--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:7>

Django

unread,
Jun 8, 2018, 2:20:19 PM6/8/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution: fixed

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 Rubi Mazaki):

* resolution: needsinfo => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/29297#comment:8>

Django

unread,
Jun 8, 2018, 8:00:46 PM6/8/18
to django-...@googlegroups.com
#29297: Exception ignored in: <generator object
SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
-------------------------------------+-------------------------------------
Reporter: kingctan | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution: invalid

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 Tim Graham):

* resolution: needsinfo => invalid

Reply all
Reply to author
Forward
0 new messages