Help Center/ ModelArts/ Troubleshooting/ DevEnviron/ Failures to Access the Development Environment Through VS Code/ Error Message "XHR failed" Is Displayed During VS Code's Connection to a Remote Notebook Instance
Updated on 2025-06-06 GMT+08:00

Error Message "XHR failed" Is Displayed During VS Code's Connection to a Remote Notebook Instance

Symptom

Error message "XHR failed" is displayed when VS Code is used to connect to a remote notebook instance.

Possible Cause

The network may be faulty, and the VS Code Server cannot be automatically downloaded. In this case, manually install the VS Code Server.

Solution

  1. Open VS Code, choose Help > About, and record the commit ID.

  2. Check the system architecture of the image used for creating the notebook instance. You can open the terminal on the notebook instance and run the uname -m command to view the system architecture.
  3. Download the VS Code Server of the required version based on the commit ID and the image architecture of the notebook instance.

    If error message "Not Found" is displayed during the download, download another version of VS Code and install it locally. Currently, Vscode-1.86.2 is recommended.

    • If the instance architecture is x86_64, visit the following URL (manually change the commit ID and delete the angle brackets), and download the vscode-server-linux-x64.tar.gz file.
      https://update.code.visualstudio.com/commit:<Commit ID>/server-linux-x64/stable
    • If the instance architecture is AArch, visit the URL below (manually change the commit ID and delete the angle brackets), and download the vscode-server-linux-arm64.tar.gz file. After the file is downloaded, rename it vscode-server-linux-x64.tar.gz.
      https://update.code.visualstudio.com/commit:<Commit ID>/server-linux-arm64/stable

    For example, if the commit ID is 863d2581ecda6849923a2118d93a088b0745d9d6 and the OS architecture is x86_64, the URL should be:

    https://update.code.visualstudio.com/commit:863d2581ecda6849923a2118d93a088b0745d9d6/server-linux-x64/stable
  4. Upload vscode-server-linux-x64.tar.gz to the /home/ma-user/work directory of the ModelArts instance.

    Run the following command on the notebook terminal and specify the commit ID. (Delete the angle brackets.)

    commitId=<Commit ID>
    mkdir -p /home/ma-user/.vscode-server/bin/$commitId
    tar -zxvf vscode-server-linux-x64.tar.gz -C /home/ma-user/.vscode-server/bin/$commitId  --strip=1
    chmod 750 -R /home/ma-user/.vscode-server/bin/$commitId
  5. Close VS Code and open it again on the notebook instance list page. (You need to close the local VS Code. An error may be reported if multiple processes are running.)