Problem to solve
Describe your question in as much detail as possible:
Unable to connect vs-code gitlab-workflow plugin to self hosted community edition (8.16.3)
- What are you seeing, and how does that differ from what you expect to see?
- getting error while trying to authenticate with self-hosted community edition server, using personal access token.
- Consider including screenshots, error messages, and/or other helpful visuals
Request failed: Can’t add GitLab account for
https://git.<my-domain>
. Check your instance URL and network connection.
"userMessage": "Request failed: Can't add GitLab account for https://git.<my-domain>. Check your instance URL and network connection.", "errorMessage": "invalid json response body at https://git.<my-domain>/users/sign_in reason: Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON", "stack": [ "FetchError: invalid json response body at https://git.<my-domain>/users/sign_in reason: Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON", " at c:\\Users\\<sys-user>\\.vscode\\extensions\\node_modules\\node-fetch\\lib\\index.js:273:32", " at processTicksAndRejections (node:internal/process/task_queues:95:5)", " at Ek (c:\\Users\\<sys-user>\\.vscode\\extensions\\src\\desktop\\accounts\\get_user_for_credentials_or_fail.ts:28:23)", " at Object.authenticate (c:\\Users\\<sys-user>\\.vscode\\extensions\\src\\desktop\\accounts\\auth_flows\\pat_flow.ts:41:18)", " at run (c:\\Users\\<sys-user>\\.vscode\\extensions\\src\\desktop\\accounts\\authenticate_command.ts:85:23)", " at c:\\Users\\<sys-user>\\.vscode\\extensions\\src\\common\\utils\\wrap_command_with_catch.ts:10:7", " at mw.h (file:///c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:32733)" ] }
Steps to reproduce
- tried to follow the docs to use a personal access token for authentication
- I created the token from
Personal Access Tokens · User Settings · GitLab
https:///profile/personal_access_tokens` - opened ^+Shift+P: Gitlab:Authenticate command pallet & selected the
https://<self-hosted>
option - after pasting the token value copied from the (https:///profile/personal_access_tokens) page getting the below error in VS-code
Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?
one observation is, while trying the “Create a token first”, the URL pattern getting generated for the Personal Access Token page is: https://git.<my-domain>/-/user_settings/personal_access_tokens?name=GitLab+Workflow+Extension&scopes=api
But, when I open the page from User >> Settings the url is: https://git.<my-domain>/profile/personal_access_tokens
not sure if there’s some mismatch in the url pattern used for personal-access-token based authentication
Configuration
- NA
Versions
Please select whether options apply, and add the version information.
- Self-managed
-
GitLab.com
SaaS - Which GitLab Duo feature is involved:
Versions
- GitLab (Web:
/help
or self-managed system informationsudo gitlab-rake gitlab:env:info
): 8.16.3 - IDE and GitLab Duo Workflow extensions, if applicable:
- VS Code:
<1.97.2, GitLab Workflow version:6.1.1>
- VS Code: