Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense not working on Remote SSH "Request canceled by server" #11717

Closed
RahulSisondia opened this issue Nov 20, 2023 · 17 comments
Closed
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release remote
Milestone

Comments

@RahulSisondia
Copy link

Environment

  • OS and Version: Mac Ventura 13.5.2
  • VS Code Version: 1.84.2 / downgrading to 1.83.1 had no effect
  • C/C++ Extension Version: 1.84.5 / upgrading to 1.90 had no effect
  • If using SSH remote, specify OS of remote machine: Linux el9 5.15.0-103.114.4.el9uek.x86_64

Bug Summary and Steps to Reproduce

Bug Summary:

Hi, I'm trying to develop c++ on a linux machine using remote ssh. The connect is fine, open file is fine. However Intellisense seems not working. It keeps on the indexing, selecting "go to definition" does nothing, hovering mouse over a symbol doesn't show the preview. It seems Intellisense has stopped working due to some cancellation request by the language server. AFAICT, it is regression from the recent versions because this was working until last week.

Steps to reproduce:
(1 )Download the Remote - SSH extension and C/C++ extension
(2) Connect to remote
(3) Install the C/C++ extension on the remote
(4) Open the workspace that contains mysql source
(5) Open any cpp file and observe and try to navigate or hover the mouse over a symbol. Notice indexing and rescanning taking forever but never completes.
image

Expected behavior:
Hovering over a symbol must show details about that symbol. Must be able to navigate to the definitions.

Everything was working fine until Friday. Seems regression due to latest upgrades.
Downgrading the vscode and upgrading the c_cpp extension to 1.90 had no effect

Configuration and Logs

- Configurations in c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/export/home/tmp/rahul/build/dev_build/include"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu23",
            "cppStandard": "gnu++23",
           "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
} 


- Logs from running C/C++: Log Diagnostics from the VS Code command palette

Did not notice any. 

- Logs from the language server logging

loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.18.5
cpptools version (native): 1.18.3.0
Autocomplete is enabled.
Error squiggles are enabled.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/queryCompilerDefaults (id: 2)
LSP: (invoked) cpptools/queryCompilerDefaults (id: 2)
LSP: (received) cpptools/didChangeCppProperties (id: 3)
LSP: (received) cpptools/queryCompilerDefaults (id: 4)
Querying compiler for default C++ language standard using command line: /usr/bin/clang -x c++ -E -dM /dev/null
Detected language standard version: c++17
Querying compiler's default target using command line: "/usr/bin/clang" -dumpmachine
Compiler returned default target value: x86_64-redhat-linux-gnu
Compiler query command line: /usr/bin/clang -std=c17 -m64 -Wp,-v -fno-blocks -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/clang'
Compiler query command line: /usr/bin/clang -std=c++17 -m64 -Wp,-v -fno-blocks -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/clang'
LSP: (invoked) cpptools/didChangeCppProperties (id: 3)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/gcc -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/gcc" -dumpmachine
Compiler returned default target value: x86_64-redhat-linux
Compiler query command line: /usr/bin/gcc -std=gnu++23 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/gcc'
Compiler query command line: /usr/bin/gcc -std=gnu23 -m64 -Wp,-v -E -dM -x c /dev/null
Compiler query command line: /usr/bin/gcc -std=gnu2x -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/gcc'
  Folder: /usr/include/ will be indexed
  Folder: /usr/lib/gcc/x86_64-redhat-linux/11/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /home/rahul/src/dev/ will be indexed
  Folder: /export/home/tmp/rahul/build/build_dev/include/ will be indexed
LSP: (invoked) cpptools/queryCompilerDefaults (id: 4)
Discovering files...
LSP: (received) cpptools/didChangeCppProperties (id: 5)
LSP: (invoked) cpptools/didChangeCppProperties (id: 5)
  Processing folder (recursive): /usr/include/
LSP: (received) textDocument/didOpen: file:///home/rahul/src/   /storage/innobase/trx/trx0purge.cc
LSP: (invoked) textDocument/didOpen: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc
LSP: (received) cpptools/activeDocumentChange: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc
LSP: (received) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getDocumentSymbols: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 6)
LSP: (received) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 7)
LSP: (received) cpptools/getSemanticTokens: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 8)
LSP: (received) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 9)
LSP: (invoked) cpptools/activeDocumentChange: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/getDocumentSymbols: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 6)
LSP: (invoked) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 7)
LSP: (invoked) cpptools/getSemanticTokens: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 8)
LSP: (invoked) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 9)
LSP: (received) cpptools/getFoldingRanges: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 10)
LSP: (invoked) cpptools/getFoldingRanges: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 10)
  tag parsing file: /home/rahul/src/dev/storage/innobase/trx/trx0purge.cc
Checking for syntax errors: /home/rahul/src/dev/storage/innobase/trx/trx0purge.cc
LSP: (received) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 11)
LSP: (received) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 12)
LSP: $/cancelRequest (cpptools/getInlayHints, id: 9)
LSP: (invoked) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 11)
LSP: (invoked) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 12)
LSP: Request canceled by server (<unknown/completed>, code: -32802, id: 9)
Database safe to open.
LSP: (received) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 13)
LSP: (invoked) cpptools/getCodeActions: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 13)
LSP: (received) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 14)
LSP: (invoked) cpptools/getInlayHints: file:///home/rahul/src/dev/storage/innobase/trx/trx0purge.cc (id: 14)
LSP: Request canceled by server (cpptools/getInlayHints, code: -32802, id: 12)

Other Extensions

clang-format
code Spell checker
copy with line numbers
Git lense

Additional context

No response

@onlytheworld
Copy link

I encountered the same issue, and I fixed it by setting the 'C_Cpp: Intelli Sense Engine' value to 'default'.

@RahulSisondia
Copy link
Author

I encountered the same issue, and I fixed it by setting the 'C_Cpp: Intelli Sense Engine' value to 'default'.

Thank you. In my case 'C_Cpp: Intelli Sense Engine' value was already set to 'default'.

@charliesabino
Copy link

Having the same issue.

@sean-mcmanus sean-mcmanus added bug Language Service regression A bug that didn't exist in a previous release remote investigate: repro This issue's repro steps needs to be investigated/confirmed labels Nov 20, 2023
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 20, 2023

@RahulSisondia Can you run the C/C++: Reset IntelliSense Database command from the command palette? Does that fix it?

@sean-mcmanus sean-mcmanus self-assigned this Nov 20, 2023
@sean-mcmanus
Copy link
Collaborator

@RahulSisondia @charliesabino Is the issue fixed after downgrading to 1.17.5?

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Nov 20, 2023
@RahulSisondia
Copy link
Author

@RahulSisondia Can you run the C/C++: Reset IntelliSense Database command from the command palette? Does that fix it?

No. it doesn't fix the issue. I restarted the vscode server processes running on the remote box but that did not help either.
In one of my vscode instance rescanning of intellisense is completed. I don't know how. Perhaps I reconnected the machine next time.

@RahulSisondia
Copy link
Author

RahulSisondia commented Nov 20, 2023

@RahulSisondia @charliesabino Is the issue fixed after downgrading to 1.17.5?

@sean-mcmanus Indeed, downgrading to 1.17.5 seems to have fixed the problem. I can see intellisense rescanning in action with lot of log entries like tag parsing file: <> which was not the case with 1.19 and 1.18.5. Is it some known regression issue ?

Intellisense rescanning completed within 1-2 minutes while it is taking forever with latest versions.

I noticed log entries Request canceled by server (cpptools/getInlayHints, code: -32802, id: 31) with this extension too so my guess is that it is benign message not related to the regression.

@rsaim
Copy link

rsaim commented Nov 21, 2023

@RahulSisondia @charliesabino Is the issue fixed after downgrading to 1.17.5?

FTR, downgrading ms-vscode.cpptools-extension-pack to 1.17.5 worked for me too.

@sean-mcmanus
Copy link
Collaborator

With 1.18.5 we fixed a bug on Linux in which it wasn't using the $XDG_CACHE_HOME or $HOME/.cache. Does downgrading to 1.18.4 fix the issue? If so, there could be some issue with writing to that directory. #11693

@sean-mcmanus
Copy link
Collaborator

Does using these remote or workspace settings fix the issue? (or some equivalent path, FYI, the intelliSenseCache path can be shared by workspaces, but you don't want the databaseFilename to be shared).

  "C_Cpp.intelliSenseCachePath": "${workspaceFolder}/.vscode",
  "C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/vc.db"

@sean-mcmanus sean-mcmanus pinned this issue Nov 22, 2023
@RahulSisondia
Copy link
Author

Does using these remote or workspace settings fix the issue? (or some equivalent path, FYI, the intelliSenseCache path can be shared by workspaces, but you don't want the databaseFilename to be shared).

  "C_Cpp.intelliSenseCachePath": "${workspaceFolder}/.vscode",
  "C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/vc.db"

This did not fix the issue. I kept the path exactly as described. I could see
vc.db , vc.db-shm and vc.db-wal files were created in the ${workspaceFolder}/.vscode directory.

In the log the following errors in the log.

LSP: (invoked) cpptools/fileCreated: file:///home/rahul/src/.vscode/ipch
LSP: (received) textDocument/hover: file:///home/rahul/src/storage/innobase/fil/fil0fil.cc (id: 63)
IntelliSense client not available, using Tag Parser for go to definition.
IntelliSense client not available, using Tag Parser for quick info.
using Tag Parser for quick info
LSP: $/cancelRequest (textDocument/hover, id: 63)

@RahulSisondia
Copy link
Author

RahulSisondia commented Nov 23, 2023

With 1.18.5 we fixed a bug on Linux in which it wasn't using the $XDG_CACHE_HOME or $HOME/.cache. Does downgrading to 1.18.4 fix the issue? If so, there could be some issue with writing to that directory. #11693

using 1.18.4 also doesn;t fix the problem. Intellisensne doesn't work and I continue to see the followingn errors in log.

LSP: (invoked) textDocument/hover: file:///home/rahul/src/storage/innobase/fil/fil0fil.cc (id: 30)
IntelliSense client not available, using Tag Parser for go to definition.
IntelliSense client not available, using Tag Parser for quick info.
using Tag Parser for quick info
LSP: $/cancelRequest (textDocument/hover, id: 30)
LSP: (received) textDocument/hover: file:///home/rahul/src/storage/innobase/fil/fil0fil.cc (id: 31)
LSP: $/cancelRequest (textDocument/hover, id: 31)
LSP: (invoked) textDocument/hover: file:///home/rahul/src/storage/innobase/fil/fil0fil.cc (id: 31)
IntelliSense client not available, using Tag Parser for go to definition.
IntelliSense client not available, using Tag Parser for quick info.
using Tag Parser for quick info
LSP: (received) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///home/rahul/src/storage/innobase/fil/fil0fil.cc (id: 32)
LSP: (invoked) cpptools/textEditorSelectionChange

@sean-mcmanus sean-mcmanus unpinned this issue Feb 8, 2024
@Colengms
Copy link
Collaborator

Colengms commented Feb 9, 2024

Hi @RahulSisondia . Are you able to reproduce this issue with our latest pre-release, 1.19.2? There are some significant changes to how IntelliSense passes are managed and scheduled in 1.19.2. If this still occurs for you in 1.19.2, could you provide updated logs?

@Colengms Colengms assigned Colengms and unassigned sean-mcmanus Feb 9, 2024
@Colengms Colengms removed the investigate: repro This issue's repro steps needs to be investigated/confirmed label Feb 9, 2024
@RahulSisondia
Copy link
Author

Hi @RahulSisondia . Are you able to reproduce this issue with our latest pre-release, 1.19.2? There are some significant changes to how IntelliSense passes are managed and scheduled in 1.19.2. If this still occurs for you in 1.19.2, could you provide updated logs?
I had downgraded to 1.17.5 . Will try with 1.19.2 and get back.

@magdyabdel
Copy link

magdyabdel commented Feb 23, 2024

Does using these remote or workspace settings fix the issue? (or some equivalent path, FYI, the intelliSenseCache path can be shared by workspaces, but you don't want the databaseFilename to be shared).

  "C_Cpp.intelliSenseCachePath": "${workspaceFolder}/.vscode",
  "C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/vc.db"

Had a similar problem, any version higher than 1.17.5 would crash the language server. I am developing on a remote Linux SSH as well. However, the above settings did not work for me. But I remembered I used to have problems with mounted NFS directories. Long story short, my home directory (which also contains the workspace directory) is a mounted NFS directory. Thus the cache destination $HOME/.cache is NFS mounted as well and apparently something goes wrong when that is the case.

My solution:

  • Add a symbolic link to a local cache directory or use the above mentioned settings but instead of using the workspace directory refer to a local directory.

I hope this is somewhat useful for others who have the same setup. 😄

Edit: More information on the setup can be found in closed issue #7558.

@RahulSisondia
Copy link
Author

Hi @RahulSisondia . Are you able to reproduce this issue with our latest pre-release, 1.19.2? There are some significant changes to how IntelliSense passes are managed and scheduled in 1.19.2. If this still occurs for you in 1.19.2, could you provide updated logs?
I had downgraded to 1.17.5 . Will try with 1.19.2 and get back.

I am sorry, I still haven't got a chance to verify with latest version or 1.19.2. Hopefully I get to verify this week.
But I learnt from a colleague that problem persist with 1.19.4 as well. There were no logs provided though.

@RahulSisondia
Copy link
Author

RahulSisondia commented Mar 16, 2024

Hi @RahulSisondia . Are you able to reproduce this issue with our latest pre-release, 1.19.2? There are some significant changes to how IntelliSense passes are managed and scheduled in 1.19.2. If this still occurs for you in 1.19.2, could you provide updated logs?
I had downgraded to 1.17.5 . Will try with 1.19.2 and get back.

I am sorry, I still haven't got a chance to verify with latest version or 1.19.2. Hopefully I get to verify this week. But I learnt from a colleague that problem persist with 1.19.4 as well. There were no logs provided though.

I upgraded to 1.19.8 version today. I no longer see the problem.
Problem persisted till 1.19.4, but not with 1.19.8. It indicates issue is fixed after 1.19.4 release.
My guess is that it is fixed either through 1.19.5 or 1.19.6 versions.

@sean-mcmanus sean-mcmanus added this to the 1.19.9 milestone Mar 29, 2024
@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. and removed more info needed The issue report is not actionable in its current state labels Mar 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release remote
Projects
None yet
Development

No branches or pull requests

7 participants