kartoza / docker-geosafe

Geosafe and GeoNode_QGIS-server deployment in docker
5 stars 22 forks source link

Python error while uploading a layer #99

Closed Gustry closed 6 years ago

Gustry commented 6 years ago

I have a python error while I'm uploading a shapefile in GeoNode: screen shot 2017-12-12 at 14 24 52

I could have the log:

[12/Dec/2017 07:43:40] "GET /qgis-server/ogc/?MAP=%2Fusr%2Fsrc%2Fapp%2Fgeonode%2Fqgis_layer%2Froads_SDyHmBN.qgs&LAYER=roads&VERSION=1.3.0&REQUEST=GetCapabilities&SERVICE=WMS HTTP/1.0" 500 59
Start tag expected, '<' not found, line 1, column 1
Traceback (most recent call last):
  File "/usr/src/app/geonode/layers/views.py", line 202, in layer_upload
    metadata_upload_form=form.cleaned_data["metadata_upload_form"])
  File "/usr/src/app/geonode/layers/utils.py", line 546, in file_upload
    defaults=defaults
  File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/modeltranslation/manager.py", line 389, in get_or_create
    return super(MultilingualQuerySet, self).get_or_create(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 407, in get_or_create
    return self._create_object_from_params(lookup, params)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 439, in _create_object_from_params
    obj = self.create(**params)
  File "/usr/local/lib/python2.7/site-packages/modeltranslation/manager.py", line 381, in create
    return super(MultilingualQuerySet, self).create(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 348, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/local/lib/python2.7/site-packages/polymorphic/models.py", line 74, in save
    return super(PolymorphicModel, self).save(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 771, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/src/app/geonode/qgis_server/signals.py", line 298, in qgis_server_post_save
    style_list(instance, internal=False)
  File "/usr/src/app/geonode/qgis_server/helpers.py", line 783, in style_list
    root_xml = etree.fromstring(response.content)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:77721)
  File "src/lxml/parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116658)
  File "src/lxml/parser.pxi", line 1718, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:115308)
  File "src/lxml/parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:109707)
  File "src/lxml/parser.pxi", line 584, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103568)
  File "src/lxml/parser.pxi", line 694, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105222)
  File "src/lxml/parser.pxi", line 624, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:104131)
XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

I thought it was related to .qml (error with XML and QGIS styles according to exception), but even without the .QML and .XML, I'm having the issue. I can replicate with all my shapefiles.

I'm using the ansible script for deployment.

I hope it's not a configuration issue from my side.

gubuntu commented 6 years ago

@NyakudyaA please see if you can replicate this on production and testing and give feedback or close

NyakudyaA commented 6 years ago

Tested and everything works as expected