Skip to content
Latchkey

CircleCI "parameter X is not declared" Error

Parameterized jobs, commands, and executors must declare every parameter they use under a parameters: key before referencing it with << parameters.NAME >>. Using an undeclared parameter fails validation.

What this error means

Config processing fails stating a parameter referenced in a job or command is not declared.

circleci
In job deploy, parameter env is not declared.
Declare it under the parameters key before using << parameters.env >>.

Common causes

Parameter never declared

The reference << parameters.env >> has no matching entry under parameters:.

Declared in the wrong scope

A parameter declared on a command is not visible inside a different job.

Typo between declaration and use

The declared name and the referenced name differ.

How to fix it

Declare the parameter

Add the parameter with a type (and optional default) before referencing it.

.circleci/config.yml
jobs:
  deploy:
    parameters:
      env:
        type: string
        default: staging
    steps:
      - run: ./deploy.sh << parameters.env >>

How to prevent it

  • Declare every parameter under the right scope before use.
  • Match declared and referenced names exactly.
  • Validate parameterized configs with the CircleCI CLI.

Frequently asked questions

What causes ""parameter" not declared"?
The reference << parameters.env >> has no matching entry under parameters:.
How do I fix "parameter" not declared?
Add the parameter with a type (and optional default) before referencing it.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card