iobis / bioeco-geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
0 stars 1 forks source link

Replace layer upload fails #134

Open pieterprovoost opened 2 years ago

pieterprovoost commented 2 years ago
[pid: 12438|app: 0|req: 111/1398] 193.191.134.2 () {86 vars in 1583 bytes} [Wed May  4 10:04:09 2022] GET /upload/progress => generated 17 bytes in 32 msecs (HTTP/1.1 200) 9 headers in 391 bytes (1 switches on core 0)
Internal Server Error: /layers/geonode:test_dataset/replace
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "./geonode/layers/views.py", line 1286, in layer_replace
    if out['success']:
KeyError: 'success'
[pid: 12441|app: 0|req: 510/1399] 193.191.134.2 () {94 vars in 2014 bytes} [Wed May  4 10:04:09 2022] POST /layers/geonode:test_dataset/replace => generated 7884 bytes in 66 msecs (HTTP/1.1 500) 9 headers in 363 bytes (1 switches on core 0)
pieterprovoost commented 2 years ago
[pid: 75894|app: 0|req: 19/46] 193.191.134.2 () {86 vars in 1612 bytes} [Wed May  4 10:31:50 2022] GET /upload/progress => generated 17 bytes in 18 msecs (HTTP/1.1 200) 8 headers in 302 bytes (1 switches on core 0)
Some error occurred while trying to access the uploaded schema: Please ensure the name is consistent with the file you are trying to replace.
Traceback (most recent call last):
  File "./geonode/layers/utils.py", line 1147, in validate_input_source
    raise Exception(
Exception: Please ensure the name is consistent with the file you are trying to replace.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./geonode/layers/views.py", line 1247, in layer_replace
    saved_layer = file_upload(
  File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "./geonode/layers/utils.py", line 476, in file_upload
    validate_input_source(layer, filename, files, gtype, action_type='replace')
  File "./geonode/layers/utils.py", line 1180, in validate_input_source
    raise Exception(
Exception: Some error occurred while trying to access the uploaded schema: Please ensure the name is consistent with the file you are trying to replace.
{"ogc_backend": "geonode.geoserver", "success": false, "errors": "Some error occurred while trying to access the uploaded schema: Please ensure the name is consistent with the file you are trying to replace."}

After changing the filename:

[pid: 75894|app: 0|req: 33/113] 193.191.134.2 () {86 vars in 1612 bytes} [Wed May  4 10:34:46 2022] GET /upload/progress => generated 17 bytes in 17 msecs (HTTP/1.1 200) 8 headers in 302 bytes (1 switches on core 0)
Some error occurred while trying to access the uploaded schema: The selected Layer does not exists in the catalog.
Traceback (most recent call last):
  File "./geonode/layers/utils.py", line 1168, in validate_input_source
    raise Exception(
Exception: The selected Layer does not exists in the catalog.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./geonode/layers/views.py", line 1247, in layer_replace
    saved_layer = file_upload(
  File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "./geonode/layers/utils.py", line 476, in file_upload
    validate_input_source(layer, filename, files, gtype, action_type='replace')
  File "./geonode/layers/utils.py", line 1180, in validate_input_source
    raise Exception(
Exception: Some error occurred while trying to access the uploaded schema: The selected Layer does not exists in the catalog.
{"ogc_backend": "geonode.geoserver", "success": false, "errors": "Some error occurred while trying to access the uploaded schema: The selected Layer does not exists in the catalog."}
pieterprovoost commented 2 years ago

New error after a container rebuild, this is with a shapefile downloaded from GeoNode and edited in QGIS (removed geometry):

[pid: 283|app: 0|req: 41/279] 178.119.97.51 () {86 vars in 1612 bytes} [Wed May  4 17:41:54 2022] GET /upload/progress => generated 17 bytes in 20 msecs (HTTP/1.1 200) 8 headers in 302 bytes (1 switches on core 0)
Some error occurred while trying to access the uploaded schema: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "./geonode/layers/utils.py", line 1156, in validate_input_source
    elif "geometry" in _ff and _ff["geometry"]["type"]:
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./geonode/layers/views.py", line 1247, in layer_replace
    saved_layer = file_upload(
  File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "./geonode/layers/utils.py", line 476, in file_upload
    validate_input_source(layer, filename, files, gtype, action_type='replace')
  File "./geonode/layers/utils.py", line 1180, in validate_input_source
    raise Exception(
Exception: Some error occurred while trying to access the uploaded schema: 'NoneType' object is not subscriptable
{"ogc_backend": "geonode.geoserver", "success": false, "errors": "Some error occurred while trying to access the uploaded schema: 'NoneType' object is not subscriptable"}