Api job trigger fails on 2.1 circle project

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

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

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.

1 Like

Did you enable Build Processing for you project?

1 Like

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

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

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

@zhammer Thanks for sharing.

But…

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

ugh.

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

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.

Having to vote so that you can fix regressions seems slightly counter intuitive. If you publish breaking changes it should be communicated as such.

I understand. I want to provide an update on this, since it’s been a while since our last one. This is something that we understand is causing a great amount of pain. We are working to get this ability added back to the API. It required more work than it seems, so it it is taking longer than we would like, but it is a priority and we hope to have it back soon. I will post updates as I have them.

2 Likes

Hi,

Was there any update on the fix for this issue? We are in in CircleCI 2.1 and not able to trigger jobs using api which is becoming a big need for us. Thanks for your early reply providing any visibility on the same.

We have just moved over to circleci and done initial implementation as config 2.1 and late in the process found this limitation for config 2.1 not being able to have manual trigger jobs via API yet. Is there any update/ETA on this being available or should we look to swap to config 2.0?