4

I am trying to trigger a new Wercker build by hitting the API endpoint mentioned in the documentation, but the API returns the following response:

{"statusCode"=>400, "error"=>"Bad Request", "message"=>"Invalid stack, only stack 1 and 5 are supported for builds"}

What does the error message "Invalid stack, only stack 1 and 5 are supported for builds" mean?

I tried to send the request using the following script:

$ jq . -c <<JSON | curl -s -d @- -H 'Authorization: Bearer token' -H 'Content-type: application/json' 'https://app.wercker.com/api/v3/builds' | jq .
{
  "applicationId": "applicationid",
  "branch":"develop",
  "envVars":[
    {"key":"HOGE_FOO","value":"true"}
  ]
}
JSON

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Invalid stack, only stack 1 and 5 are supported for builds"
}
asymmetric
  • 3,800
  • 3
  • 34
  • 52
mgi166
  • 43
  • 3

1 Answers1

3

[Wercker employee here!]

The builds endpoint is for the Wercker classic stack, which had distinct notions of builds and deploys. The current Wercker Workflows stack uses the runs API endpoint to control arbitrary pipeline runs.

The error message you are seeing is telling you this in a somewhat cryptic way. Version 6 refers to the Workflows stack, 1 and 5 are classic/deprecated stacks. I'll make this more clear in our documentation, but if you replace your calls from the builds API endpoint to the Runs API endpoint, it should work!

Aaron
  • 458
  • 4
  • 16
  • 1
    Yes, as you have said, I'm using current Workflows stack. I tried the `Runs API`, success to build. Thanks! – mgi166 Mar 08 '17 at 01:36