[GeoNode-users] ERROR:An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

Ariel Neri ariel.neriw at gmail.com
Wed Aug 2 12:27:58 PDT 2017


Hi, I had this error while running "updatelayers" command (only if there
are layers from remote-store in geoserver)
And some users reported to have same error while uploading or deleting
layers.

Here´s the traceback:


TransactionManagementError at /admin/layers/layer/

An error occurred in the current transaction. You can't execute
queries until the end of the 'atomic' block.

Request Method: POST
Request URL: http://192.168.0.56/admin/layers/layer/
Django Version: 1.8.7
Exception Type: TransactionManagementError
Exception Value:

An error occurred in the current transaction. You can't execute
queries until the end of the 'atomic' block.

Exception Location:
/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py
in validate_no_broken_transaction, line 327
Python Executable: /usr/bin/python
Python Version: 2.7.12
Python Path:

['/home/geonode/my_geonode',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/var/www']

Server time: Mié, 2 Ago 2017 14:25:16 -0500
Traceback Switch to copy-and-paste view
<http://192.168.0.56/admin/layers/layer/#>

   - /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in
   get_response
   1.

                                      response =
wrapped_callback(request, *callback_args, **callback_kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py
    in wrapper
   1.

                                  return
self.admin_site.admin_view(view)(*args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
   _wrapped_view
   1.

                                      response = view_func(request,
*args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
    in _wrapped_view_func
   1.

                          response = view_func(request, *args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
    in inner
   1.

                              return view(request, *args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
   _wrapper
   1.

                              return bound_func(*args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
   _wrapped_view
   1.

                                      response = view_func(request,
*args, **kwargs)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
   bound_func
   1.

                                  return func.__get__(self,
type(self))(*args2, **kwargs2)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py
    in changelist_view
   1.

                                  response =
self.response_action(request, queryset=cl.get_queryset(request))

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py
    in response_action
   1.

                              response = func(self, request, queryset)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/actions.py
    in delete_selected
   1.

                              queryset.delete()

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/models/query.py in
   delete
   1.

                          collector.delete()

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/models/deletion.py in
   delete
   1.

                                  query.delete_batch(pk_list, self.using)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   -
   /usr/local/lib/python2.7/dist-packages/django/db/models/sql/subqueries.py
    in delete_batch
   1.

                              self.do_query(self.get_meta().db_table,
self.where, using=using)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   -
   /usr/local/lib/python2.7/dist-packages/django/db/models/sql/subqueries.py
    in do_query
   1.

                          self.get_compiler(using).execute_sql(NO_RESULTS)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py
    in execute_sql
   1.

                              cursor.execute(sql, params)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py in
   execute
   1.

                              return super(CursorDebugWrapper,
self).execute(sql, params)

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py in
   execute
   1.

                          self.db.validate_no_broken_transaction()

      ...
   ▶ Local vars <http://192.168.0.56/admin/layers/layer/#>
   - /usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py
    in validate_no_broken_transaction
   1.

              if self.in_atomic_block:

      2.

                  raise TransactionManagementError(

      3.

                      "This is forbidden when an 'atomic' block is active.")

      4.

      5.

          def validate_no_broken_transaction(self):

      6.

              if self.needs_rollback:

      7.

                  raise TransactionManagementError(

      1.

                                  "An error occurred in the current
transaction. You can't "

      ...
   1.

                      "execute queries until the end of the 'atomic' block.")

      2.

      3.

          # ##### Foreign key constraints checks handling #####

      4.

      5.

          @contextmanager

      6.

          def constraint_checks_disabled(self):

      ▼ Local vars <http://192.168.0.56/admin/layers/layer/#>
   VariableValue
   self

   <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object
at 0x7f5b086ae0d0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170802/b8e44c7a/attachment-0001.html>


More information about the geonode-users mailing list