4
votes

I have a webhook on Github configured that calls AWS Codebuild to trigger the build of that branch. I'm seeing an error coming back from CodeBuild but it's unclear to me what the solution is.

Response is a 400 with following details. The webhook payload is whatever Github normally sends on a new push event to a branch.

Connection: close Content-Length: 89 Content-Type: application/json Date: Sun, 01 Mar 2020 21:20:05 GMT x-amzn-ErrorType: InvalidInputException:http://internal.amazon.com/coral/com.amazonaws.codebuild.webhooks/ x-amzn-RequestId: a4dbe4bd-244d-4f4a-826e-ed49bd72c099 {"message":"Invalid Webhook request received: Invalid source repository owner specified"}

I'll add a few things:

  1. The PING event for the webhook was processed successfully.
  2. The Github project is owned by my organization
  3. I am an owner on that organization
  4. I connected my Codebuild to Github initially using my personal access token with the correct required scopes and I've tried using OAuth to connect. Both connections work but the webhook still fails in the same way.
2

2 Answers

3
votes

Thank you for using AWS CodeBuild. When CodeBuild receives a webhook event payload, we compare the repo owner name set on the CodeBuild project with the information in the payload. For example if your project source location is set to "https://github.com/[owner]/[repo]", we will take the [owner] and compare with the repository owner name/login provided in the webhook payload. If they don't match, "Invalid source repository owner specified" exception will be thrown.

You can find the owner name/login in the payload by looking at "repository" -> "owner" -> "login"/"name" field.

Can you please verify that your project setting matches the information in the payload?

2
votes

Based on the comment from @Linghao Zhu, I changed the URL of my github repo to use the correct case of my repo owner and now everything works.

Not sure if that's documented anywhere but could be useful to know that the check on the AWS CodeBuild side does a case sensitive comparison.