Config file fails with non matching error log

Hello there!

I’m currently changing our CCI setup to be triggered by a GitHub Action, so that we can exclude system tests from PRs that don’t need them. For this I am using the default GitHub Action from circleCi, and have adapted our config.yml for circle ci to only run when triggered by the action itself.

According to the documentation, I can do this:

workflows:
  project_cicd:
    when:
      and:
        - equal: ["default", << pipeline.parameters.target_workflow >>]
        - equal: ["cci_system_tests", << pipeline.parameters.GHA_Action >>]
    jobs:
      - build
      - system_test:
          requires:
            - build

So basically, check if the GHA_action name matches. But this fails, and upon going to the requested URL, it returns a 404 with the following warnings:

{
    "id" : "c1ceff62-1ad3-4c65-aed6-7e75eca5bc96",
    "errors" : [ {
      "type" : "config",
      "message" : "ERROR IN CONFIG FILE:"
    }, {
      "type" : "config",
      "message" : "[#/workflows/concretedirect_cicd] only 1 subschema matches out of 2"
    }, {
      "type" : "config",
      "message" : "1. [#/workflows/concretedirect_cicd/when] 0 subschemas matched instead of one"
    }, {
      "type" : "config",
      "message" : "|   1. [#/workflows/concretedirect_cicd/when] no subschema matched out of the total 4 subschemas"
    }, {
      "type" : "config",
      "message" : "|   |   A boolean or a pipeline parameter evaluating to a boolean"
    }, {
      "type" : "config",
      "message" : "|   |   1. [#/workflows/concretedirect_cicd/when] expected type: Boolean, found: Mapping"
    }, {
      "type" : "config",
      "message" : "|   |   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |   |     {}"
    }, {
      "type" : "config",
      "message" : "|   |   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |   |     equal:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   |     not_present:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   2. [#/workflows/concretedirect_cicd/when] expected type: Number, found: Mapping"
    }, {
      "type" : "config",
      "message" : "|   |   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |   |     {}"
    }, {
      "type" : "config",
      "message" : "|   |   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |   |     equal:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   |     not_present:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   3. [#/workflows/concretedirect_cicd/when] expected type: String, found: Mapping"
    }, {
      "type" : "config",
      "message" : "|   |   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |   |     {}"
    }, {
      "type" : "config",
      "message" : "|   |   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |   |     equal:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   |     not_present:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   4. [#/workflows/concretedirect_cicd/when] expected type: String, found: Mapping"
    }, {
      "type" : "config",
      "message" : "|   |   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |   |     {}"
    }, {
      "type" : "config",
      "message" : "|   |   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |   |     equal:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   |     not_present:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   2. [#/workflows/concretedirect_cicd/when] 2 schema violations found"
    }, {
      "type" : "config",
      "message" : "|   |   This is the object that represents the logical/comparison operators"
    }, {
      "type" : "config",
      "message" : "|   |   1. [#/workflows/concretedirect_cicd/when] extraneous key [not_present] is not permitted"
    }, {
      "type" : "config",
      "message" : "|   |   |   This is the object that represents the logical/comparison operators"
    }, {
      "type" : "config",
      "message" : "|   |   |   Permitted keys:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - and"
    }, {
      "type" : "config",
      "message" : "|   |   |     - or"
    }, {
      "type" : "config",
      "message" : "|   |   |     - not"
    }, {
      "type" : "config",
      "message" : "|   |   |     - equal"
    }, {
      "type" : "config",
      "message" : "|   |   |     - matches"
    }, {
      "type" : "config",
      "message" : "|   |   |   Passed keys:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - equal"
    }, {
      "type" : "config",
      "message" : "|   |   |     - not_present"
    }, {
      "type" : "config",
      "message" : "|   |   2. [#/workflows/concretedirect_cicd/when] maximum size: [1], found: [2]"
    }, {
      "type" : "config",
      "message" : "|   |   |   This is the object that represents the logical/comparison operators"
    }, {
      "type" : "config",
      "message" : "|   |   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |   |     maxProperties: 1"
    }, {
      "type" : "config",
      "message" : "|   |   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |   |     equal:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   |   |     not_present:"
    }, {
      "type" : "config",
      "message" : "|   |   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |   |     - << pipeline.parameters.target_workflow >>"
    }, {
      "type" : "config",
      "message" : "|   3. [#/workflows/concretedirect_cicd/when/equal] subject must not be valid against schema {\"pattern\":\"^(and|or|not|equal|matches)$\"}"
    }, {
      "type" : "config",
      "message" : "|   |   SCHEMA:"
    }, {
      "type" : "config",
      "message" : "|   |     not:"
    }, {
      "type" : "config",
      "message" : "|   |       pattern: ^(and|or|not|equal|matches)$"
    }, {
      "type" : "config",
      "message" : "|   |   INPUT:"
    }, {
      "type" : "config",
      "message" : "|   |     - default"
    }, {
      "type" : "config",
      "message" : "|   |     - << pipeline.parameters.target_workflow >>"
    } ],

I’m not quite understanding how this can happen; nothing of what is returned here is even present in the config.yml file.

Without more of your config.yml file the following is a guess rather than a firm answer.

Firstly, the error messages do not relate directly to the script as the script is passed via a YAML processor and then CircleCI’s processor, the result is often a rather complex list like the one you have received.

Below is a simple project that does run with a version of the code you have provided, the work it carries out is not important, but it does a task to allow a complete workflow report in the web GUI. As this works I am wondering how you have your parameters defined.

version: 2.1
parameters:
  GHA_test1:
    type: string
    default: "a"
  GHA_test2:
    type: string
    default: "b"
orbs:
  python: circleci/python@2.1.1
jobs:
  build-and-test: 
    docker:
      - image: cimg/python:3.11.2
    steps:
      - checkout
workflows:
  test_app:
    when:
      and:
        - equal: ["a", << pipeline.parameters.GHA_test1 >>]
        - equal: ["b", << pipeline.parameters.GHA_test2 >>]
    jobs:
      - build-and-test