Circle CI API behaving differently from github commit trigger?

I just asked a question about this on SO, but I’ve gotten an example project to pass tests when I commit to the repo.

However, when I try to kick off a build and test programmatically using the API with this command:
curl -X POST https://circleci.com/api/v1.1/project/github/Atticus29/cypress-example-kitchensink?circle-token=myApiToken, the build fails and the jobs dashboard on CircleCI tells me that something is wrong with my config file:

6 schema violations found required key [jobs] not found workflows: 5 schema violations found workflows: minimum size: [2], found: 1 workflows: build: jobs: 4 schema violations found workflows: build: jobs: 0: 0 subschemas matched instead of one workflows: build: jobs: 0: expected type: String, found: Mapping workflows: build: jobs: 0: install: extraneous key [build] is not permitted workflows: build: jobs: 1: 0 subschemas matched instead of one workflows: build: jobs: 1: expected type: String, found: Mapping workflows: build: jobs: 1: run: extraneous key [start] is not permitted

And that something went wrong with my build:

Build-agent version 0.1.1216-48f80d08 (2018-12-07T16:01:40+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:’

I can confirm that Enable Build Processing is on.

Hi @Atticus29

In your jobs that failed, it looks like your orb source is not getting expanded into a fully processed config.yml file—thus the error messages about a missing jobs section, etc.

This is expected, as there is a new API endpoint for triggering builds that use 2.1 config processing:

https://circleci.com/docs/api/v1-reference/#new-project-build

Can you try that API endpoint and see if you encounter the same issues?

Due to the nature of the changes in 2.1 config processing, the old API project endpoint will not always behave nicely with config.yml files using 2.1 syntax.

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.