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 error: ENAMETOOLONG #98514

Open
xavier-ottolini opened this issue May 25, 2020 · 12 comments
Open

Search error: ENAMETOOLONG #98514

xavier-ottolini opened this issue May 25, 2020 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member search Search widget and operation issues
Milestone

Comments

@xavier-ottolini
Copy link

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
Copy link
Member

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

@roblourens roblourens added the info-needed Issue requires more information from poster label May 27, 2020
@xavier-ottolini
Copy link
Author

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
Copy link
Member

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

  • Run the command "Set log level" and change it to "Trace"
  • Run the search again
  • Show the search-related messages in the "Log (Window)" output panel

image

@xavier-ottolini
Copy link
Author

Here is the log output.
quick-search.log

@roblourens roblourens changed the title Impossible to view the matching files with Ctrl + P Search error: ENAMETOOLONG Jun 5, 2020
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues and removed info-needed Issue requires more information from poster labels Jun 5, 2020
@roblourens roblourens added this to the Backlog milestone Jun 5, 2020
@roblourens
Copy link
Member

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
Copy link
Member

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

@xavier-ottolini
Copy link
Author

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
Copy link

ghost commented Aug 26, 2021

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
Copy link

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
Copy link

Issue is still apparent

@avroemans
Copy link

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
Copy link

bradlitterell commented May 26, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

6 participants