500 status trying ciBuildRuns

Hello all!

Since past Thursday, using this cURL:

curl  -X POST \
  'https://api.appstoreconnect.apple.com/v1/ciBuildRuns' \
  --header 'Accept: */*' \
  --header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
  --header 'Authorization: Bearer XXXX' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "data": {
    "type": "ciBuildRuns",
    "attributes": {},
    "relationships": {
      "workflow": {
        "data": {
          "type": "ciWorkflows",
          "id": "NNNN"
        }
      },
      "sourceBranchOrTag": {
        "data": {
          "type": "scmGitReferences",
          "id": "NNNN"
        }
      }
    }
  }
}

Of course, I removed the sensible information from my sample. This is the response:

{
  "errors": [
    {
      "status": "500",
      "code": "UNEXPECTED_ERROR",
      "title": "An unexpected error occurred.",
      "detail": "An unexpected error occurred on the server side. If this issue continues, contact us at https://developer.apple.com/contact/."
    }
  ]
}

I have written to Apple Support twice since they assure me that I will have a response in 2 working days, but I have not had any response.

The rest of the API calls work correctly.

Accepted Reply

I found the issue and the solution: Because I have my Workflows with a Branch changes Start condition and the workflow was disabled (to prevent auto-launch) the API ciBuildRuns was failing.

Now Apple introduce a new option in the Start Conditions: Manual Start, that give us the possibility of set as manual to not do it automatically when something changes into the branches.

Changing all the Workflows to Manual Start and enable it back, all the Workflows start working again.

Replies

I found the issue and the solution: Because I have my Workflows with a Branch changes Start condition and the workflow was disabled (to prevent auto-launch) the API ciBuildRuns was failing.

Now Apple introduce a new option in the Start Conditions: Manual Start, that give us the possibility of set as manual to not do it automatically when something changes into the branches.

Changing all the Workflows to Manual Start and enable it back, all the Workflows start working again.

@vcapillaTW

Thanks for sharing the solution! I was having the same problem and it helped me fix it.