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

Search does not work #179121

Closed
czechdude opened this issue Apr 4, 2023 · 24 comments
Closed

Search does not work #179121

czechdude opened this issue Apr 4, 2023 · 24 comments
Assignees

Comments

@czechdude
Copy link

Type: Bug

I have no idea why, but in some projects the find all dialog just keeps spinning and nothing is found. I have no idea why. It says that extension host crashed 3 times.

VS Code version: Code 1.76.2 (ee2b180, 2023-03-14T17:55:54.936Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.38GB (16.89GB free)
Process Argv --crash-reporter-id 610a0a15-186b-4c52-aab4-df96ecdd5813
Screen Reader no
VM 0%
Extensions (40)
Extension Author (truncated) Version
vscode-angular2-files ale 1.6.4
vgs-ext1 csc 0.0.4
vscode-eslint dba 2.4.0
tslint eg2 1.0.47
prettier-vscode esb 9.10.4
monkey-c Gar 1.0.8
angular2-switcher inf 0.4.0
docthis joe 0.7.1
cmake-language-support-vscode jos 0.0.9
prettier-extension-monkeyc mar 2.0.60
Angular-BeastCode Mik 10.0.3
azure-pipelines ms- 1.208.0
vscode-azurefunctions ms- 1.10.4
vscode-azureresourcegroups ms- 0.7.0
vscode-azurestorage ms- 0.15.1
vscode-cosmosdb ms- 0.19.3
vscode-docker ms- 1.24.0
csharp ms- 1.25.4
vscode-dotnet-runtime ms- 1.6.0
isort ms- 2022.8.0
python ms- 2023.4.1
vscode-pylance ms- 2023.3.40
jupyter ms- 2023.2.1200692131
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.288.0
azure-account ms- 0.11.3
cmake-tools ms- 1.13.45
cpptools ms- 1.14.5
powershell ms- 2023.3.3
vscode-react-native msj 1.10.2
vscode-jest Ort 5.2.3
platformio-ide pla 3.1.1
tsimporter pmn 2.0.1
vscode-thunder-client ran 2.6.0
vscode-yaml red 1.12.2
sonarlint-vscode Son 3.16.0
cmake twx 0.0.17
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30610679
nodejswelcome1cf:30587006
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
vsctsb:30677850
pythonb192cf:30669361
defaultazurewalk:30687958
pythonms35:30701012

@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.77.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@IllusionMH
Copy link
Contributor

Are these "some projects" local or some kind of remote (SSH, container, etc.)?

@czechdude
Copy link
Author

All projects I open are in local directory, versioned with git. Everything is TS & node modules with package.json / yarn.

@DanRYoung
Copy link

I'm having a similar issue. My global searches do resolve -- just (incorrectly) with zero hits for any query. This behavior only occurs in a remote workspace (in my case, the Klipper repo) via Remote-SSH.

Property Local Box Remote Box
OS macOS Ventura 13.2.1 Raspbian (Debian 10)
Hardware M1 MacBook Pro Raspberry Pi 4B
code --version 1.77.0 (7f329fe) -
Workspace Clean Klipper repo Clean Klipper repo
Settings Sync Synced Synced
Global Search Works Fails, except for files open in the workspace
Search only in Open Editors Disabled Disabled

Of note:

  • The remote workspace remains unchanged from when I last (successfully) tried to use global search a few weeks ago
  • Unsuccessful attempted fixes:
    • Wiping remote ~/.vscode-settings
    • Trying a new workspace inside a fresh Klipper repo clone
    • Exhaustive permutations of toggling the Search only in Open Editors button, fiddling with include/exclude glob patterns, modifying various relevent Settings > Feature > Search parameters (e.g. Use Ignore Files), etc
    • Sacrificing a goat to Paimon to curry supernatural aid

None of this worked, and now I have to help my neighbor search for his lost goat. 😔 Hope someone has ideas. xoxoxo

@andreamah
Copy link
Contributor

andreamah commented Apr 4, 2023

Hi!
@czechdude does this still happen if you disable all extensions?

@DanRYoung if you run Developer: Set Log Level, select Trace, and do a search, what logs do you get from the Window channel in the Outputs tab?
image

@xfg68
Copy link

xfg68 commented Apr 5, 2023

I have exactly the same problem as @DanRYoung.
Started after upgrade to vs Code 1.77
Downgrading to version 1.76 resolves the issue.

@andreamah
Copy link
Contributor

@xfg68 which OS are you on?

@xfg68
Copy link

xfg68 commented Apr 5, 2023

@andreamah vs code is on windows 10 using remote - ssh to access files on a linux machine (debian).

@impinjineer2020
Copy link

I'm on Mac, can't search files on a remote rpi (debian buster). No results, no errors. Nothing in the server debug log as far as I can see. Local search works fine. Only results returned are in open windows.

@andreamah
Copy link
Contributor

andreamah commented Apr 5, 2023

@xfg68 @impinjineer2020 if you follow these steps, what logs do you get?

  1. run Developer: Set Log Level in the command palette and set Trace
  2. do a search
  3. In the bottom panel, check logs in the Window channel in the Outputs tab
    image

@impinjineer2020
Copy link

Oops I looked at the server dropdown not the window. Trace logging is very verbose, but doesn't say much for the actual search. Trace is great. Logs are slightly obfuscated. There are errors about looking in the project directory for things that aren't supposed to be there:

2023-04-05 11:43:52.400 [trace] SearchService#search: 49ms
2023-04-05 11:43:57.694 [trace] KeybindingService#dispatch F undefined
2023-04-05 11:43:57.821 [trace] KeybindingService#dispatch O undefined
2023-04-05 11:43:57.938 [trace] KeybindingService#dispatch O undefined
2023-04-05 11:43:58.205 [trace] KeybindingService#dispatch Enter undefined
2023-04-05 11:43:58.221 [trace] SearchService#search {"_reason":"searchView","folderQueries":[{"folder":{"$mid":1,"fsPath":"/home/pi/work/project","external":"vscode-remote://ssh-remote%xxx/home/pi/work/project","path":"/home/pi/work/project","scheme":"vscode-remote","authority":"ssh-remote+xxx"},"fileEncoding":"utf8","disregardIgnoreFiles":true,"disregardGlobalIgnoreFiles":true,"disregardParentIgnoreFiles":true,"ignoreSymlinks":false}],"usingSearchPaths":false,"onlyOpenEditors":false,"maxResults":20000,"type":2,"contentPattern":{"pattern":"foo","isRegExp":false,"isCaseSensitive":false,"isWordMatch":false,"notebookInfo":{"isInNotebookMarkdownInput":true,"isInNotebookCellInput":true,"isInNotebookCellOutput":true},"wordSeparators":"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"},"previewOptions":{"matchLines":1,"charsPerLine":1000},"usePCRE2":false,"userDisabledExcludesAndIgnoreFiles":true}
2023-04-05 11:43:58.284 [trace] SearchService#search: 54ms

It's expected that I don't have a node_modules:

2023-04-05 11:38:04.250 [trace] Error: ENOENT: no such file or directory, stat '/home/pi/work/project/node_modules': EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '/home/pi/work/project/node_modules'
at Function.create (/home/pi/.vscode-server/bin/b7886d7461186a5eac768481578c1d7ca80e2d21/out/vs/server/node/server.main.js:87:32962)
at n (/home/pi/.vscode-server/bin/b7886d7461186a5eac768481578c1d7ca80e2d21/out/vs/server/node/server.main.js:87:33098)
at t.Y (/home/pi/.vscode-server/bin/b7886d7461186a5eac768481578c1d7ca80e2d21/out/vs/server/node/server.main.js:92:39676)
at t.stat (/home/pi/.vscode-server/bin/b7886d7461186a5eac768481578c1d7ca80e2d21/out/vs/server/node/server.main.js:92:33044)

And it's expected that I don't have these files in my project:

.vscode/launch.json
.vscode/tasks.json

2023-04-05 11:38:04.251 [trace] Error while resolving configuration file 'vscode-remote://ssh-remote%xxx/home/pi/work/project/.vscode/tasks.json': Unable to read file 'vscode-remote://ssh-remote+xxx/home/pi/work/project/.vscode/tasks.json' (Error: Unable to resolve nonexistent file 'vscode-remote://ssh-remote+xxx/home/pi/work/project/.vscode/tasks.json')

@DanRYoung
Copy link

Hi! @czechdude does this still happen if you disable all extensions?

@DanRYoung if you run Developer: Set Log Level, select Trace, and do a search, what logs do you get from the Window channel in the Outputs tab? image

issue-179121.window-trace.log:

2023-04-05 13:05:37.951 [trace] [DEBOUNCE: Links] for vscode-remote://ssh-remote%2Bendy/home/pi/klipper/.gitignore is 1000ms
2023-04-05 13:05:37.997 [trace] [text file model] resolve() - enter git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D
2023-04-05 13:05:37.997 [trace] [text file model] resolveFromFile() git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D
2023-04-05 13:05:37.998 [trace] onWillActivateByEvent:  onFileSystem:git
2023-04-05 13:05:37.998 [trace] onWillActivateByEvent:  onFileSystem:git
2023-04-05 13:05:38.039 [trace] CommandService#executeCommand _setContext
2023-04-05 13:05:38.040 [trace] CommandService#executeCommand _setContext
2023-04-05 13:05:38.055 [trace] CommandService#executeCommand _setContext
2023-04-05 13:05:38.059 [trace] CommandService#executeCommand _setContext
2023-04-05 13:05:38.059 [trace] [DEBOUNCE: CodeLensProvide] for vscode-remote://ssh-remote%2Bendy/home/pi/klipper/.gitignore is 250ms
2023-04-05 13:05:38.062 [trace] CommandService#executeCommand _setContext
2023-04-05 13:05:38.063 [trace] [text file model] resolveFromContent() - enter git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D
2023-04-05 13:05:38.063 [trace] [text file model] doCreateTextModel() git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D
2023-04-05 13:05:38.126 [trace] [DEBOUNCE: Folding] for vscode-remote://ssh-remote%2Bendy/home/pi/klipper/.gitignore is 200ms
2023-04-05 13:05:39.049 [trace] [History stack global-default]: notifyNavigation()
2023-04-05 13:05:39.049 [trace] [History stack global-default]: notifyNavigation() not ignoring
2023-04-05 13:05:39.063 [trace] [text file model] dispose() vscode-remote://ssh-remote%2Bendy/home/pi/klipper/.gitignore
2023-04-05 13:05:39.064 [trace] [backup tracker] discarding backup vscode-remote://ssh-remote%2Bendy/home/pi/klipper/.gitignore 
2023-04-05 13:05:39.064 [trace] [text file model] dispose() git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D
2023-04-05 13:05:39.065 [trace] [backup tracker] discarding backup git:/home/pi/klipper/.gitignore.git?%7B%22path%22%3A%22%2Fhome%2Fpi%2Fklipper%2F.gitignore%22%2C%22ref%22%3A%22%22%7D 
2023-04-05 13:05:40.344 [trace] KeybindingService#dispatch Backspace undefined
2023-04-05 13:05:40.582 [trace] KeybindingService#dispatch T undefined
2023-04-05 13:05:40.658 [trace] KeybindingService#dispatch H undefined
2023-04-05 13:05:40.750 [trace] KeybindingService#dispatch E undefined
2023-04-05 13:05:41.071 [trace] SearchService#search {"_reason":"searchView","folderQueries":[{"folder":{"$mid":1,"fsPath":"/home/pi/klipper","external":"vscode-remote://ssh-remote%2Bendy/home/pi/klipper","path":"/home/pi/klipper","scheme":"vscode-remote","authority":"ssh-remote+endy"},"fileEncoding":"utf8","disregardIgnoreFiles":true,"disregardGlobalIgnoreFiles":true,"disregardParentIgnoreFiles":true,"ignoreSymlinks":false}],"usingSearchPaths":false,"onlyOpenEditors":false,"maxResults":20000,"type":2,"contentPattern":{"pattern":"the","isRegExp":false,"isCaseSensitive":false,"isWordMatch":false,"notebookInfo":{"isInNotebookMarkdownInput":true,"isInNotebookCellInput":true,"isInNotebookCellOutput":true},"wordSeparators":"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"},"previewOptions":{"matchLines":1,"charsPerLine":1000},"usePCRE2":false,"userDisabledExcludesAndIgnoreFiles":true}
2023-04-05 13:05:41.139 [trace] SearchService#search: 58ms
2023-04-05 13:05:49.378 [trace] onWillActivateByEvent:  onLanguage
2023-04-05 13:05:49.379 [trace] Started polling file:///Users/d/Library/Application%20Support/Code/logs/20230404T133732/main.log
2023-04-05 13:05:53.076 [trace] CommandService#executeCommand workbench.action.output.show.rendererLog
2023-04-05 13:05:53.079 [trace] Stopped polling file:///Users/d/Library/Application%20Support/Code/logs/20230404T133732/main.log
2023-04-05 13:05:53.104 [trace] Started polling file:///Users/d/Library/Application%20Support/Code/logs/20230404T133732/window1/renderer.log
2023-04-05 13:06:07.630 [trace] InteractiveSessionService#onWillSaveState: Persisting 0 sessions

Let me know if I can provide any other helpful info.

@andreamah
Copy link
Contributor

If you go to the "Extension Host" channel instead of "Window" and do a search with trace logs enabled, do you see a line that starts with RipgrepSearchEH#search and if so, what do the surrounding logs say?

Also, if you see a path that directly follows RipgrepSearchEH#search that leads to a rg file, what happens if you invoke that executable directly?

@DanRYoung
Copy link

DanRYoung commented Apr 5, 2023

If you go to the "Extension Host" channel instead of "Window" and do a search with trace logs enabled, do you see a line that starts with RipgrepSearchEH#search and if so, what do the surrounding logs say?

The Extension Host select value produces no useful logs during global search. The Extension Host (Remote) select value produces this log output: issue-179121.extension-host-remote-trace.log.

Also, if you see a path that directly follows RipgrepSearchEH#search that leads to a rg file, what happens if you invoke that executable directly?

Directly running the ripgrep command reproduces the above log file output (lines 9 & 11, respectively).

That's very helpful, @andreamah, thank you. The summary for any folks whose fetish isn't noodling through other people's log files: the VSCode remote host uses @vscode/ripgrep under the hood for global file search. When searching, this flavor of rg complains about missing the GLIBC_2.29+ dependency, then packs up its ball and goes home. My remote system has libc6 2.28 installed, hence the package collision.

@RuinanSun
Copy link

RuinanSun commented Apr 7, 2023

I think I have the same issue. My search is not working well in the remote session. I use ssh from MacOs(local) to remote linux(arm64)

I check the logs in Extension Host (Remote) but it says:

2023-04-07 09:15:03.550 [debug] RipgrepSearchEH#search <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

I'm not sure whether it's an issue of vscode.

@roblourens
Copy link
Member

The latest VS Code Insiders build has the fix for this issue- please let us know whether it works!

@impinjineer2020
Copy link

It appears that search in files works against a remote pi with the insiders I just downloaded:

Version: 1.78.0-insider (Universal)
Commit: ea0e3e0
Date: 2023-04-07T05:23:25.740Z
Electron: 22.4.4
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin x64 21.6.0
Sandboxed: Yes

@mycraftmw
Copy link

I still cannot search the files on the ssh-remote session to an aarch64-linux.

Version: 1.78.0-insider
Commit: ea0e3e0
Date: 2023-04-07T05:21:52.813Z
Electron: 22.4.4
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.2.10-arch1-1
Sandboxed: Yes

@andreamah
Copy link
Contributor

andreamah commented Apr 10, 2023

@mycraftmw this might be a different error if you're on aarch64 and not arm32

Try this:

  1. run Developer: Set Log Level in the command palette and set Trace
  2. do a search
  3. In the bottom panel, check logs in the Extension Host channel in the Outputs tab

@mycraftmw
Copy link

@andreamah , thanks to your advice, I did find something suspected in the Extension Host(Remote) channel.

2023-04-11 11:01:28.153 [debug] RipgrepSearchEH#search /home/tongyu/.vscode-server-insiders/bin/7f03ec6f7a48791d8027761b22773b454fc52478/node_modules/@vscode/ripgrep/bin/rg --hidden --ignore-case -g '!**/.git' -g '!**/.svn' -g '!**/.hg' -g '!**/CVS' -g '!**/.DS_Store' -g '!**/Thumbs.db' -g '!**/node_modules' -g '!**/bower_components' -g '!**/*.code-search' --no-ignore-parent --follow --crlf --fixed-strings --no-config --no-ignore-global --json -- 'hello' '.'
 - cwd: /home/tongyu/bitswiss
2023-04-11 11:01:28.161 [debug] RipgrepSearchEH#search <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search No data from stdout
2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search No result from parser
2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search 

@andreamah
Copy link
Contributor

@andreamah , thanks to your advice, I did find something suspected in the Extension Host(Remote) channel.

2023-04-11 11:01:28.153 [debug] RipgrepSearchEH#search /home/tongyu/.vscode-server-insiders/bin/7f03ec6f7a48791d8027761b22773b454fc52478/node_modules/@vscode/ripgrep/bin/rg --hidden --ignore-case -g '!**/.git' -g '!**/.svn' -g '!**/.hg' -g '!**/CVS' -g '!**/.DS_Store' -g '!**/Thumbs.db' -g '!**/node_modules' -g '!**/bower_components' -g '!**/*.code-search' --no-ignore-parent --follow --crlf --fixed-strings --no-config --no-ignore-global --json -- 'hello' '.'
 - cwd: /home/tongyu/bitswiss
2023-04-11 11:01:28.161 [debug] RipgrepSearchEH#search <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search No data from stdout
2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search No result from parser
2023-04-11 11:01:28.220 [debug] RipgrepSearchEH#search 

filed this under another issue in #179907 since this is not related to the ripgrep issues on linux arm32

@git9am
Copy link

git9am commented Apr 21, 2023

The latest VS Code Insiders build has the fix for this issue- please let us know whether it works!

Any clue when it's available in stable versions? How often is vscode usually updated?

@carlos-algms
Copy link

I'm having the same issue, and it seems to be the libc error as well:

2023-04-23 10:07:39.803 [debug] RipgrepSearchEH#search /home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.29' not found (required by /home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg)
/home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg: 
  /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.32' not found 
      (required by /home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg)
/home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg: 
  /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.33' not found 
      (required by /home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg)
/home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg: 
  /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.34' not found 
      (required by /home/pi/.vscode-server/bin/******/node_modules/@vscode/ripgrep/bin/rg)
ldd --version
ldd (Debian GLIBC 2.28-10+rpt2+rpi1+deb10u1) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.

@andreamah
Copy link
Contributor

The issue should be fixed in the newest VS Code Insiders. VS Code Stable is updated every month, and the next update should be soon. Closing this for now, since this bug shouldn't appear anymore. A more permanent fix will be tracked in microsoft/ripgrep-prebuilt#24

@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests