Vscode: No results found when searching across all file managed by OneDrive

Created on 30 Sep 2017  路  28Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.16.1
  • OS Version: Windows 10 (insiders preview) 10.0.16299 Build 16299.
    I don't have the current release, so can't compare.

Steps to Reproduce:

  1. Open a OneDrive folder in VSCode. Note, all files have a green check status and are 'Available on this device'
  2. Ctrl+Shift+F to search across all files
  3. Enter a string that should produce results and press Enter
  4. No results found
  5. Copy the directory outside OneDrive. Repeat steps 1-3 and results are returned


Reproduces without extensions: Yes

bug search upstream verified

Most helpful comment

The upstream Rust issue is not seeing any progress, so I hope to come up with a workaround by the end of the month.

I don't think it's been called out in this issue yet, but this can be worked around by disabling ripgrep with "search.useRipgrep": false.

All 28 comments

Have you tried any other editors? Do they show results?

Maybe related to https://github.com/Microsoft/vscode/issues/27285

Can you check for errors in the developer tools (Help > Toggle developer tools) and the Search output pane:

image

I have exactly the same problem on

  • VSCode Version: Code 1.17.1 (1e9d36539b0ae51ac09b9d4673ebea4e447e5353, 2017-10-10T14:24:50.851Z)
  • OS Version: Windows_NT x64 10.0.16299

When I open folder C:\Users\<USER>\OneDrive\Documents\<FOLDER> then Search (Ctrl+Shift+F) and also Go to File (Ctrl+P) don't work.

When I open C:\Users\<USER>\Downloads everything works as expected.

Only ASCII characters are used in my <USER> and <FOLDER> names.

I haven't find anything relevant in Developer Tools Console.

EDIT!: In Search output pane I found:
c:\Users\<USER>\OneDrive\Documents\<FOLDER>: Access is denied. (os error 5)

Any special permissions on the Onedrive folder? Are you running Code as administrator? Are the Onedrive files actually on disk?

Thanks for hints. Finally I resolved the problem by turning off _Files On-Demand_ OneDrive feature.

files-on-demand

It seems that ripgrep doesn't work with _Files On-Demand_ feature even if all folders are selected in OneDrive Settings and _Always keep on this device_ is checked in File Explorer.

menu

In this case directories and files still have special link mode (reparse point attribute with no target) which ripgrep isn't able to process.

Thanks for great editor!

Glad you found a workaround. Do you know whether other editors work with this?

I tried Notepad++ and NetBeans and both are able to search OneDrive files when _Files On-Demand_ feature is turned on.

I also tried to add file which was only available online (using OneDrive web app) and after successful search in Notepad++ file had status _Available on this device_ (was downloaded during the search).

Ok, I'll have to find out how they prompt windows to download those files.

I don't think these editors do anything special for OneDrive files. I would guess they just open the file as usual and Windows downloads it.

I think we could try to ask ripgrep to support _Files On-Demand_. It has special handling for links so it could also handle these special "links" too.

The original report from @ericdching said that this happened even when all files are on the local device. I haven't had a response from him on questions above, and there are multiple reports of this behavior for off-device files, so continuing to use this issue for OneDrive issues in general.

Ticking 'always keep on this device' downloads all the files yet Visual Studio Code still cannot search the contents.

I tried closing OneDrive and putting the same files/folder in 'C:\Users\aaron\OneDrive' and 'C:\Users\aaron'. The search works in both locations but, when you reopen OneDrive, the search stops working on the OneDrive location even though the files are still there.

Windows indexes and searches within the files fine so the issue is with the way Visual Studio Code is searching within the file contents in conjunction with OneDrive. As I say, the files are definitely still on the hard drive so there is a problem with Visual Studio Code.

Are there any errors in the search output pane?

image

Unsuccessful search:

rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case --max-filesize '17179869184' --no-ignore --follow --fixed-strings -- 'test' 'c:\Users\aaron\OneDrive\MultiPoolMiner' 'c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\parts\welcome\page\electron-browser\vs_code_welcome_page'
 - cwd: c:/
 - Sibling clauses: {}
c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\parts\welcome\page\electron-browser\vs_code_welcome_page: The system cannot find the path specified. (os error 3)
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.

Successful search:

rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case --max-filesize '17179869184' --no-ignore --follow --fixed-strings -- 'test' 'c:\Users\aaron\MultiPoolMiner'
 - cwd: c:/
 - Sibling clauses: {}

but, when you reopen OneDrive, the search stops working on the OneDrive location even though the files are still there.

Strange. I haven't been able to repro this. Will keep trying...

Same issue here. Identical symptoms to above. Is there anything I can provide/do to help track this down?

Search output:
c:\Users\me\OneDrive\Documents\Visual Studio 2017\Projects\test: Access is denied. (os error 5)

Should note that the entire directory is already on-disk.

Did some further digging on this. When ripgrep is pointed at a directory that is in OneDrive with Files on Demand turned on, it fails as though the directory doesn't exist. If pointed at a specific file within that same directory, it's able to work just fine. This is exactly the same behaviour as here:
https://github.com/Microsoft/vscode/issues/27285

This will have to be fixed by ripgrep. I'll open a ticket up there soon.

@kevbry Great, I hope this gets fixed soon; OneDrive is an integral part of Windows these days.

I can repro it now after installing another Windows update. I was already on the latest Windows release, but I didn't have the latest OneDrive update for some reason.

Upstream bugs:

https://github.com/rust-lang/rust/issues/46484

BurntSushi/ripgrep#705

Hi @roblourens I have a live repro of this. All of the files in my "OneDrive - Microsoft" folder are downloaded locally to my machine. I can search my directory using Sublime. When I search using code, the Search Output Window shows this:

rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//.git' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//.svn' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//.hg' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//CVS' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//.DS_Store' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs/.dmp' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs/.dll' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs/.obf' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs/.mp4' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs//node_modules' -g '!/Users/jschwarz/OneDrive - Microsoft/workingdirs/**/bower_components' --max-filesize '17179869184' --no-ignore --follow --fixed-strings -- 'test' 'c:\Users\jschwarz\OneDrive - Microsoft\workingdirs'

  • cwd: c:/
  • Sibling clauses: {}
    c:\Users\jschwarz\OneDrive - Microsoft\workingdirs: Access is denied. (os error 5)

This is still very much an issue in the current version of VS Code. Has there been any progress on it? It looks like there hasn't been much activity on the upstream bugs...

FYI, got the latest stable version of VSCode, still repros 100% for me. Would be great to please get an update on when this might be fixed so that I can start using VSCode again.

Version 1.19.2
Commit 490ef761b76b3f3b3832eff7a588aac891e5fe80
Date 2018-01-10T15:55:03.538Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

The upstream Rust issue is not seeing any progress, so I hope to come up with a workaround by the end of the month.

I don't think it's been called out in this issue yet, but this can be worked around by disabling ripgrep with "search.useRipgrep": false.

Thank you @roblourens - That seems to have done the trick for me :-)

This will be fixed when we start building Insiders again.

I updated VS Code to v1.21 and the most important feature of every editor (search) still doesn't work. Even after 9 months no one can search and work properly on projects backed up by OneDrive :(

This was actually pulled from the 1.21 release.

Going into 1.22

I verified that the following works:

  • when the files are already available on my machine
  • when the files are not available on my machine. In this case the files are downloaded after the search.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  路  3Comments

trstringer picture trstringer  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

sirius1024 picture sirius1024  路  3Comments

chrisdias picture chrisdias  路  3Comments