Skip to content

VCS integration between GitLab.com and Terraform Cloud randomly breaks

Summary

Terraform Cloud users that use the GitLab.com VCS integration are reporting that the application they've created to facilitate the connection between the two randomly becomes unauthorized without the token being manually revoked, causing the need to generate a new oauth ID to get the connection back up.

Steps to reproduce

Note: So far, GitLab Support has been unable to reproduce this issue.

  1. Create a project on GitLab.com to act as the source repository for Terraform.
  2. Pick a GitLab.com account that has access to this project to act as the account that will house the application that will be provided to Terraform.
  3. While logged into that account, follow the documentation.
  4. At random, observe errors on the Terraform side that the token from the previously created application on the GitLab side has been revoked.

What is the current bug behavior?

The oauth token created by the GitLab application that is provided to Terraform Cloud that allows it access to the source repository on GitLab is randomly revoked.

What is the expected correct behavior?

That the connection between Terraform Cloud and GitLab.com is not interrupted by an invalid token unless that token is manually revoked.

Relevant logs and/or screenshots

From Terraform:

2020-08-20 15:26:27 [ERROR] [5fe163f6-4918-ac65-8e71-b86375b020a2] Server responded with code 401, message: Token was revoked. You have to re-authorize from the user.. Request URI: https://gitlab.com/api/v4/projects 

Output of checks

This bug happens on GitLab.com: 13.4.0-pre 3b76ff191e5

Zendesk Reports (GitLab Internal)