"Conflicting pipeline parameters." at continuation step when pipeline is triggered via curl

I am working on updating the config on our monorepo using dynamic config and a custom orb based on the existing path-filtering. It works great until I try to trigger the pipeline via curl, I get a Conflicting pipeline parameters as a response from the continuation API call, which doesn’t happen if I default the same parameter to true on the config itself. I’ll be sharing a shortened version of my config here

version: 2.1

setup: true

parameters:
  run-webshop:
    type: boolean
    default: false
  run-docs:
    type: boolean
    default: false
  force-workflows:
    type: boolean
    default: false


workflows:
  setup:
    jobs:
      - path-filtering/filter:
          force-workflows: << pipeline.parameters.force-workflows >>
          mapping: |
            ^((?!docs/).)*$ run-webshop false
            docs/.* run-docs true

orbs:
  path-filtering:
    orbs:
      continuation: circleci/continuation@0.2.0
    commands:
      set-parameters:
        parameters:
          force-workflows:
            default: false
            type: boolean
          mapping:
            default: ""
            type: string
        steps:
          - run:
              command: # very similar to path-filtering that skips filtering if force-workflows is true and set this parameter on json file
              environment:
                MAPPING: << parameters.mapping >>
                OUTPUT_PATH: /tmp/pipeline-parameters.json
                FORCE_WORKFLOWS: << parameters.force-workflows >>
              name: Set parameters
              shell: /usr/bin/env python3
    executors:
      default:
        docker:
          - image: cimg/python:3.8
    jobs:
      filter:
        executor: default
        parameters:
          force-workflows:
            default: false
            type: boolean
          mapping:
            default: ""
            type: string
        resource_class: small
        steps:
          - checkout
          - set-parameters:
              mapping: << parameters.mapping >>
              force-workflows: << parameters.force-workflows >>
          - continuation/continue:
              configuration_path: .circleci/continue_config.yml
              parameters: /tmp/pipeline-parameters.json

Since the continuation works if force-workflows is set to true by default and only fails via curl, I’d like to know if there’s something missing in my curl for me to receive this response. Can’t find another issue with the same error message.

 curl -X POST --url https://circleci.com/api/v2/project/gh/<Organization>/<repository>/pipeline\
  --header "Circle-Token: <token>" \
  --header "content-type: application/json" \
    --data '{"branch":"'$(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3,4)'","parameters":{"force-workflows":true}}'

Thanks!

The “Conflicting pipeline parameters” error can occur when:

  1. you have some pipeline parameters declared both on the setup config (typically the .circleci/config.yml) and the generated / continuing config.

In the case above, i believe run-docs and run-webshop are pipeline parameters also declared in the generated / continuing config.

In any case, it does appear for your _.circleci/config.yml that the run-docs and run-webshop pipeline parameters are not used.

There are two workarounds I can think of to get rid of this error:

1. Remove the pipeline parameter definitions in config.yml for run-webshop and run-docs

I did not see pipeline.parameters.run-webshop or pipeline.parameters.run-docs being used in config.yml. If you are not planning to pass these values in via the API or consume them inside of config.yml, I feel it is fine to delete them.

2. Rename run-webshop and run-docs to something else

Due to the conflict in naming, simply changing the names to something like run-webshop-api and run-docs-api would resolve the error. Then if you use these in the config.yml file, you could reference them like this:

  • << pipeline.parameters.run-webshop-api >>
  • << pipeline.parameters.run-docs-api >>
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.