actinia-org / actinia-core

Actinia Core is an open source REST API for scalable, distributed, high performance processing of geographical data that uses mainly GRASS GIS for computational tasks (DOI: https://doi.org/10.5281/zenodo.5879231) | Tutorial: https://actinia-org.github.io/actinia-core/ | Docker: https://hub.docker.com/r/mundialis/actinia-core
https://actinia.mundialis.de/
GNU General Public License v3.0
81 stars 23 forks source link

Character '&' not supported in process description for r.mapcalc" #82

Closed LeGuide closed 3 years ago

LeGuide commented 4 years ago

When using the & operator in r.mapcalc, the process chain is not valid. Example:

{
  "version": "1",
  "list": [
    {
      "id": "r.mapcalc",
      "module": "r.mapcalc",
      "comment": "test the && operator",
      "inputs": [
        {
          "param": "expression",
          "value": "test_raster = if(elev_srtm_30m>10.0 && slope>1.0)"
        }
      ]
    }
  ]
}

Both process_chain_validation_sync as well as processing_async_export result in the error:

 "traceback": [
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/ephemeral_processing.py\", line 1350, in run\n    self._execute()\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/ephemeral_processing_with_export.py\", line 500, in _execute\n    EphemeralProcessing._execute(self)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/ephemeral_processing.py\", line 1221, in _execute\n    skip_permission_check=skip_permission_check)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/ephemeral_processing.py\", line 1254, in _create_temporary_grass_environment_and_process_list\n    skip_permission_check=skip_permission_check)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/ephemeral_processing.py\", line 495, in _validate_process_chain\n    process_list = self.proc_chain_converter.process_chain_to_process_list(self.request_data)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/common/process_chain.py\", line 569, in process_chain_to_process_list\n    return self._process_chain_to_process_list(process_chain)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/common/process_chain.py\", line 629, in _process_chain_to_process_list\n    module = self._create_module_process(process_descr)\n",
      "  File \"/usr/local/lib/python3.7/dist-packages/actinia_core-0.99.2.post0.dev33+g0914d88-py3.7.egg/actinia_core/resources/common/process_chain.py\", line 1001, in _create_module_process\n    \"description for %s\" % module_name)\n"
    ],
    "type": "<class 'actinia_core.resources.common.exceptions.AsyncProcessError'>"
  },
  "http_code": 400,
  "message": "AsyncProcessError:  Character '&' not supported in process description for r.mapcalc",
  "process_chain_list": [],
  "process_log": [],
  "progress": {
    "num_of_steps": 0,
    "step": 0
neteler commented 4 years ago

It seems to happen here:

https://github.com/mundialis/actinia_core/blob/bc3b9c911dc446eb14f304751a7e64f456ec2690/src/actinia_core/resources/common/process_chain.py#L1003