Problem
After configuring a GitHub App for VCS integration in Terraform Enterprise, the connection fails after approximately 8 hours. When you attempt to access the GitHub App settings in the Admin UI, Terraform Enterprise displays an "Internal Server Error" page.
Prerequisites
- Terraform Enterprise versions prior to
v202306-1(713).
Cause
This issue is caused by a known bug where Terraform Enterprise sends an invalid request to refresh the GitHub App OAuth token, leading to a breakdown in VCS connectivity.
Solutions
There are two solutions to resolve this issue. The recommended solution is to upgrade Terraform Enterprise. If you cannot upgrade immediately, you can disable token expiration as a temporary workaround.
Solution 1: Upgrade Terraform Enterprise
This is the recommended permanent solution, as it includes the official bug fix.
- Upgrade your instance to Terraform Enterprise version
v202306-1(713) or a later version. - Navigate to your GitHub App settings page and click the Revoke all user tokens button.
- In the Terraform Enterprise UI, navigate to Admin Settings > VCS Integrations.
- Click the Authorize button and follow the prompts to reauthorize the GitHub App.
Solution 2: Disable GitHub App Token Expiration
Use this solution if you are unable to upgrade your Terraform Enterprise instance immediately.
- Navigate to your GitHub App settings page and click the Revoke all user tokens button.
- On the GitHub App settings page, navigate to the Optional Features section.
- Under User-to-server token expiration, click the Opt-out button.
- In the Terraform Enterprise UI, navigate to Admin Settings > VCS Integrations.
- Click the Authorize button and follow the prompts to reauthorize the GitHub App.
Outcome
After completing the steps in either solution, the VCS connectivity with your GitHub App will be restored and remain stable.
Additional Information
For detailed instructions on upgrading your instance, please refer to the official Terraform Enterprise upgrade documentation.