Command '' was not defined in any pipeline files, refusing to run

I’m trying the most simple pipeline of all times and yet I get the above error. Here I’m trying to determine if the env elements apply to my command or not?

steps:
  - label: 'env test'
    agents: 
      queue: docker
    env:
      MYVAR: some-value
    command:
      - echo "MYVAR = $MYVAR"

  - wait

pipeline terminates with:

2022-08-22 18:34:39 INFO   Updating BUILDKITE_COMMIT to "982cd7ee979b40238d3b7f43ff9cb4981b164365"
Command '' was not defined in any pipeline files, refusing to run
Error: The global pre-command hook exited with status 1

This is just a mistake between the plural commands which takes a map vs the singular command which takes a single argument. See the distinction in the docs: Command Step | Buildkite Documentation.

So just change it to plural:

    commands:
      - echo "MYVAR = $MYVAR"

or make it one-line:

command: echo "MYVAR = $MYVAR"

Thanks. Did not know about that difference
I changed it to this based on the document you linked to:

steps:
  - label: 'env test'
    commands:
      - "echo MYVAR = $MYVAR"
      - "ls"
    env:
      MYVAR: "some-value"

  - wait

The error message is still the same:

Command '' was not defined in any pipeline files, refusing to run

I cannot possibly make this test any simpler and it still fails!!!

steps:
  - label: 'env test'
    command: echo hello
    env:
      MYVAR: "some-value"

  - wait

Or even this fails:

steps:
  - command: echo hello

  - wait
Command '' was not defined in any pipeline files, refusing to run
🚨 Error: The global pre-command hook exited with status 1

It looks like this is not a buildkite issue but rather a pre-hook that my company has setup. I’ll take this up with them. thanks