Changes between Initial Version and Version 1 of Ticket #29760, comment 9

11/26/19 16:48:17 (3 years ago)
Kurt Wheeler


  • Ticket #29760, comment 9

    initial v1  
    1 I'm getting the same error, while using the `iterator()` method of a queryset:
    2 {{{
    3 Traceback (most recent call last):
    4   File "/usr/local/lib/python3.5/dist-packages/django/db/", line 96, in inner
    5     return func(*args, **kwargs)
    6 psycopg2.OperationalError: cursor "_django_curs_140027036677888_1" does not exist
    7 The above exception was the direct cause of the following exception:
    8 Traceback (most recent call last):
    9   File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/", line 1512, in cursor_iter
    10     for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
    11   File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/", line 1512, in <lambda>
    12     for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
    13   File "/usr/local/lib/python3.5/dist-packages/django/db/", line 96, in inner
    14     return func(*args, **kwargs)
    15   File "/usr/local/lib/python3.5/dist-packages/django/db/", line 89, in __exit__
    16     raise dj_exc_value.with_traceback(traceback) from exc_value
    17   File "/usr/local/lib/python3.5/dist-packages/django/db/", line 96, in inner
    18     return func(*args, **kwargs)
    19 django.db.utils.OperationalError: cursor "_django_curs_140027036677888_1" does not exist
    20 During handling of the above exception, another exception occurred:
    21 Traceback (most recent call last):
    22   File "/home/user/data_refinery_workers/processors/", line 369, in run_pipeline
    23     last_result = processor(last_result)
    24   File "/home/user/data_refinery_workers/processors/", line 241, in _update_caches
    25     for experiment in unique_experiments.iterator():
    26   File "/usr/local/lib/python3.5/dist-packages/django/db/models/", line 341, in _iterator
    27     yield from self._iterable_class(self, chunked_fetch=use_chunked_fetch, chunk_size=chunk_size)
    28   File "/usr/local/lib/python3.5/dist-packages/django/db/models/", line 72, in __iter__
    29     for row in compiler.results_iter(results):
    30   File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/", line 1515, in cursor_iter
    31     cursor.close()
    32 psycopg2.OperationalError: cursor "_django_curs_140027036677888_1" does not exist
    33 }}}
    35 This is the line of code that is causing that error
    37 Any idea why my cursor is disappearing? I don't think I'm doing anything unusual in my code there. The queryset it's iterating over seems to be ~20k records.
    39 The only other thing I can think of that might be non-standard about my configuration is that I have a pg_bouncer instance set up to batch database connections. It seems to do a good job of pretending to be the postgres server itself, but maybe this is a place that it doesn't?
Back to Top