[GeoNode-devel] GeoNode Project: Timeout updates Layer with new ManyToManyField in ResourceBase

Giambattista Mameli mameli.giambattista at gmail.com
Mon Oct 21 09:01:59 PDT 2019


Hi guys,
I developed a custom GeoNode Project implementing a M:M relationship on the
ResourceBase table

Here the steps:

1) model creation of the new table

class DomainArea(models.Model):
    identifier = models.CharField('Domain Area name', max_length=255,
unique=True)
    description = models.TextField(default='')
    gn_description = models.TextField(
        'GeoNode description', default='', null=True)
    is_choice = models.BooleanField(default=True)

    def __unicode__(self):
        return u"{0}".format(self.gn_description)

    class Meta:
        ordering = ("identifier",)
        verbose_name_plural = 'Domain Areas'

2) add the relation between the ResourceBase table and the new created table

        domainarea = models.ManyToManyField(
            DomainArea,
            related_name='resourcebase_domainarea',
            blank=True)
        ResourceBase.add_to_class('domain_area', domainarea)

3) Add the function to handle the new value in the admin panel

admin.site.register(DomainArea)

All the steps work good, Django creates the new table with all the
relationship and I can handle via admin panel both values and associations
between domain areas and Layers/Docs/Maps.

The problem is when I modify these values.

After the first association, all the updates go wrong (timeout, even with a
very long timeout set).

This is the error message:

*******
Traceback:

File
"/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py"
in inner
  41.             response = get_response(request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _legacy_get_response
  249.             response = self._get_response(request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _get_response
  187.                 response = self.process_exception_by_middleware(e,
request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _get_response
  185.                 response = wrapped_callback(request, callback_args,
*callback_kwargs)

File
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in
wrapper
  552.                 return self.admin_site.admin_view(view)(*args,
**kwargs)

File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in
_wrapped_view
  149.                     response = view_func(request, args, *kwargs)

File
"/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py"
in _wrapped_view_func
  57.         response = view_func(request, args, *kwargs)

File "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py"
in inner
  224.             return view(request, args, *kwargs)

File
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in
change_view
  1512.         return self.changeform_view(request, object_id, form_url,
extra_context)

File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in
_wrapper
  67.             return bound_func(*args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in
_wrapped_view
  149.                     response = view_func(request, args, *kwargs)

File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in
bound_func
  63.                 return func.__get__(self, type(self))(*args2,
**kwargs2)

File
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in
changeform_view
  1409.             return self._changeform_view(request, object_id,
form_url, extra_context)

File
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in
_changeform_view
  1449.                 self.save_model(request, new_object, form, not add)

File
"/usr/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in
save_model
  980.         obj.save()

File "/usr/local/lib/python2.7/site-packages/polymorphic/models.py" in save
  83.         return super(PolymorphicModel, self).save(*args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in
save
  808.                        force_update=force_update,
update_fields=update_fields)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in
save_base
  848.                 update_fields=update_fields, raw=raw, using=using,

File "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py"
in send
  193.             for receiver in self._live_receivers(sender)

File "/usr/local/lib/python2.7/site-packages/geonode/decorators.py" in
wrapper
  53.                 return func(*args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/geonode/geoserver/signals.py"
in geoserver_post_save
  85.         producer.geoserver_upload_layer(payload)

File "/usr/local/lib/python2.7/site-packages/geonode/messaging/producer.py"
in sync_if_local_memory
  71.                 worker.run(timeout=broker_socket_timeout)

File "/usr/local/lib/python2.7/site-packages/kombu/mixins.py" in run
  170.                     for _ in self.consume(limit=None, **kwargs):

File "/usr/local/lib/python2.7/site-packages/kombu/mixins.py" in consume
  192.                     conn.drain_events(timeout=safety_interval)

File "/usr/local/lib/python2.7/site-packages/kombu/connection.py" in
drain_events
  315.         return self.transport.drain_events(self.connection, **kwargs)

File
"/usr/local/lib/python2.7/site-packages/kombu/transport/virtual/base.py" in
drain_events
  966.                     raise socket.timeout()
*****

Any help will be greatly appreciated

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20191021/48af86ea/attachment-0001.html>


More information about the geonode-devel mailing list