microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Search error: ENAMETOOLONG #98514

Open xavier-ottolini opened 4 years ago

xavier-ottolini commented 4 years ago

When I press on Ctrl + P and enter the name of some JS or TS file, the files are not found. Only the last opened files are available. This is a recent problem, that appeared on the 1.45.1 version of Visual Studio code.

roblourens commented 4 years ago

Can you share some more details and check whether the tips in https://github.com/microsoft/vscode/wiki/Search-Issues#missing-search-results help?

xavier-ottolini commented 4 years ago

Hello Rob,

I have read the tips. The files that I try to open with Ctrl + P are not in a seach.exclude setting, files.exclude settings or in .gitignore settings. If I try to search them with Ctrl + shift + F, the files are found. The files are encoded in UTF.

I have notice that when I try to quick open with Ctrl + P a file, a message "spawn ENAMETOOLONG" is displayed in the status popup window.

I some logs can be enabled to get more information, could you tell me how to enable them and find them ?

roblourens commented 4 years ago

I have notice that when I try to quick open with Ctrl + P a file, a message "spawn ENAMETOOLONG" is displayed in the status popup window.

Ah, that's a good clue. We are probably generating a command line command which is too long. Please do the following

image

xavier-ottolini commented 4 years ago

Here is the log output. quick-search.log

roblourens commented 4 years ago

Ok, yeah you seem to have tons of excluded folders, so the command that we generate is too long. I should try to improve this experience so I'll leave this open.

roblourens commented 4 years ago

You can work around it by getting rid of some excluded patterns, or moving those patterns to a .ignore file.

xavier-ottolini commented 4 years ago

Hello,

Thank you for your advices of workaround by removing some excluded patterns. He have also noticed that when the paths overrides 70 characters, there are some problems to search.

Regards,

Xavier

ghost commented 3 years ago

I have the same issue, the message "spawn ENAMETOOLONG" pops up in several occations (including search). This always happens when I have many "files.exclude" entries in the settings.json. In my current project I have 1242 exludes set, this is obviously not supported. The entry count seems to be less relevant, it is the sum of the entry lengths that matters!

bartroozendaal commented 2 years ago

As mentioned in the linked issue #149727: introducing an option to not add the excluded files to the search command parameters would solve this issue (for me). The files you want to exclude from the search can be added to an .ignore file

avroemans commented 1 year ago

Issue is still apparent

avroemans commented 1 year ago

Does anyone have a temporary fix or something so I could try debugging this problem? It's really annoying since I use the search option very often.

bradlitterell commented 1 year ago

This problem JUST started happening to me today. It comes/goes based on the setting of the exclude button in search:

However, my list of exclusions seems short: .dbb,.evt,.log,.err,.rec,.asmdump,.symmap,.map,*.wrn

and it happens when the exclusions are NOT excluding anything (i.e. when all files are searched).

I have seen other reports based on number of open files, or number of source-control-pending files, but I have neither. I also have all extensions disabled.

Can someone please provide more details about the cause and workarounds/fixes here? This has apparently been a long-standing bug.

Thanks!

2023-05-26 16:03:02.918 [error] A system error occurred (spawn ENAMETOOLONG): Error: A system error occurred (spawn ENAMETOOLONG) at M (vscode-file://vscode-app/c:/Users/bradlit/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1829:6480) at vscode-file://vscode-app/c:/Users/bradlit/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1837:4256 at async vscode-file://vscode-app/c:/Users/bradlit/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1837:2747 at async e.SearchService.textSearch (vscode-file://vscode-app/c:/Users/bradlit/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1837:2022) at async e.SearchModel.H (vscode-file://vscode-app/c:/Users/bradlit/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2246:10010)