C3 AI VS Code Extension Troubleshooting
This topic describes how to troubleshoot common Visual Studio Code Extension (VSCE) issues.
If you're experiencing issues connecting to your environment, or if you're running into issues syncing your package, you should try these initial steps to restore your connection:
- Ensure your environment is in a running state
- Ensure you have correct read and write permissions for your development space
- Resync your packages by right-clicking your package in VSCE and choose Sync Packages
- Ensure your software versions are up to date. See compatible software versions on the Supported Versions per Release page.
- Restart VS Code
The following sections go into more detail about specific issues you may be having.
- Reopen extension tab
- SSL and certificate issues
- Server authentication issues
- npm package issues
- Local permission issues
- Unreachable environment
- Connection fails in air-gapped environment because of Keyring
- Adjust reconnect to network attempts
- Dev app inaccessible
- Streaming errors
- Socket hang up
- Stale package issues
- Contact your IT admin
Reopen extension tab
If you close the tab to VSCE, you can open it again with the VS Code Command Palette.
- In VS Code, press CMD + Shift + P on Mac, or Ctrl + Shift + P on Windows to open the Command Palette.
- Type in
C3: Open Login Pageand press Enter.
SSL and certificate issues
If you have trouble connecting to your environment, you may have SSL or certificate issues. The following section provides guidance on troubleshooting your connection and certificate settings to ensure you have a valid connection to your cluster.
Example error code: self signed certificate in certificate chain
Find relevant certificates
To see which certificates you should use, you can open the certificate settings in your browser while accessing Studio. You should be using the Chrome browser.
Navigate to C3 AI Studio homepage for your cluster.
Click on the site information icon next to the URL path. This should be on the top left of your browser window.
Select Connection is secure to open connection details.

Select Certificate is valid.

Select the Details tab. You can see the Certificate Authority for all the required certificates you need to start your connection to your environment.

Add missing certificates
You can access all certificates in the chain for your cluster using the openssl command. The following example finds the certificates for a training cluster, uses the 443 port, and saves the certificates to cert_chain.txt:
openssl s_client -connect stggketrn4.c3training.cloud:443 -showcerts > cert_chain.txt- Save each certificate in its own
.pemfile. Certificates start with------BEGIN CERTIFICATEend withEND CERTIFICATE-----. - Consult your IT department for a valid outgoing port for your connection.
- Add certificates to your system trust store.
For Mac, run the following code in the terminal to add each certificate to your trust store. For each certificate, replace
mycert.pemfor each.pemfile you saved.Textsudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain mycert.pemThen open the Keychain Access application and set the When using this certificate: field to Always Trust for each certificate. See the following screenshot for this step:

For Windows, add each certificate using the Certificate Manager application for Windows.
Configure Node to use certificates
After you add missing certificates, specify the path for your certificates for Node.js. Certificate paths are environment variables that you must set in the shell configuration file to ensure that the server consistently uses the certificates when establishing secure connections.
for Mac OS or Linux
For Mac OS or Linux, run the following in your terminal to set the certificate paths, replacing <path_to_cert_chain> with the path to your certificates:
- If you use bash, then run
~/.bashrc export NODE_EXTRA_CA_CERTS="<path_to_cert_chain>. - If you use zsh, then run
~/.zshrc export NODE_EXTRA_CA_CERTS="<path_to_cert_chain>.
For Windows
Complete the following steps for Windows:
- Open System Properties.
- Navigate to Environment Variables.
- Select Edit the system environment variables.
- For User Variables, select New....
- Enter the following values: a. Variable name:
NODE_EXTRA_CA_CERTSb. Variable value:<path_to_cert_chain>
Ignore certificate checks
If you are still unable to resolve certificate errors for your machine, you may need to ignore certificate checks. This is not recommended as ignoring certificate checks may expose you to security vulnerabilities.
Enter the following commands in terminal to bypass VS Code certificate checks:
# Ignore NODE certificate checks
set NODE_TLS_REJECT_UNAUTHORIZED=0
npm config set strict-ssl false --global
# Ignore VS Code certificate checks
code --ignore-certificate-errorsServer authentication issues
Your connection may fail due to a stale authentication token. You can remove your authentication token using the Command Palette in VS Code:
- In VS Code, press CMD + Shift + P on Mac, or Ctrl + Shift + P on Windows to open the Command Palette.
- Type in
C3: Remove Auth Tokenand press Enter. - Type in your environment URL and press Enter.
If the issue persists, you can set the token manually through VS Code.
Go to your environment console and run the following command:
JavaScriptAuthenticator.generateActionAuthToken()Go to VS Code and type shift command p. enter set auth token
choose your environment
paste key in
In your output you should see successfully set token
npm package issues
If you encounter npm error ENODATA, you may be missing some required data or metadata, or you may be using an outdated version of node.
Try cleaning your cache. Run the following code in Terminal:
Textnpm cache clean --forceIf you're unable to access npm packages downloaded during runtime installation, you may need to uninstall and reinstall node. Depending on how you installed node, you may need to use different methods to uninstall and reinstall node.
If you used
nvmto install node, use the following command to uninstall:Textnvm uninstall --latestIf you used the official installer to install node, use the following command to uninstall:
Textsudo rm -rf /usr/local/lib/node_modules /usr/local/include/node /usr/local/bin/nodeIf you used the brew to install node, use the following command to uninstall:
Textbrew uninstall node
For more information on node, see How to install Node.js in the Node.js documentation.
Local permission issues
If you see Failed to execute npm install or something similar, you may be experiencing permission issues for your machine.
In Terminal, navigate to the local cache for npm. This directory is typically the .npm directory and is hidden.
For Mac, try running sudo chown -R 501:20 "/Users/User/.npm" in Terminal to change directory ownership.
For Windows, try opening VS Code as an administrator by right-clicking the application and selecting "Run as administrator".
Unreachable environment
Based on your cluster administrative settings, your environment may have automatically hibernated activity. You may need to restart or resume your hibernated environment to resume development.
- Navigate to C3 AI Studio in your browser.
- Select your environment in the Current environment dropdown.
- Select the 3 ellipses icon next to the environment. Choose Resume environment.
- Wait for your environment to resume. If your environment has a green check mark next to its name, it is in the running state.
Connection fails in air-gapped environment because of Keyring
Keyrings are storage systems that manage sensitive information, such as passwords, tokens, and encryption keys. Connection issues to air-gapped environments can result from incomplete keyring configurations.
For your GNOME Keyring on a Linux machine, you can verify if your GNOME Keyring is installed and running. Contact your customer IT admin for more troubleshooting instructions regarding your GNOME Keyring.
which gnome-keyring-daemonchecks if your GNOME Keyring is installedps aux | grep gnome-keyringchecks if your GNOME Keyring is running
Dev app inaccessible
The Dev application is where the VS Code Extension package launches from. If you can't start your Dev application, you may need to start it manually through the environment Console.
DevEnv.ensureDevApp()Adjust reconnect to network attempts
If you lose your internet connection, the extension attempts to reconnect five times, with each attempt lasting for 30 seconds.
When VSCE detects the loss of connection, it provides a notification and attempts to reconnect.
You can change the number of attempts:
- Open the VS Code settings. For Mac OS, you can use the keyboard shortcut (⌘ + ,).
- Enter
c3ai.reconnectAttemptsin the search bar, or select Extensions > C3 AI. - Under C3ai: Reconnect Attempts, enter the number of reconnect attempts.
Streaming errors
If you see "Failed to stream" errors while trying to sync to environment, it could be that you need to enable streaming after a certain size, or reduce batch size.
Note: You must run the following command in dev app only. Running this command in env/c3 does not work.
Note: Enabling this option is risky. Disabling streaming may cause out of memory errors while syncing.
// Enable streaming after 10000000 KB (10 GB)
IdeConfig.setConfigValue('maxBufferedWriteFileSize', 10000000);
IdeConfig.setConfigValue('maxBufferedReadFileSize', 10000000);
// Reduce batch size
IdeConfig.setConfigValue('downloadBatchSize', 100);
IdeConfig.setConfigValue('upsertBatchSize', 25);Socket hang up
If you see socket hang up issues, check if you have sym links in your package. Files from the sym links should be located in the root directory of your package, and can't link to other packages.
Example error message: Error: socket hang up
Stale package issues
If you see Java compilation errors or other code-gen issues, you may be experiencing stale Pkg issues. For example, you may see errors that involve declarations of the same Type.
Multiple type declarations with the same name `<TYPE NAME>` were found.If your metadata changes are not being synced, you may need to manually resync your packages.
To sync your packages, right-click the package you want to sync, and choose Sync Packages.
Force resync all
If you sync your package, but you still notice stale package issues, you can try force resyncing your package.
Note: Force resync all forcibly resyncs and re-validates everything in your package. Save your work appropriately.
- While synced to your environment, press
CMD + Shift + Pon Mac, orCtrl + Shift + Pon Windows to open the Command Palette. - Type in
C3: Force Resync All Packagesand press Enter.
Contact your IT admin
If you are connecting from a corporate laptop, or if you're connecting to non-C3 hosted cluster, you may need to reach out to your specific company IT admins for additional support in troubleshooting your connection issues.
Examples of configurations that can cause connection issues:
- Firewall settings
- VPN settings
- Network proxies
- Network security software
- Cluster whitelists for IP addresses