[GeoNode-users] Api layers error

Andres Juarez albertoandres.juarez at gmail.com
Tue Aug 3 08:24:15 PDT 2021


Hello everyone
We have Geonode 3.0 installed on Ubuntu 20.04 (not docker), and it was
working fine until a few days ago, when a problem came up in the layers
section, it does not show any layers in the listing, unless we order them
in some way different from the default.

The error that the log shows is the following:

Internal Server Error: /api/layers/
Traceback (most recent call last):
  File
"/home/geonode/.virtualenvs/geonode/lib/python3.6/site-packages/tastypie/resources.py",
line 227, in wrapper
    response = callback(request, *args, **kwargs)
  File
"/home/geonode/.virtualenvs/geonode/lib/python3.6/site-packages/tastypie/resources.py",
line 467, in dispatch_list
    return self.dispatch('list', request, **kwargs)
  File
"/home/geonode/.virtualenvs/geonode/lib/python3.6/site-packages/tastypie/resources.py",
line 499, in dispatch
    response = method(request, **kwargs)
  File "./geonode/api/resourcebase_api.py", line 595, in get_list
    request, to_be_serialized, response_objects=objects)
  File "./geonode/api/resourcebase_api.py", line 663, in create_response
    data['objects'])) if x['id'] in filtered_objects_ids]
  File "./geonode/api/resourcebase_api.py", line 800, in format_objects
    formatted_obj['gtype'] = self.dehydrate_gtype(bundle)
  File "./geonode/api/resourcebase_api.py", line 839, in dehydrate_gtype
    return bundle.obj.gtype
  File "./geonode/layers/models.py", line 266, in gtype
    return
self.attribute_set.get(attribute='the_geom').attribute_type[4:-12]
  File
"/home/geonode/.virtualenvs/geonode/lib/python3.6/site-packages/django/db/models/manager.py",
line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File
"/home/geonode/.virtualenvs/geonode/lib/python3.6/site-packages/django/db/models/query.py",
line 412, in get
    (self.model._meta.object_name, num)
geonode.layers.models.Attribute.MultipleObjectsReturned: get() returned
more than one Attribute -- it returned 2!
Internal Server Error: /api/layers/

Can someone help me with this? what can i do to fix it?
Thanks in advance. Greetings
-- 
   Andrés Juarez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20210803/b2139083/attachment.html>


More information about the geonode-users mailing list