Getting exit status 4 when running continuation commend

Hi ,

I’m using dynamic config with continuation to trigger dynamic workflow.

Here is an example of my setup conf

version: 2.1

setup: true

orbs:
  continuation: circleci/continuation@0.3.1
  nx: nrwl/nx@1.6.0

docker_node: &docker_node
  docker:
    - image: node-16.13-alpine3.14-build-gyp...
     
dynamic_setup: &dynamic_setup 
  <<: *docker_node
  steps:
    - checkout
    - nx/set-shas:
        allow-on-hold-workflow: false
        error-on-no-successful-workflow: true
        main-branch-name: main
    - run: 
        name: 'Generate dynamic configuration file'
        command: |
          node ./tools/ci/generate-config.js 
    - run:
        name: "Setting continuation paramters"
        command: |
          echo "extra_parameters='{ \"param1\" : \"$PARAM1\", \"param2\" : \"$PARAM2\", \"param3\" : \"$PARAM3\" }'" >> $BASH_ENV
          source $BASH_ENV
          echo $extra_parameters
    - run: 
        name: "Install Jq"
        command: | 
          apk update
          apk add jq
    - continuation/continue:
          parameters: | 
            $extra_parameters
          configuration_path: .circleci/generated_config.yml


jobs:
  setup:
    <<: *dynamic_setup

workflows:
  version: 2
  setup:
    jobs:
      - setup:
          context: required context...

The problem is I am getting the error exit status 4 in the setup workflow in the continuation step.

Notes:

  • I tested the extra_parameters and and it seems to be valid json
  • I also installed all the required packages in my executor
  • I also tried to use the default continuation executor and got the same error

Any idea?

Thanks in advance!

The solution was to write the parameters into a .json file and set the continuation/continue parameters attribute to the json file

version: 2.1

setup: true

orbs:
  continuation: circleci/continuation@0.3.1
  nx: nrwl/nx@1.6.0

docker_node: &docker_node
  docker:
    - image: node-16.13-alpine3.14-build-gyp...
     
dynamic_setup: &dynamic_setup 
  <<: *docker_node
  steps:
    - checkout
    - nx/set-shas:
        allow-on-hold-workflow: false
        error-on-no-successful-workflow: true
        main-branch-name: main
    - run: 
        name: 'Generate dynamic configuration file'
        command: |
          node ./tools/ci/generate-config.js 
    - run:
        name: "Setting continuation paramters"
        command: |
          echo "extra_parameters='{ \"param1\" : \"$PARAM1\", \"param2\" : \"$PARAM2\", \"param3\" : \"$PARAM3\" }'" >> $BASH_ENV
          source $BASH_ENV
           echo "$extra_parameters" >> parameters.json
    - run: 
        name: "Install Jq"
        command: | 
          apk update
          apk add jq
    - continuation/continue:
          parameters: parameters.json
          configuration_path: .circleci/generated_config.yml


jobs:
  setup:
    <<: *dynamic_setup

workflows:
  version: 2
  setup:
    jobs:
      - setup:
          context: required context...

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