Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

workerにてDBエラー #3

Open
tar-xzvff opened this issue Oct 27, 2018 · 0 comments
Open

workerにてDBエラー #3

tar-xzvff opened this issue Oct 27, 2018 · 0 comments

Comments

@tar-xzvff
Copy link
Contributor

[2018-05-09 10:02:43,844: ERROR/ForkPoolWorker-2] Task terraform_manager.terraform_manager_tasks.direct_apply[4205acf9-2d8e-46cb-ae93-473515e6022c] raised unexpected: InterfaceError('connection already closed',)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
psycopg2.OperationalError: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/pstate/ictsc_prep_school/terraform_manager/terraform_manager_tasks.py", line 221, in direct_apply
    save_log(environment_id, return_code, stdout, stderr)
  File "/pstate/ictsc_prep_school/terraform_manager/terraform_manager_tasks.py", line 306, in save_log
    log = Log(environment=Environment.objects.get(id=environment_id),
  File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 397, in get
    num = len(clone)
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 254, in __len__
    self._fetch_all()
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 1179, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1067, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
    return super().execute(sql, params)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.OperationalError: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 234, in _cursor
    return self._prepare_cursor(self.create_cursor(name))
  File "/usr/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 212, in create_cursor
    cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/pstate/ictsc_prep_school/terraform_manager/terraform_manager_tasks.py", line 237, in direct_apply
    save_log(environment_id, 999, '', traceback.format_exc())
  File "/pstate/ictsc_prep_school/terraform_manager/terraform_manager_tasks.py", line 306, in save_log
    log = Log(environment=Environment.objects.get(id=environment_id),
  File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 397, in get
    num = len(clone)
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 254, in __len__
    self._fetch_all()
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 1179, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1065, in execute_sql
    cursor = self.connection.cursor()
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 255, in cursor
    return self._cursor()
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 234, in _cursor
    return self._prepare_cursor(self.create_cursor(name))
  File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 234, in _cursor
    return self._prepare_cursor(self.create_cursor(name))
  File "/usr/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 212, in create_cursor
    cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 228, in _set_autocommit
    self.connection.autocommit = autocommit
psycopg2.InterfaceError: connection already closed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/celery/app/trace.py", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/celery/app/trace.py", line 629, in __protected_call__
    return self.run(*args, **kwargs)
  File "/pstate/ictsc_prep_school/terraform_manager/terraform_manager_tasks.py", line 242, in direct_apply
    environment.save()
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 729, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 756, in save_base
    with transaction.atomic(using=using, savepoint=False):
  File "/usr/lib/python3.6/site-packages/django/db/transaction.py", line 173, in __enter__
    connection.set_autocommit(False, force_begin_transaction_with_broken_autocommit=True)
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 404, in set_autocommit
    self._set_autocommit(autocommit)
  File "/usr/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 228, in _set_autocommit
    self.connection.autocommit = autocommit
  File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 228, in _set_autocommit
    self.connection.autocommit = autocommit
django.db.utils.InterfaceError: connection already closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant