API to Trigger a new Build by Project (preview) fails

api

#1

I’ve enabled the preview feature in my projects settings. I’ve created a new api key in the project, with ‘all’ permissions.

When trying to trigger the project via:
curl -X POST --header “Content-Type: application/json” -d ‘{“branch”:“develop”}’ “https://circleci.com/api/v1.1/project/github///build?&circle-token=xxxxxxxxxxxxx”

… it fails with {“message”:“An internal server error occurred.”}

I just received an email saying this is possible.
And please stop closing tickets when issues are not solved.


API to Trigger a new Build by Project (preview) is broken
#2

Mostly, no-one is doing that - it is an automatic feature of the board, presumably to prevent necroposting. If you see an old post that is closed, you can create a new post and link to the old one.

The /// looks suspect to me. Are there meant to be two null/empty values in here?


#3

More like this:
curl -X POST https://circleci.com/api/v1.1/project/github/username/projectname/build?branch=develop&circle-token=xxxxxxxxxxxxx


#4

@mt-micky - one thing to check first is whether you turn on the “build processing” feature under “Advanced Settings” on your project settings page – that’s required for the new build triggering endpoint. If that’s the issue, we can make the error message better. If that’s not the issue, let us know.


#5

Yes, it’s turn on. That’s how I’m testing the feature but still getting “An internal server error occurred.”


#6

Hey! Did you have any luck with this? I’m actually getting the same error.


#7

I am having the issue with /build/ api call.

The error is : “message” : “Project not found”, however i can get the project info when calling the api.
The command i’m running is:

curl -X POST https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/build?branch=branch_name&circle-token=circle_token/


#8

curl -u 'user:token' -d build_parameters[CIRCLE_JOB]=build https://circleci.com/api/v1.1/project/github/org/repo/tree/master

Same here “Project not found” :disappointed:


#10

Hitting exactly the same error. The identical curl request succeeds if I submit it locally but fails when triggered from within a CircleCI workflow.

Can someone help please? This is the last thing stopping me from switching our CI/CD system over to CircleCI…


#11

curl -d 'build_parameters[CIRCLE_JOB]=build' 'https://circleci.com/api/v1.1/project/github/MY_ORG/MY_REPO/tree/master?circle-token=TOKEN'

this works!!!


#12

Ridiculous. Please stop closing active unsolved threads.

Anyone know when they’ll finish this feature that was complained about some 2 years ago now?

Why force us into 2.0 if it’s not ready for production.


#13

p.s. Whatever is documented over here does not tell us where to specify the workflow and looks nothing like the commands people are using in this thread.

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


#14

Unsolved threads should be banished, using this simple charm. Keep practising! :sparkles:


#15

using this simple charm

Completely over my head. Until I remember that author applies new meanings to words in ridiculous ways.


#16

All my metaphors today take on a Harry Potter theme. For example, if something unpleasant jumps out at me and catches me by surprise, I use humour to defeat it, and send it scurrying away. :rat: That’s why there are no Boggarts in this thread.


#17

curl -X POST --header "Content-Type: appliation/json" -d '{"branch":":branch"}' -d 'build_parameters[CIRCLE_JOB]=build' https://circleci.com/api/v1.1/project/github/:username/:repo/tree/:branch?circle-token=:token

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:'
  • version: 2.1 is set.
  • “Enable Build Processing” is enabled.
  • build exists under jobs:.
  • If I give a workflow name it errors just the same. (including still talking about build job rather than the workflow name)

Possible to completely revert to v1?
#18

It appears one issue is that circle-token has without documentation changed to no longer mean “Project API key” but “Personal API key”.