Packaging SDK Errors
Troubleshoot specific errors raised from the Packaging SDK tool operating against your Great Bear Application Package (GBAP).
GBAP Validation Errors
The in-line validation error messages of the tool seek to provide sufficient insight to resolve the related error. This document augments specific error messages with examples to help understand and resolve the source error.
Great Bear Application Metadata Errors
The packaging SDK tool uses schema definition to parse and validate the gbear/appmetadata.yaml file within a GBAP.
Validation Errors
Selected errors to augment the in-line validation error with more detail and examples
-
Error:
The icon field must specify a valid http or https URL
The icon field should specify a parsable http or https string, which resolves to either a png or svg file. Valid examples:
- http://www.example.com/icon.png
- https://www.example.com/icon.svg
- https://www.example.com/icon.svg?text=test
Note: The tool doesn’t attempt to download the URL.
Application Configuration Items
The configuration property contains a list of configuration items related to application deployment parameters. The tool validates each configuration item and outputs error messages annotated with the line number of the configuration item which contains the specified error.
Application Configuration Runtime Item Error
The Runtime configuration item type contains a value field which is interpreted as a Go Lang text template. The tool validates that the specified value is a syntactically correct text template, and that it contains substitutions which are semantically supported by the GB platform.
-
Error:
[Line 53] The configuration item contains an invalid Runtime value format (Error: there are no template substitutions in the value).
This specific error means that the configuration item declared at line 53 has a Runtime value which doesn’t contain a valid template syntax with substitutes. For example, the following configuration within a GBAP
gbear/appmetadata.yaml
will cause this error:52 configuration: 53 - name: RUNTIME_1 54 type: Runtime 55 value: 'no value substitutions or functions'
Valid Example 1:
configuration: - name: RUNTIME_1 type: Runtime value: '{{ .GB_SITE_ID }}' # template syntax containing a substitution syntax for a supported GB runtime variable.
Valid Example 2:
configuration: - name: RUNTIME_1 type: Runtime value: '{{ randInt 0 100 }}' # template syntax containing a substitution syntax using a supported function
-
Error:
[Line 60] The configuration item contains an invalid Runtime value format (Error: unclosed definition).
This specific error means that the configuration item declared at line 60 has a Runtime value which contains invalid template syntax, a declared substitution has not been closed. For example, the following configuration within a GBAP
gbear/appmetadata.yaml
will cause this error:59 configuration: 60 - name: RUNTIME_1 61 type: Runtime 62 value: 'Invalid format {{ .GB_SITE_NAME }} {{.GB_SITE_ID'
Corrected example:
configuration: - name: RUNTIME_1 type: Runtime value: 'Invalid format {{ .GB_SITE_NAME }} {{.GB_SITE_ID }}'
-
Error:
[Line 65] The configuration item contains an invalid Runtime value format (Error: function \"myFunc\" not defined).
This specific error means that the configuration item declared at line 60 has a Runtime value which contains a specified template function which is not supported by the GB platform. (See list of supported functions). For example, the following configuration within a GBAP
gbear/appmetadata.yaml
will cause this error:64 configuration: 65 - name: RUNTIME_1 66 type: Runtime 67 value: 'Invalid func {{ .GB_SITE_NAME | myFunc }}'
Corrected example:
configuration: - name: RUNTIME_1 type: Runtime value: 'Invalid format {{ .GB_SITE_NAME | b64enc }} ' # b64enc is a supported function
-
Error:
[Line 53] The configuration item contains an invalid Runtime value format ({{.GB_ID}} variable doesn't exist, choose one of GB_NODE_IDS, GB_NODE_NAMES, GB_SITE_ID, GB_SITE_NAME).
This specific error means that the runtime value contains a substituted variable which is not supported by the GB platform. A substitution variable must be either:
- A common GB runtime variable: GB_NODE_IDS, GB_NODE_NAMES, GB_SITE_ID, GB_SITE_NAME
- Another configuration item name specified in your configuration items list
For example, For example, the following configuration within a GBAP
gbear/appmetadata.yaml
will cause this error:52 configuration: 53 - name: RUNTIME_1 54 type: Runtime 55 value: 'Invalid {{ .GB_ID }} value' # GB_ID is not known to GB
Corrected Example:
configuration: configuration: - name: NAME_1 type: String title: "Enter your name" - name: RUNTIME_1 type: Runtime value: 'Invalid {{ .NAME_1 }} {{ .GB_SITE_ID }} value' # NAME_1 is defined in your config, GB_SITE_ID is a valid GB platform variable
GBAP Publishing Errors
The SDK tool performs a validation step before attempting to publish a GBAP, common errors of this step are described in the Validation Errors section.
Publishing a valid GBAP may encounter errors when connecting to the Great Bear platform API. The errors shown in the following sections are the result of running the gbear app publish myGBAPPath/
command.
Invalid host URL
Example error:
Validating Package: myGBAPPath/
-- Validating Application Metadata...
-- Validating Chart Dependencies...
***
-- Validating Kubernetes Resource Labels...
Validation Complete:
Application Metadata: Passed (Errors: 0, Warnings: 0)
Chart Dependencies: Passed (Errors: 0, Warnings: 0)
Kubernetes Resource Labels: Passed (Errors: 0, Warnings: 0)
Building Package Archive File...
Publishing Package Archive File: myGBAPPath/my-app-0.0.1.tgz
-- ERROR: Post "https://gbear.io/api/v1/applications": .... no such host
Error: failed to publish the package to the Great Bear platform
Solution:
Check the SDK tool config file $HOME/.config/gbear/config.yaml in your editor of choice. For example, run cat $HOME/.config/gbear/config.yaml
Ensure the host field is set to https://api.greatbear.io/api:
# Great Bear API endpoint to use (overridden by $GBEAR_HOST, defaults to https://api.greatbear.io/api)
host: https://api.greatbear.io/api
login:
# apiKey is the API token that you can copy from the dashboard (overridden by $GBEAR_API_KEY)
apiKey: <your api key>
If these steps do not help resolve your issue, then please contact the Great Bear administrator of your organization, or the Great Bear Support Team.
Invalid API Key
Example error:
Validating Package: myGBAPPath/
-- Validating Application Metadata...
-- Validating Chart Dependencies...
***
-- Validating Kubernetes Resource Labels...
Validation Complete:
Application Metadata: Passed (Errors: 0, Warnings: 0)
Chart Dependencies: Passed (Errors: 0, Warnings: 0)
Kubernetes Resource Labels: Passed (Errors: 0, Warnings: 0)
Publishing Package Archive File: myGBAPPath/my-app-0.0.1.tgz
Publish Status: Failed - run `gbear login` to verify your registered API key
Error: failed to publish the package to the Great Bear platform. If the problem persists, please contact the Great Bear Support Team: great-bear-support@cisco.com
This means that your configured API Key is not known by the Great Bear server.
Solution:
Repeat the gbear login command and retry to publish.
If these steps do not help resolve your issue, then please contact the Great Bear administrator of your organization, or the Great Bear Support Team.
GBAP Conflict Error
Example Error:
Validating Package: myGBAPPath/
-- Validating Application Metadata...
-- Validating Chart Dependencies...
***
-- Validating Kubernetes Resource Labels...
Validation Complete:
Application Metadata: Passed (Errors: 0, Warnings: 0)
Chart Dependencies: Passed (Errors: 0, Warnings: 0)
Kubernetes Resource Labels: Passed (Errors: 0, Warnings: 0)
Building Package Archive File...
Publishing Package Archive File: myGBAPPath/my-app-0.0.1.tgz
Publish Status: Failed - 409 Conflict
Error: failed to publish the package to the Great Bear platform
This means that the GBAP version you are attempting to publish already exists in the Great Bear Application Store. A conflict error is encountered because published package versions are immutable.
Solution:
Follow the procedure to update an existing package application.
If these steps do not help resolve your issue, then please contact the Great Bear administrator of your organization, or the Great Bear Support Team.