Api job trigger fails on 2.1 circle project

api
circle.yml
2.0

#1

I have a project on circleci using 2.1 workflows. “Enable Build Processing” is enabled.
I’d like to be able to trigger a specific job (or workflow) via an API endpoint.
I first looked at the new workflow api trigger, but that doesn’t yet support build parameters (to specify which job to run).
I’m fine using the original job trigger endpoint, but when I do I get a bunch of errors on the build. It seems that the config parser is expecting a 1.0 config format? Or maybe (oddly) the order of the keys on the yml document? The project builds fine on regular github-triggered builds. Here’s the output:

Spin up Environment

Build-agent version 0.1.1073-1f69f340 (2018-11-20T18:07:03+0000)
Configuration errors: 2 errors occurred:

* Configuration version 2.1 requires the "Enable Build Processing" project setting. Enable Build Processing under Project Settings -> Advanced Settings. In order to retrigger build processing, you must push a new commit.
* Cannot find a job named `build` to run in the `jobs:` section of your configuration file.
If you expected a workflow to run, check your config contains a top-level key called 'workflows:'

Additional config error

jobs: 20 schema violations found
  jobs: test: -verify-pactsonly 0 subschema matches out of 2
    jobs: test: -verify-pactsextraneous key [executor] is not permitted
    jobs: test: -verify-pacts0 subschemas matched instead of one
      jobs: test: -verify-pactsrequired key [machine] not found
      jobs: test: -verify-pactsrequired key [docker] not found
      jobs: test: -verify-pactsrequired key [macos] not found
  jobs: verify: -pactsonly 0 subschema matches out of 2
    jobs: verify: -pactsextraneous key [executor] is not permitted
    jobs: verify: -pacts0 subschemas matched instead of one
      jobs: verify: -pactsrequired key [machine] not found
      jobs: verify: -pactsrequired key [docker] not found
      jobs: verify: -pactsrequired key [macos] not found
  jobs: test: only 0 subschema matches out of 2
    jobs: test: extraneous key [executor] is not permitted
    jobs: test: 0 subschemas matched instead of one
      jobs: test: required key [machine] not found
      jobs: test: required key [docker] not found
      jobs: test: required key [macos] not found
  jobs: build: -serverless-packageonly 0 subschema matches out of 2
    jobs: build: -serverless-packageextraneous key [executor] is not permitted
    jobs: build: -serverless-package0 subschemas matched instead of one
      jobs: build: -serverless-packagerequired key [machine] not found
      jobs: build: -serverless-packagerequired key [docker] not found
      jobs: build: -serverless-packagerequired key [macos] not found
  jobs: deploy: only 0 subschema matches out of 2
    jobs: deploy: extraneous key [executor] is not permitted
    jobs: deploy: 0 subschemas matched instead of one
      jobs: deploy: required key [machine] not found
      jobs: deploy: required key [docker] not found
      jobs: deploy: required key [macos] not found

#2

Bump! What’s the best way to get support on this issue?


#3

I’ve been running into this issue too. It’s odd that the project builds fine outside of the api. But once you try to trigger the job via the API all these errors come up.


#4

Did you enable Build Processing for you project?


#5

I encountered this bug too.
Only jobs triggered by api fail.


#6

Yep. I believe(?) this default when you have a 2.1 schema.


#7

From support:

Hello Zachary,

If api job parameters are required for you then you’ll need to downgrade back to the old 2.0 syntax and also the old job api endpoint. We’ll announce when 2.1 API support builds parameters.

Fernando Mouco
Support Engineer @ CircleCI


#8

@zhammer Thanks for sharing.

But…

you’ll need to downgrade back to the old 2.0 syntax

ugh.


#9

I think I’m gonna put a git tag and push it to repository as a workaround.


#10

Hi All! If you would like to see build parameters available for the 2.1 API, please submit a vote to this idea post. Votes on the ideas page help us prioritize work on new and improved features.