Skip to main content

CGP Errors

The Computational Governance Platform (CGP) works hand in hand with the Provisioning Coordinator, so the way that errors are handled are exactly the same as it. CGP uses both of the error response bodies that the Provisioning Coordinator uses, keeping all its properties including the deprecated ones, so the same considerations have to be made when interacting with CGP.

One thing that is different from the Coordinator (aside from the error categories that will be presented below), is the concept of a failed request. When evaluating a Governance Entity, Evaluation Reports may have a negative outcome that might be considered as a "failed request". However, as the report was created correctly, this is not considered as an error and so the response to the HTTP request will be in the 2xx family. Please refer to each specific API endpoint to understand the responses that CGP might return for each specific case.

Error Categories

For CGP, errors are divided into categories based on the processes it performs. This way, the following categories have been identified, and they're reflected on the error codes you will receive inside the code field of the error:

Computational Governance Platform Categories (CGP)

CGP_ENTITY: Entity errors

Errors that occur during the entity lifecycle. They may relate to both input validation or internal errors.

  • CGP_ENTITY_PARSE_#: Governance entity parsing errors that may occur when processing the information received in the governance entity, like selectors and additional metadata for metrics or policies.
  • CGP_ENTITY_VAL_#: Validation errors regarding the entity itself (field values incompatibility) or its lifecycle (invalid transitions or operations). Often these errors can be fixed by the user themselves by checking why the validation failed and fixing the entity to be compliant with CGP.
  • CGP_ENTITY_GEN_#: Other errors not specifically tied to the validation or the parsing of the entity, like internal errors, not found responses to queries, etc.

CGP_EVAL: Evaluation errors

Errors related to the evaluation of a governance entity on a set of resources, or to the evaluation results pushed to CGP by external evaluations or by passive entities.

  • CGP_EVAL_PARSE_#: Evaluation result parse errors that may be thrown when evaluation results of governance entities with External engines are not compliant with the expected request body format.
  • CGP_EVAL_VAL_#: Validation errors that may occur during the evaluation of governance entities, specially during the handling of evaluation results received from external services that might be correctly formatted but are not valid due to incompatibilities between the entries of the received evaluation results.
  • CGP_EVAL_EXEC_#: Execution errors that occur during the execution of a governance entity. Some of these errors might arise from validations that couldn't be performed at creation time like correct preprocessing and selector values, unsupported resource types, or internal errors raised during execution. It's important to check the details of the error to understand what went wrong, who can fix it (user or platform team member) and how to fix it.
  • CGP_EVAL_CUE_#: Errors specific to Cue engine and validation, which might relate to failed Cue executions due to invalid governance entities, invalid script or internal errors.
  • CGP_EVAL_GEN_#: Other errors not specifically tied to the parsing, validation or execution of the governance entities, like generic internal errors, not found responses to queries, etc.

CGP_RESOURCE: Resource errors

Errors related to the resources evaluated by governance entities. Since resource have their own small lifecycle inside the execution of a governance entity, the applied validations and transformations done on it might fail and these errors handles these failures.

  • CGP_RESOURCE_PARSE_#: Similar to other categories, resource parse errors are thrown when the content of resources can't be parsed, whether because they're not valid YAML resources, the selectors (if defined) refer to nonexistent fields, etc. It's important to check the details of the error to understand what went wrong, who can fix it (user or platform team member) and how to fix it.
  • CGP_RESOURCE_VAL_#: Validation errors that may be thrown by certain engines based on the received set of resources.
  • CGP_RESOURCE_GEN_#: Other errors not specifically tied to the parsing or validation of the to-be evaluated resources, like failed calls to the resource perimeter resolver, generic internal errors, etc.

CGP_RESTYPE: Resource type errors

Resource types define the supported kinds of resources that CGP is configured to handle. These are designated by the platform team, so most of these errors relate to faulty configurations in the platform that the platform team should be able to fix.

  • CGP_RESTYPE_PARSE_#: Parse errors related to the configuration of each resource type defined by the platform team. It's important to check the details of the error to understand what went wrong, and how to fix it.
  • CGP_RESTYPE_GEN_#: Other errors not specifically tied to the parsing of the registered resource types, like generic internal errors, not found responses to queries, etc.

CGP_SCHED: Scheduling errors

Scheduling errors arise from the system used to handle runtime governance entities.

  • CGP_RESTYPE_VAL_#: Validation errors that arrive from invalid job trying to be scheduled. Most of these errors should be analyzed by the platform team.
  • CGP_RESTYPE_GEN_#: Other errors not specifically tied to the parsing of the registered resource types, like generic internal errors, not found responses to queries, etc.

CGP_GEN: General errors

Some errors don't fit into a specific category, either because they are transversal to the CGP, they're too specific for a category, or they are unknown errors not handled by the other categories. There are two categories of generic errors based on the reason of the error: Error based on validating what the user sent as input, or internal system errors. For all of these errors it's important to check the details of the error to understand the specific error instance, what went wrong, who can fix it (user or platform team member) and how to fix it.

  • CGP_GEN_SYS_#: Generic errors
  • CGP_GEN_VAL_#: Generic validation errors