Terraform plan failure in CircleCI pipeline

Hello Folks,

I have setup terraform files in my config.yml file in .circleci directory to run terrafom plan command. When I make changes to the config.yml file, this is the error I am getting in the CircleCI UI:

*Error: can't find external program "ruby"*
*Error: cannot read Node n-6cb4cad460d656c1: unauthenticated: cannot find auth GUID*
*Error: cannot read Node n-4c16183860d9c9a8: unauthenticated: cannot find auth GUID*

Here is my config.yml file:

version: 2.1

jobs:

  shellcheck:
    docker:
      - image: koalaman/shellcheck-alpine
    steps:
      - checkout
      - run: .circleci/bin/shellcheck.sh

  terraform:
    docker:
      - image: hashicorp/terraform:0.12.31
    steps:
      - checkout
      - run:
          name: Create a .valid directory and populate it with service account cred.
          command: |
            cd terraform/env/
            mkdir .valid/ 
            touch .valid/account.json
            echo $ACCOUNT > .valid/account.json

      - run:
          name: Check Terraform formatting
          command: |
               if [[ -n "$(terraform fmt -write=false)" ]]; then echo "Need to run 'terraform fmt' to fix formatting"; exit 1; fi

      - run:
          name: Validate terraform for dev environment
          command: |
            cd terraform/env && terraform init -input=false -backend=true && (terraform validate -json=false && echo "√ passed") || exit 1

      - run:
          name: Plan terraform for dev environment
          command: |
              cd terraform/env && terraform plan -out=tfplan && echo "√ passed" || exit 1
          


workflows:
  version: 2
  build:
    jobs:
      - shellcheck
      - terraform

The last step terraform plan -out=tfplan is what failed with the above mentioned error

Can anyone please help with this?

The only suggestion I can give you is to remove everything but config.yml from .circleci directory. I issues in the past I sold simply moving my scripts in another directory in my repository.

Thanks. I figured out why I was getting error: Error: cannot read Node n-6cb4cad460d656c1: unauthenticated: cannot find auth GUID. Its actually a permission from one of our security tools. I am still left with can't find external program "ruby". And by the way, I don’t have any other resource in .circle directory. config.yml is the only file I have in it. Thanks for your help!