Problem
Sometimes, when we make changes to the github repo, the changes are not picked by HCP Terraform workspace and when we check the webhooks on the github repo, we see a red triangle on the webhook with 500 response status as shown in the screenshot below:
Probable Cause
This error most probably occurs because the secret configured for the webhook is changed manually. When you navigate to Repo settings >> Webhooks , there is a button to change secret as visible in the screenshot below:
If the secret configured for this webhook is changed manually, this could result in 500 response error {"errors":["signature does not match"],"success":false}
Solution
The solution in this case would be to reconfigure the VCS connection and then associate the workspace with the new VCS connection. This could also be resolved much easily by following below steps:
- Go to the affected HC Terraform Workspace settings
- Click on
Version Control - Click on
Change Source>> ChooseCLI Driven Workflow>> Click on buttonUpdate VCS Settings - Again click on
Connect to Version Controlbutton >> Choose Version Control Workflow >> Choose the VCS connection - Select the repository and click on
Update VCS Settings
Once above steps are completed, the connection will get refreshed and webhooks will work as expected with 200 response:
We should never change the secret configured for the webhook manually.
Note: If you continue to experience issues, please contact HashiCorp Support.