Workflow error "Config does not conform to schema"

I’m getting an error “Encountered errors trying to create workflows from this config: Config does not conform to schema: {:workflows {:build_and_deploy {:jobs [nil {:deploy (not (map? nil)), :filters {:branches disallowed-key}}]}}}” and can’t track down the issue causing it, hoping someone here can help :slight_smile:

config.yml:
version: 2

jobs:
  deploy:
    working_directory: ~/laravel
    docker:
      - image: circleci/php:7.1-node-browsers
    steps:
      - checkout
      - run:
          name: Installing deployment dependencies
          working_directory: /
          command: |
            sudo apt-get -y -qq update
            sudo apt-get install python-pip python-dev build-essential
            sudo pip install awswebcli --upgrade
      - run:
          name: Deploying
          command: eb deploy app-backend-$CIRCLE_BRANCH
  build:
    docker:
      - image: circleci/php:7.1-node-browsers
    working_directory: ~/laravel
    steps:
      - checkout
      - run: cp .env.testing.example .env
      - run: sudo apt install -y libsqlite3-dev zlib1g-dev
      - run: sudo docker-php-ext-install zip
      - run: sudo composer self-update
      - restore_cache:
          keys:
            - composer-v1-{{ checksum "composer.lock" }}
            - composer-v1-
      - run: composer install -n --prefer-dist
      - save_cache:
          key: composer-v1-{{ checksum "composer.lock" }}
          paths:
            - vendor
      - run: touch database/testing.sqlite
      - run: php artisan migrate
      - run: vendor/bin/phpunit

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - deploy:
        filters:
          branches:
            only: develop

You have a structural problem in your workflows section. Put it into a YAML parser, and see that somehow your deploy subkey has become NULL:

  "workflows": {
    "build_and_deploy": {
      "jobs": [
        "build", 
        {
          "filters": {
            "branches": {
              "only": "develop"
            }
          }, 
          "deploy": null
        }
      ]
    }, 
    "version": 2
  }

This is a YAML problem, not a CircleCI problem. I would guess you need more indentation, like so:

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - deploy:
          filters:
            branches:
              only: develop

Try it in the parser and see the difference.

Had run it thorough a YML validator, but didn’t think of running it through something to convert to a more readable format like JSON, the missing indentation on the filters were almost definitely the issue, thanks! Going to give it a test to make sure it deploys now :slight_smile:

1 Like

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