Error in config file:

Hello, this is my first post in here

I am getting this error while trying to do continuous integration with circleci

ERROR IN CONFIG FILE:

[#/jobs/build] only 1 subschema matches out of 2

  1. [#/jobs/build/steps/3] 0 subschemas matched instead of one
    | 1. [#/jobs/build/steps/3] Input not a valid enum value
    | | Steps without arguments can be called as strings
    | | enum:
    | | - checkout
    | | - setup_remote_docker
    | | - add_ssh_keys
    | 2. [#/jobs/build/steps/3/save_cache/key] expected type: String, found: Sequence
    | | SCHEMA:
    | | type: string
    | | INPUT:
    | | null

So My Config yml file is
version: 2.1

jobs:

build:

    working_directory: ~/assOne

    docker:
        - image: cimg/node:12
        - image: circleci/mongo

    steps:
        - checkout
        - restore_cache:
            keys: 
                - dependency-cache-server-{{ checksum "yarn.lock" }}
                - dependency-cache-server

        - run: 
            command: yarn
                
        - save_cache:
            key: 
                - dependency-cache-server-{{ checksum "yarn.lock" }}
            paths:
                - node_modules
            
        - run:
            command: yarn tsc

        - run:
            command: yarn test

workflows:

test-server:
    jobs:
        - build

I don’t know if anyone could help me out

1 Like

Hi @Deyems,

Welcome to the CircleCI community!

The culprit is the save_cache step.

As there is only one key, you should use it as follows:

- save_cache:
    key: dependency-cache-server-{{ checksum "yarn.lock" }}

In case you’re not already using it, the CircleCI CLI is a great tool to validate you config.yml.

1 Like