Suppress Connectivity Error from GitLab Workflow Extension in VS Code when private GitLab instance not reachable
Request: Is it possible to configure the GitLab Workflow Extension in VS Code to not automatically try to contact the GitLab instance its configured for every time VS Code is launched? If that’s not possible, is it possible to suppress errors about not being able to reach it?
Example of error when launching VS Code - it appears in lower right corner:
Details:
I am using the GitLab Workflow integration in VS Code. I have it configured with a Personal Access Token to access our private GitLab instance. It works great. Currently it appears to be configured to contact our GitLab server instance every time I launch VS Code. However, if I’m not connected to my company’s network, when I launch VS Code I get the above error. If I click on show logs I see the following:
2024-11-27T22:37:06:107 [error]: request to https://gitlab.example.org/api/graphql failed, reason: Hostname/IP does not match certificate's altnames: Host: gitlab.example.org. is not in the cert's altnames: DNS:*.wpengine.com, DNS:wpengine.com
FetchError: request to https://gitlab.example.org/api/graphql failed, reason: Hostname/IP does not match certificate's altnames: Host: gitlab.example.org. is not in the cert's altnames: DNS:*.wpengine.com, DNS:wpengine.com
at ClientRequest.<anonymous> (c:\Users\james\.vscode\extensions\node_modules\node-fetch\lib\index.js:1505:11)
at ClientRequest.emit (node:events:531:35)
at ClientRequest.emit (node:domain:488:12)
at emitErrorEvent (node:_http_client:101:11)
at TLSSocket.socketErrorListener (node:_http_client:504:5)
at TLSSocket.emit (node:events:519:28)
at TLSSocket.emit (node:domain:488:12)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
2024-11-27T22:37:06:108 [warning]: Token validation failed in Language Server: (Token is invalid. Failed to check token: FetchError: request to https://gitlab.example.org/api/v4/personal_access_tokens/self failed, reason: Hostname/IP does not match certificate's altnames: Host: gitlab.example.org. is not in the cert's altnames: DNS:*.wpengine.com, DNS:wpengine.com. Reason: unknown). This can happen with OAuth token refresh. If the rest of the extension works, this won't be a problem.
The error is caused by two things:
- If I am not connected to my company’s network, the GitLab instance is inaccessible
- My company has public DNS configured so that any query returns a response (wildcard setup) - so even though gitlab.example.org isn’t accessible, doing a DNS lookup on it will return a result matching www.example.org. Of course, the certificate doesn’t match because its for a different domain.
Summary - error is expected if I’m not connected to my company’s network. The question is how to suppress/disable.