5 Validating CNC Console Configuration
A preinstall hook named Validation-hook is introduced for validating M-CNCC Core and A-CNCC Core helm configurations.
Validation hook pod is auto deleted if validation succeeds. In case of failure, pod status is displayed as" Error.
In case of Validation-hook errors, refer to the following error codes:
Table 5-1 Validation-hook Error Codes
Error Code | Error Message Format | Error Scenarios | Sample Error Messages |
---|---|---|---|
1001 | Invalid value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info> |
|
Invalid value. Resource: mCnccIam, ID: Cluster1, Attribute: Port. It should be numeric value. Invalid value. Resource: instance, ID: Cluster3-instance1, Attribute: Scheme. Allowed values are: [http, https]. Invalid value. Resource: instance, ID: Cluster1-grafana##$$%, Attribute: id. Ids should be alphanumeric with hyphen allowed as special character. The count of mCnccIam exceeded max limit. Allowed Value:x. Actual Value: y Max limit exceeded. Allowed Value:x. Actual Value: y Invalid value. Resource: aCncc, ID: Cluster3, Attribute: N/A. Both ip and fqdn cannot be provided. Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: False. isMultiClusterEnabled is set as false, only single cluster configuration is allowed. Verify cncc-iam, mcncc-core, acncc-core configuration values Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: True. isMultiClusterEnabled is set as true, only multi cluster configuration is allowed. Verify cncc-iam, mcncc-core, acncc-core configuration values Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: False. isMultiClusterEnabled is set as false, only single cluster configuration is allowed. Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: True. isMultiClusterEnabled is set as true, only multi cluster configuration is allowed. Invalid value. Resource: DD, ID: Cluster1-dd-instance1, Attribute: N/A. More than one DD instance with same id and type is not allowed Invalid value. Resource: instance, ID: Cluster1-dd-instance1, Attribute: apiPrefix. For type DD valid Api Prefixes: [/ocnadd, /ocnaddapi] |
1002 | Duplicate value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info> |
|
|
1003 | Invalid Reference. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info> |
|
|
1004 | Missing value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info> |
|
|
Validation-hook Microservices and Logs
Validation-hook Microservice for M-CNCC Core
This section explains about Validation-hook Microservice for M-CNCC Core and A-CNCC Core.
NAME READY STATUS RESTARTS AGE
cncc-mcore-ingress-gateway-pre-install-rfpjq 0/1 Completed 0 40s
cncc-mcore-validation-hook-zt78c 0/1 Completed 0 24s
Validation-hook Logs
In case of validation-hook error, check logs for the error details.
NAME READY STATUS RESTARTS AGE
cncc-mcore-validation-hook-zt78c 0/1 Error 0 24s
Example:
kubectl logs -f cncc-mcore-validation-hook-zt78c -n cncc
Sample Validation-hook Logs
{
"instant":{
"epochSecond":1628155229,
"nanoOfSecond":4094479
},
"thread":"main",
"level":"ERROR",
"loggerName":"com.oracle.cgbu.cne.cncc.core.Multi-ClusterConfigValidation",
"message":"{\"type\":null,\"title\":\"Bad Request\",\"status\":400,\"detail\":\"[{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster1-grafana, Attribute: N/A. Both ip and fqdn cannot be provided.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster3-policy-instance, Attribute: Port. It should be numeric value.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1004,\\\"detail\\\":\\\"Missing value. Resource: Instance, ID: Cluster3-grafana, Attribute: apiPrefix. \\\",\\\"instance\\\":null,\\\"cause\\\":null}]\",\"instance\":null,\"cause\":null}",
"endOfBatch":false,
"loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger",
"contextMap":{
},
"threadId":1,
"threadPriority":5,
"messageTimestamp":"2021-08-05T09:20:29.004+0000",
"application":"cncc",
"engineering_version":"1.8.0",
"marketing_version":"1.0.0",
"microservice":"cncc-mcore-validation-hook",
"cluster":"cncc-mcore",
"namespace":"cncc",
"node":"master",
"pod":"cncc-mcore-validation-hook-zt78c"
}
Validation-hook Microservice for A-CNCC Core
NAME READY STATUS RESTARTS AGE
cncc-acore-ingress-gateway-pre-install-rfpjq 0/1 Completed 0 40s
cncc-acore-validation-hook-zt78c 0/1 Completed 0 24s
Validation-hook Logs
In case of validation-hook error, check logs for the error details.
NAME READY STATUS RESTARTS AGE
cncc-acore-validation-hook-zt78c 0/1 Error 0 24s
Example:
kubectl logs -f cncc-acore-validation-hook-zt78c -n cncc
Sample Validation-hook Logs
{
"instant":{
"epochSecond":1628155569,
"nanoOfSecond":4076479
},
"thread":"main",
"level":"ERROR",
"loggerName":"com.oracle.cgbu.cne.cncc.core.Multi-ClusterConfigValidation",
"message":"{\"type\":null,\"title\":\"Bad Request\",\"status\":400,\"detail\":\"[{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster1-grafana, Attribute: N/A. Both ip and fqdn cannot be provided.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster3-policy-instance, Attribute: Port. It should be numeric value.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1004,\\\"detail\\\":\\\"Missing value. Resource: Instance, ID: Cluster3-grafana, Attribute: apiPrefix. \\\",\\\"instance\\\":null,\\\"cause\\\":null}]\",\"instance\":null,\"cause\":null}",
"endOfBatch":false,
"loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger",
"contextMap":{
},
"threadId":1,
"threadPriority":5,
"messageTimestamp":"2021-08-05T09:20:29.004+0000",
"application":"cncc",
"engineering_version":"1.8.0",
"marketing_version":"1.0.0",
"microservice":"cncc-acore-validation-hook",
"cluster":"cncc-acore",
"namespace":"cncc",
"node":"master",
"pod":"cncc-acore-validation-hook-zt78c"
}