- 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
04-17-2022 07:27 PM
Please work with support, log a case and share the id.
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:21 PM
I am having the same issue. Was there a resolution identified?
Using Gitlab private repository with user access token. Same behavior and error.
Would love to get a reply from someone from ServiceNow or someone that has had this issue and fixed it.
Thanks
- 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-13-2022 09:13 PM
Hi Mike, good find - it is confusing I agree.
there's point 4 in the doc page here that does indicate using bearer for access key with GitHub but it is lost and out of place.
we will raise a doc task and get this fixed.
regards,
Ram
Sr. Principal Product Manager
Cloud Mgmt Products, ITOM