- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 08:28 PM
Hi all,
I've spun up a dev instance to test CPG and Terraform Cloud and I'm quite new to SNow, so far I've successfully discovered the Terraform Cloud provider and can view my Workspaces and connected VCS. The issue I'm having is when I go into the GitLab VCS and attempt to "Find Branches and Repositories" using the related link, it loads, says it's successful, but nothing appears.
The GitLab token I'm using was created in this page - https://gitlab.com/-/profile/personal_access_tokens - I've selected the "api, read_api, read_user, read_repository" scopes and created a credential in SNow like "Token glpat-xxxxxxxxxxxxxxxxxxxx" as stated in the documentation. Doco states only to create a Credential Alias for the Config Provider cred so there's no alias for this one.
After discovery, the newest log says it's successful
****[CMP] Flow Inputs - {"output":"{\"repositories\":[],\"vcs_id\":\"oc-xxxxxxxxxxxxxxxx-1234567\",\"vcs_name\":\"GitLabTest\"}","log":"\nInputs validation started\nInputs validation successful\nSuccessfully retrieved access token\nFetching VCS repositories","correlationid":"xxx","error":""} |
But before that there's a few warnings which I'm not sure are related or not
java.lang.NullPointerException Caused by error in sys_script.4ea4effc733203004f274e3a4cf6a76d.script at line 4 |
And this error
Failed to parse the output of new CMPCIRelationshipUtil().getLdcAndServiceAccount('0913071a1b3e01106f4855f0604bcb59'), exception: : com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input at [Source: (String)""; line: 1, column: 0]: com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) |
My GitLab repos are private as they are meant to be according to the doco as well. Also, on this page it says "Locate and save the "OAuth Token ID" for the VCS provider or providers you will be using with Cloud Provisioning and Governance. Terraform uses the OAuth token ID to identify and authorize the VCS provider." but I have no idea where to put this token and was thinking that might be the issue too.
Any help would be appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 08:00 AM
Well it appears that the documentation is not correct; maybe.
From San Diego document portal
Click the required record from the Terraform Enterprise VCS list and select or create an API key credential for the VCS (GitHub) repository.
Note: Use this format for the VCS system's API key credential: Token<SPACE>< GENERATED-KEY>
. For example,Token fabcdefgh123
.
After reading some API specification on GitLab it appears that personal tokens should use
Bearer<SPACE>< GENERATED-KEY>
Once I changed the credential, I was able to get the repositories and branches.
Hope this helps someone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 07:12 PM
Yep, that's the issue. The doco as-is only works for GitHub.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2023 05:24 AM
I am also facing same issue. I have generated organization token ID, however in API credential which API key to use?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2023 08:26 PM
question is not clear - please start a new thread with full details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2023 05:27 AM
This is Terraform cloud API key at organization level and syntax given is Bearer <API KEY>