actinia-core icon indicating copy to clipboard operation
actinia-core copied to clipboard

Vector info bug

Open anikaweinmann opened this issue 2 years ago • 2 comments

If a vector has no database connection because it has no tabel, actinia returns an error by requesting the information of the vector map:

# test_random_vect created with e.g. grass grassdb/nc_spm_08/PERMANENT/ --exec v.random output=test_random_vect npoints=10

curl -u ${AUTH} ${URL}/locations/nc_spm_08/mapsets/PERMANENT/vector_layers/test_random_vect | jq
{
    ....
    {
      "executable": "v.info",
      "id": "2",
      "mapset_size": 375,
      "parameter": [
        "map=test_random_vect@PERMANENT",
        "-h"
      ],
      "return_code": 0,
      "run_time": 0.10043096542358398,
      "stderr": [
        ""
      ],
      "stdout": "COMMAND: v.random output=\"test_random_vect\" npoints=10 layer=\"-1\" zmin=0.0 zmax=0.0 column_type=\"double precision\"\nGISDBASE: /home/user/actinia/grassdb\nLOCATION: nc_spm_08 MAPSET: PERMANENT USER: user DATE: Wed Jul 20 12:05:35 2022\n"
    },
    {
      "executable": "v.info",
      "id": "3",
      "mapset_size": 375,
      "parameter": [
        "map=test_random_vect@PERMANENT",
        "-c"
      ],
      "return_code": 1,
      "run_time": 0.10044598579406738,
      "stderr": [
        "ERROR: Database connection for map <test_random_vect@PERMANENT> is not defined in DB file",
        ""
      ],
      "stdout": ""
    }
  ],
  "progress": {
    "num_of_steps": 3,
    "step": 3
  },
  "resource_id": "resource_id-9feaee6d-8abf-4253-8437-6a5ee2556d0d",
  "status": "error",
  "time_delta": 0.4676177501678467,
  "timestamp": 1658318803.6137428,
  "urls": {
    "resources": [],
    "status": "http://...:8088/api/v3/resources/actinia-gdi/resource_id-9feaee6d-8abf-4253-8437-6a5ee2556d0d"
  },
  "user_id": "actinia-gdi"
}

The endpoint should not return an error if no table is set for the vector map.

anikaweinmann avatar Jul 20 '22 12:07 anikaweinmann

New pull request: #408 (old one #364 )

linakrisztian avatar Jan 16 '23 16:01 linakrisztian

tbd:

  • fix test-failure (see todos in #408 )
  • update documentation (https://github.com/actinia-org/actinia-api/pull/13)

linakrisztian avatar Jan 16 '23 16:01 linakrisztian