2.1 Config and Build Processing

trying to run v2.1
have 2.1 in config.yaml and enabled Enable build processing (preview)
getting error:

Exit code: 1
#!/bin/sh -eo pipefail # Unsupported or missing workflows config version false
Exited with code 1

It looks like your post has been duplicated here:

Do I need special permission to use the API Trigger a new Build by Project (preview)?

I got 403 error response:

$ curl -X POST \
  -H "Content-Type: application/json" \
  -u ${CIRCLE_TOKEN}: \
  -d '{"branch":"introduce-circleci"}' \
  https://circleci.com/api/v1.1/project/github/koshigoe/sandbox-circleci/build
{
  "message" : "Permission denied"
}

I have already turned on Enable build processing (preview).

My .circleci/config.yml is:

version: 2.1

jobs:
  build:
    docker:
      - image: circleci/golang
    steps:
      - checkout
      - run:
          name: Echo
          command: echo OK

workflows:
  version: 2
  build:
    jobs:
      - build

Same issue is here, I can trigger job with 2.1 config by github pushing, but via API is not working, not supported yet?

Build-agent version 0.1.900-892a9f73 (2018-10-25T15:49:42+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.
1 Like

Same here. When using the older API https://circleci.com/docs/api/#trigger-a-new-job and https://circleci.com/docs/api/#trigger-a-new-build-with-a-branch it throws

Build-agent version 0.1.900-892a9f73 (2018-10-25T15:49:42+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 namedbuildto run in thejobs:section of your configuration file. If you expected a workflow to run, check your config contains a top-level key called 'workflows:'

The new API (trigger-a-new-build-by-project-preview) works but the problem is that it doesn’t show the commit message in the builds in the UI like the older API’s. Which is really nice to have… It only shows the account image…

1 Like

Ah, thx for replying! it’s very helpful for me, I overlooked https://circleci.com/docs/api/#trigger-a-new-build-by-project-preview .
This doc says

This endpoint does not yet support the build_parameters options that the job-triggering endpoint supports

but I need this… I’ll try to use git tagging as workaround :slight_smile:

1 Like

Do you know if you turned on the “Build Processing” setting prior to trying this API?

Yup, I’m sure about that.
When I posted 2.1 Config and Build Processing , I try to use older API (https://circleci.com/docs/api/#trigger-a-new-job , not newer one #trigger-a-new-build-by-project-preview .) and it does not work although turning on the Build Processing setting.

I was hoping to get clarification on an item in the Getting Started documentation:

  • Jobs named build will be wrapped in a workflows stanza by the processor
  • Does this imply that any job named build will have its own workflow?
  • Is there an advantage to wrapping the build job in a workflow without any other job? (I wasn’t sure if it implies dependencies across workflows – because I do have a use-case for this)

I totally agree, had to find this comment to find the right way for escaping this… But << >> is definitely not practical… Maybe go with {{ }} like Ansible does.

2 Likes

I use the yaml merge key operator: “<<” in cases like:

jobs:
  go-test:
    <<: *go_defaults

I can’t figure out how to escape this. Am I just SOL?

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