dlr-eoc / prosEO

prosEO – A Processing System for Earth Observation Data
GNU General Public License v3.0
14 stars 1 forks source link

CLI - processor update/create/delete #43

Closed emelchinger closed 4 years ago

emelchinger commented 4 years ago

The processor was created by command processor create --file=PTM_PTML2_0.1.0.json

Now there was the intention to change an attribute, but these comannds failed: prosEO> processor update --file=PTM_PTML1B_0.1.0.json (E2806) Command failed (cause: org.springframework.web.client.HttpClientErrorException: 500 )

prosEO> processor create --file=PTM_PTML2_0.1.0.json Checking for missing mandatory attributes ... (E2806) Command failed (cause: (E2810) HTTP request failed (cause: 500 ); nested exception is org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 )

prosEO> processor delete PTML2 0.1.0 (E2988) Deletion of processor PTML2 with version 0.1.0 failed (cause: 199 proseo-processor-mgr could not execute statement; SQL [n/a]; constraint [fkloteyhnalc56x161f4inujyt5]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement)

The log of processor-mgr is attached. proc-mgr.log

emelchinger commented 4 years ago

Json file attached

PTM_PTML2_0.1.0.json.txt

tangobravo62 commented 4 years ago

Fixed updating processors:

prosEO> processor update --file=PTM_PTML2_0.1.0.json
(I2983) Processor with database ID 16 updated (new version 2)

prosEO> processor show PTML2 0.1.0
---
- id: 16
  version: 2
  missionCode: "PTM"
  processorName: "PTML2"
  processorVersion: "0.1.0"
  [...]
  dockerImage: "proseo-sample-integration-processor:0.0.1-SNAPSHOT"
  dockerRunParameters: []

Fixed error reporting for invalid deletion attempts:

prosEO> processor delete PTML2 0.1.0
(E2806) Command failed (cause: 199 proseo-processor-mgr (E2266) Processor for mission PTM with processor name PTML2 and processor version 0.1.0 cannot be deleted, because it has configured processors)
prosEO> configuration delete PTML2 OPER_2020-03-25
(E2806) Command failed (cause: 199 proseo-processor-mgr (E2317) Configuration for mission PTM with processor name PTML2 and configuration version OPER_2020-03-25 cannot be deleted, because it has configured processors)
prosEO> processor class delete PTML2
(E2806) Command failed (cause: 199 proseo-processor-mgr (E2217) Processor class for mission PTM and processor name PTML2 cannot be deleted, because it has processor versions)
prosEO> productclass delete PTM_L2A
(E2806) Command failed (cause: 199 proseo-productclass-mgr (E2146) Product class for mission PTM with product type PTM_L2A cannot be deleted, because it is referenced by a processor class)

Fixed error reporting for object creation with duplicate keys:

prosEO> productclass create --file=testfiles/PTM_L1B_______.json
Checking for missing mandatory attributes ...
(E2860) Product class data invalid (cause: 400 199 proseo-productclass-mgr (E2112) Product class L1B_______ already exists for mission PTM)
prosEO> processor create --file=testfiles/PTM_PTML1B_0.1.0.json
Checking for missing mandatory attributes ...
(E2987) Processor data invalid (cause: 400 199 proseo-processor-mgr (E2264) Duplicate processor for mission PTM, processor name PTML1B and processor version 0.1.0)
prosEO> processor class create --file=testfiles/PTM_PTML1B.json
Checking for missing mandatory attributes ...
(E2986) Processor class data invalid (cause: 400 199 proseo-processor-mgr (E2216) Duplicate processor class for mission PTM and processor name PTML1B)
prosEO> configuration create --file=testfiles/PTM_PTML1B_conf_OPER_2020-03-25.json
Checking for missing mandatory attributes ...
(E2990) Configuration data invalid (cause: 400 199 proseo-processor-mgr (E2315) Duplicate configuration for mission PTM with processor name PTML1B and configuration version OPER_2020-03-25)
prosEO> processor configuration create PTML1B_0.1.0_OPER_2020-03-25 PTML1B 0.1.0 OPER_2020-03-25
Checking for missing mandatory attributes ...
(E2890) Configuration data invalid (cause: 400 199 proseo-processor-mgr (E2365) Duplicate configured processor identifier PTML1B_0.1.0_OPER_2020-03-25)

@emelchinger Please verify and close if OK

tangobravo62 commented 4 years ago

Tested and OK.