doc/editor_extensions/visual_studio_code/troubleshooting.md
When working with GitLab for VS Code, you might encounter the following issues.
If your issue is not covered below, gather the required information for support
and report the bug in the gitlab-vscode-extension issue tracker.
Both the GitLab for VS Code extension and the GitLab Language Server, which powers the extension, provide logs that can help you troubleshoot.
To enable debug logging:
Developer: Reload Window and press <kbd>Enter</kbd>.To view debug logs:
You might encounter the following authentication errors.
...can't access the OS KeychainOn macOS and Ubuntu, you might get an error when the extension cannot access the OS Keychain to authenticate.
For example:
The GitLab extension can't access the OS Keychain.
If you use Ubuntu, see this existing issue.
Error: Cannot get password
at I.$getPassword (vscode-file://vscode-app/snap/code/97/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1712:49592)
Follow the workaround below for your operating system.
For more information about this error, see:
To work around this error on macOS:
vscodegitlab.gitlab-workflow.vscodegitlab.gitlab-workflow from your keychain.GitLab: Remove Account from VS Code and press <kbd>Enter</kbd> to remove the
corrupted account from VS Code.GitLab: Authenticate to add the account again.When you install VS Code with snap in Ubuntu 20.04 and 22.04, VS Code can't read passwords from the
OS keychain. Extension versions 3.44.0 and later use the OS keychain for secure token storage.
If you use a version of VS Code earlier than 1.68.0, try one of these workarounds:
.deb package, rather than snap:
snap VS Code..deb package.vscodegitlab.workflow/gitlab-tokens entry, and
remove it.Gitlab: Remove Your Account and press <kbd>Enter</kbd> to remove the account with
missing credentials.GitLab: Authenticate to add the account again.If you use VS Code version 1.68.0 or later, try to re-authenticate:
vscodegitlab.workflow/gitlab-tokens entry, and
remove it.Gitlab: Remove Your Account and press <kbd>Enter</kbd> to remove the account with
missing credentials.GitLab: Authenticate to add the account again.When using VS Code with GDK, you might get an error that states that your system is unable to establish a secure TLS connection to a GitLab instance running on localhost.
For example, if you are using 127.0.0.1:3000 as your GitLab server:
Request to https://127.0.0.1:3000/api/v4/version failed, reason: Client network
socket disconnected before secure TLS connection was established
This issue occurs if you are running GDK on http and your GitLab instance is
hosted on https.
To resolve this:
GitLab: Authenticate and press <kbd>Enter</kbd>.http URL for your instance and press <kbd>Enter</kbd>.You might encounter the following project configuration errors.
When you open a project in VS Code, you might see an error message next to the project name in the GitLab ({{< icon name="tanuki" >}}) tab. Or, you might see warning messages about multiple accounts or projects in the status bar.
These messages appear when the extension is unable to identify which repository, account, or project to use.
To resolve these errors:
If this is your first time working with Git in VS Code, see source control in VS Code for information on initializing repositories and VS Code workspaces, which occurs outside of the GitLab extension.
If your repository remote uses an SSH custom alias, the extension might not correctly match your
repository to your GitLab project. For example, if your remote uses
git@my-work-gitlab:group/project.git instead of [email protected]:group/project.git.
To resolve this issue, you can:
To configure a default namespace:
You might get an SSH cloning error while HTTPS cloning works. This occurs when your SSH URL host or path is different from your HTTPS path.
The GitLab for VS Code extension uses:
For example, the URLs for the VS Code extension project are:
[email protected]:gitlab-org/gitlab-vscode-extension.githttps://gitlab.com/gitlab-org/gitlab-vscode-extension.gitBoth have the gitlab.com host and the gitlab-org/gitlab-vscode-extension path.
To resolve this error:
(no GitLab project), then select Manually assign GitLab project:
For more information about simplifying this process, see
issue 577
in the gitlab-vscode-extension project.
You might encounter the following network and connectivity errors.
407 Access Denied failure with a proxyIf you use an authenticated proxy, you might encounter a 407 Access Denied (authentication_failed)
error.
For example:
Request failed: Can't add GitLab account for https://gitlab.com. Check your instance URL and network connection.
Fetching resource from https://gitlab.com/api/v4/personal_access_tokens/self failed
To resolve this error, enable proxy authentication for the GitLab Language Server.
If you use custom certificates to connect to your GitLab instance, such as self-signed certificates, you might encounter errors.
These errors can occur if your certificates use the following settings:
| Setting name | Information |
|---|---|
gitlab.ca | Deprecated. See the SSL setup guide for more information on how to set up your self-signed CA. |
gitlab.cert | Unsupported. See epic 6244. |
gitlab.certKey | Unsupported. See epic 6244. |
gitlab.ignoreCertificateErrors | Unsupported. See epic 6244. |
To resolve, see configure the extension for Custom Certificate Authorities.
You might encounter a false expired SSL certificate error. For example:
API request failed - Error: certificate has expired.
To resolve this error, disable system certificates:
When you use GitLab Duo in VS Code, you might encounter the following issues.
To troubleshoot GitLab Duo errors in VS Code:
GitLab: Diagnostics and review the output for any failed checks.For support with Code Suggestions, see troubleshooting Code Suggestions.
HTTP/1.1 responses instead of WebSocket endpointsYou might see HTTP/1.1 responses from GitLab Duo in your logs instead of /-/cable WebSocket
endpoints.
This occurs when your GitLab instance blocks WebSocket connections.
To resolve this error, ask your network administrator to modify your GitLab instance to allow inbound WebSocket connections from IDE clients.
When using GitLab Duo Chat in remote development environments (such as browser-based VS Code or remote SSH connections), you might encounter initialization failures like:
The webview didn't initialize in 10000ms.To resolve these errors:
In VS Code, open the Settings editor:
In the upper-right corner, select Open Settings (JSON) to edit your settings.json file.
Add or modify this setting:
"gitlab.featureFlags.languageServerWebviews": false
Save your changes and reload the window:.
Developer: Reload Window and press <kbd>Enter</kbd>.For updates on a permanent solution, see issue #1944 and Issue #1943
When you use GitLab Duo Agentic Chat or the Software Development Flow in your IDE, GitLab Duo might get stuck in a loop or have difficulty running commands.
This issue can occur when you use shell themes or integrations, such as Oh My ZSH! or powerlevel10k.
When a GitLab Duo agent creates a terminal, the shell theme or integration can prevent commands from
running properly.
As a workaround, follow the instructions below to use a simpler theme for commands sent by agents.
For more information about a fix, see issue 2116.
.zshrc fileIn VS Code, configure Oh My ZSH! or powerlevel10k to use a simpler
theme when it runs commands sent by an agent. You can use the environment variables exposed
by the IDEs to set these values.
Edit your ~/.zshrc file to include this code:
# ~/.zshrc
# Path to your oh-my-zsh installation
export ZSH="$HOME/.oh-my-zsh"
# ...
# Decide whether to load a full terminal environment,
# or keep it minimal for agentic AI in IDEs
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
echo "IDE agentic environment detected, not loading full shell integrations"
else
# Oh My ZSH
source $ZSH/oh-my-zsh.sh
# Theme: Powerlevel10k
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Other integrations like syntax highlighting
fi
# Other setup, like PATH variables
In VS Code, you can turn off advanced prompts in Bash.
Edit your ~/.bashrc or ~/.bash_profile file to include this code:
# ~/.bashrc or ~/.bash_profile
# Decide whether to load a full terminal environment,
# or keep it minimal for Agentic AI in IDEs
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
echo "IDE agentic environment detected, not loading full shell integrations"
# Keep only essential settings for agents
export PS1='\$ ' # Minimal prompt
else
# Load full Bash environment
# Custom prompt (e.g., Starship, custom PS1)
if command -v starship &> /dev/null; then
eval "$(starship init bash)"
else
# ... Add your own PS1 variable
fi
# Load additional integrations
fi
# Always load essential environment variables and aliases
Before you contact Support, make sure the latest GitLab for VS Code extension is installed.
Find the latest releases in the VS Code Marketplace, in the Version History tab.
Gather this information from affected users and provide it in your bug report:
GitLab: Diagnostics and press <kbd>Enter</kbd>.