Porter Lint Messages

Porter Lint Messages

exec-100

The exec-100 warning is a message generated by the porter lint command when it detects a potential problem with the use of an embedded Bash script in the exec mixin of a Porter bundle. The exec mixin is a feature of Porter that allows you to run commands on a computer from a porter.yaml manifest file.

The exec-100 warning suggests that it is a best practice to avoid using embedded Bash scripts in exec mixins, and to use scripts instead.

Using embedded Bash scripts can be problematic because they can be difficult to read and understand, and they can also be insecure if they are not written correctly. It’s generally a good idea to avoid using embedded Bash scripts if possible, and to use scripts instead.

To fix the problem indicated by the exec-100 warning, you can try replacing any embedded Bash scripts in your exec mixins with scripts.

You can find more information about best practices for using the exec mixin on the Porter website at the following URL: https://porter.sh(/docs/best-practices/exec-mixin/)#use-scripts.

porter-100

The porter-100 error is a message generated by the porter lint command when it detects when a parameter name has one of the reserved prefixes porter- and porter_.

The porter-100 error suggests that a parameter has been created which uses one of the reserved prefixes.

Using a reserved prefix can be problematic as it can overwrite a predefined parameter resulting in undeterministic behaviour.

To fix the problem indicated by the porter-100 error, you should replace the prefix of any newly defined parameters to not start with “porter”.

You can find more information about parameters in following URL: https://porter.sh/quickstart/parameters/.

porter-101

The porter-101 error suggests that an action uses a parameter that is not available to it.

This is an of a manifest triggering the error (shorten for brevity):

parameters:
  - name: uninstallParam
    type: string
    applyTo:
      - uninstall # Notice the parameter only applies to the uninstall action

install:
  - exec:
      description: "Install Hello World"
      command: ./helpers.sh
      arguments:
        - install
        - "${ bundle.parameters.uninstallParam }"

To fix the problem indicated by the porter-101 error, you should ensure that all parameters used in the action applies to the actions where it is referenced.

You can find more information about applyTo in the following URL: https://porter.sh/docs/bundle/manifest/#parameter-types.

porter-102

The porter-102 error is a message generated by the porter lint command when it detects that multiple dependencies are defined with the same name.

Multiple dependencies with the same name results in undefined behaviour.

To fix the problem, you should name ensure all dependencies have different names.

You can find more information about dependencies in Dependencies.

porter-103

The porter-103 error is a message generated by the porter lint command when it detects that a dependency maps a parameter that is not defined on the dependency bundle.

dependencies:
  requires:
    - name: mysql
      bundle:
        reference: "getporter/mysql:v0.1.0"
      parameters:
        NOT_A_REAL_PARAM: "some value" # This parameter isn't defined on the mysql bundle

Mapping a value to a parameter that doesn’t exist on the dependency bundle results in a failure when the dependency is installed.

To fix the problem, check the dependency bundle for the parameters it actually defines, and correct the name in your parameters mapping.

You can find more information about dependencies in Dependencies.

porter-104

The porter-104 error is the same check as porter-103, but for the credentials mapping of a dependency: it is generated when a dependency maps a credential that is not defined on the dependency bundle.

dependencies:
  requires:
    - name: mysql
      bundle:
        reference: "getporter/mysql:v0.1.0"
      credentials:
        NOT_A_REAL_CRED: "some value" # This credential isn't defined on the mysql bundle

To fix the problem, check the dependency bundle for the credentials it actually defines, and correct the name in your credentials mapping.

You can find more information about dependencies in Dependencies.

porter-105

The porter-105 warning is generated by the porter lint command when it cannot resolve a dependency’s bundle reference, either because the reference is invalid or because it could not be pulled from its cache or registry.

Because the bundle could not be resolved, porter cannot check that its parameters and credentials mappings (porter-103, porter-104) are valid, so that check is skipped for this dependency.

To fix the problem, check that the dependency’s bundle.reference is correct and reachable, for example by running porter pull <reference>.