Cannot find a definition for command named scan (Official Partner Orb)

I’m trying to use the official Snyk orb, but I am unable to pass parameters to it without receiving for the following error:
Cannot find a definition for command named scan

For example, if my job’s steps look like this:

- checkout
- snyk/scan

Then I have no problems. However, as soon as I pass parameters, as follows, I hit the error:

- checkout
- snyk/scan:
     fail-on-issues: false
     monitor-on-build: true
     organization: 'test'
     project: '${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BUILD_NUM}-build'

This seems to be the case with other orbs I’ve tried in the past as well. Why is this? Is there something obvious that I’m missing?

Here’s my full config for reference:

version: 2.1
orbs:
  snyk: snyk/snyk@0.0.10

jobs:
  build:
    docker:
      - image: circleci/python:3.8.3-node
      - image: circleci/postgres:9.6.5-alpine-ram

    steps:
      - checkout
      - run:
          name: Generate cache key
          command: shasum requirements.txt requirements_dev.txt > requirements.sha
      - restore_cache:
          name: Restoring yarn and node_modules cache
          keys:
              - yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
              - yarn-deps-{{ .Branch }}
      - restore_cache:
          name: Restoring Python dependencies cache
          keys:
            - requirements-{{ .Branch }}-{{ checksum "requirements.sha" }}
            - requirements-{{ .Branch }}
      - run:
          name: Update Node.js
          command: |
            curl -sSL "https://nodejs.org/dist/v12.8.1/node-v12.8.1-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v12.8.1-linux-x64/bin/node
      - run:
          name: Check current version of node
          command: expr `node -v | tr -d '\n'` = v12.8.1
      - run:
          name: Installing psql
          command: sudo apt install postgresql-client
      - run:
          name: Waiting for PostgreSQL to start
          command: |
            for i in `seq 1 10`;
            do
              nc -z localhost 5432 && echo Success && exit 0
              echo -n .
              sleep 2
            done
            echo Failed waiting for Postgres && exit 1
      - run:
          name: Install Python deps in a venv
          command: |
            python3 -m venv env
            . env/bin/activate
            make install
      - save_cache:
          name: Save yarn and node_modules cache
          key: yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - node_modules
            - ~/.cache/yarn
      - save_cache:
          name: Save yarn and node_modules cache (by branch)
          key: yarn-deps-{{ .Branch }}
          paths:
            - node_modules
            - ~/.cache/yarn
      - save_cache:
          name: Save python dependencies cache
          key: requirements-{{ .Branch }}-{{ checksum "requirements.sha" }}
          paths:
            - "env"
      - save_cache:
          name: Save python dependencies cache (by branch)
          key: requirements-{{ .Branch }}
          paths:
            - "env"
      - snyk/scan:
          fail-on-issues: false
          monitor-on-build: true
          organization: 'test'
          project: '${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BUILD_NUM}-build'
      - store_test_results:
          path: test-results
      - store_artifacts:
          path: test-results
          destination: tr1
workflows:
  build:
    jobs:
      - build

Hello @mikepink,

I believe the error may be missing from your post? Would you mind sharing the error again for us?
I also notice there is a new patch release, version 0.0.12 that might be worth checking out.

Lastly, if there is a bug on an orb, it is best to contact the authors of the orb directly on GitHub as they may or may not be active on the forum. You can file an open issue on the Sneak Orb here if we do find there is some bug :+1:

CC @snyk

I just attempted this with version 0.0.12 of the orb, but received the same error. Here’s the error I’m seeing:

Error calling workflow: 'build'

Error calling job: 'build'

Cannot find a definition for command named scan

@mikepink Did you figure this issue out? I’m coming across the same issue for the slack orb. It only works if I don’t pass any parameters.

@tmaly1980 I never figured this particular issue out. I “fixed” this same issue with another orb by copy-pasting its source into my config file as a command. I haven’t gotten around to trying it with Synk specifically.

Can you share a link to the other issue that worked for you?

I didn’t create/reference another issue, so I have nothing to link to.