Intellij Scanning Folders Outside of Project Root
I had a project open in the default location for Intellij under Windows, %USER%\Idea\%PROJECT%. After Intellij was open for a few days, I got a OneDrive notification that Intellij had triggered the download of a multi-gigabyte file in my OneDrive directory (if you don't know, Onedrive has a feature where it will only download certain files on demand. It will appear in the filesytem as a normal file, but when an application attempts to open it it will be downloaded)
The strange thing is this file was located in %USER%\OneDrive\Folder\AnotherFolder\%LARGE_FILE%. It seems strange to me that Intellij would be enumerating and attempting to open folders outside of the project root. At some point a few days ago, I had opened %USER%\OneDrive\Folder2\AnotherFolder in the same instance of Intellij, but it was a different folder.
Why is Intellij scanning my user directory and attempting to open files random files? This is strange and a little bit disconcerting, I've never had this happen before with any other application.
IntelliJ IDEA 2018.3.4 (Ultimate Edition)
Build #IU-183.5429.30, built on January 28, 2019
Licensed to Jayden Milne
Subscription is active until October 27, 2019
For educational use only.
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Please sign in to leave a comment.
Hello,
What file did IDE try to download? Aren't there any linls to that file in opened project?
It was an .MP4 file. The file had never even been accessed on this computer before, and there were no links to it. The sequence went something like this
1. Open IntelliJ project in %USER%\OneDrive\Folder
2. Close that project and reopen in %USER%\Idea\Project2
3. Suspend laptop for the weekend
4. Create large .MP4 file on another computer with the same OneDrive account
5. Start using laptop for something else, IntelliJ is running in the background, get OneDrive notification
Maybe there was a zombie filesystem watcher from #1 that hung around and was notified when the file was made? Maybe IntelliJ "subscribes" to the folder above the project folder, which would've been %USER%\OneDrive\ from #1, and then was notified when %USER%\OneDrive\Folder2\big_file.mp4 was created. But why did it try and open the .MP4 file?
Is it possible to reproduce the issue and provide idea.log ("Help | Show Log in...") afterwards? Logs might show why that file was accessed
I didn't attempt to reproduce the issue, but I can give you the log from when it happened. There didn't seem to be anything useful
https://pastebin.com/zVX3Rddu
Don't you have any file watchers configured (File | Settings | Tools | File Watchers)?
Did you copy the same project and open it from different location?
This is happening to me in this instance. IntelliJ 2019.3.5. It is downloading my vacation movies (.MOV) using OneDrive. IntelliJ is not responding while this is happening, so I guess I have to kill it hard. Will the logs be there once I restart IntelliJ?
I don't think I have any File Watchers, but I will check once restart IntelliJ.
@Flodinper are you sure your OneDrive folder has not got included in an IDEA project somehow?
@... I am now getting this problem in 2020.3.1. It is scanning my whole home folder for files. I cannot see anything included in my project settings which should not be there.
Where else can I check?
@Alwyn Schoeman is the problem reproducible with a demo project, or is it project specific?
@... Not consistently reproducible. I think it is related to a yet unidentified plugin that I am using. Seems to happen whenever there are updates and I restart. At the moment I have disabled all plugins to debug some other issues and it hasn't happened since then.
I have the exact same problem with a fresh install.
1. Brand new PC/OS Windows 10 Pro.
2. Connect to my O365 account. Some while ago I left a few movies on a desktop subfolder of a PC connect to the same O365 account.
3. Download PyCharm.
4. Open PyCharm.
5. Starting to get OneDrive notifications that Pycharm is downloading gigabytes worth of content.
I want to point out I didn't:
a) install any PyCharm plugging;
b) changed any of the default OneDrive nor PyCharm settings;
c) install nor ran any of my own programs / source code.
This is triggered by a crawling (for indexing purposes?) of all my desktop/windows profile files, including movies, pictures, documents, etc.
I went to File/Settings/System Settings/, unchecked "Synchronize External Changes when switching to the IDE window or opening and editor tab, quit and relaunched PyCharm... The crawling-triggered downloads continued unabated.
I then went to Files/Settings/Project: <...>/Project Structure and realized my current "project" (created by default when I launched the IDE) was the root of my Windows Profile.
First thing I tried was right-click/exclude all of my profile folders, which stopped the crawling-induced downloads.
Then I closed this project and created a new one somewhere else, on a "leaf" folder.
Conclusion:
- I solved my problem.
- A more experienced user would not have accepted the default "OS profile as a project" suggestion.
- JetBrain should safeguard newbie users from making this easy mistake, i.e. to just open PyCharm and click OK.
Steps to reproduce:
1- Fresh install PyCharm.
2- Open IDE, click OK.
3- Boom! Crawling of profile starts with adverse effect to download limits/fees, disk space, processing time.
Hi. Unfortunately not reproducible for me. When you have created your first project have you changed a project location? By default on a fresh install it should be ~/PycharmProjects/pythonProject.
Just happened to me as well. PHPStorm tried to download an online-only PST file from an external onedrive directory.
Joseph Levy was it referenced anywhere from your project roots, libraries or symlinks?
No. It is a folder that has zero interaction with PHPstorm projects. Not ideal to download an 18GB PST for unnecessary scanning. I wouldn't have noticed except that Onedrive warned me that it was trying to download the file on behalf of PHPStorm.
Please add the following in Help | Diagnostic Tools | Debug Log Settings:
```
#com.intellij.util.indexing.FileBasedIndexImpl:trace
#com.intellij.openapi.util.io.FileSystemUtil:trace
```
Analyze the logs to see what directory leads to it: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085.
This just happened to me with IDEA 2021.2.3 when I went to open a project. I assume the file dialog is scanning files/folders for caching/performance. I spent some time looking for a way to tell IDEA what my projects root folder is, but if there's a setting for it, it's well buried. If that is indeed what is happening it would be nice to be able to be able to tell the open dialog where to start. Since I don't use OneDrive to sync project files across computers, my solution was to just let OneDrive block IDEA.
Sean H
Default project directory can be selected under Settings/Preferences | Appearance & Behavior | System Settings:
I had the same issue this week with IntelliJ IDEA 2023.3.3 (Ultimate Edition) on Windows 10.
My default project directory was not set. Is it possible that, in some cases, IntelliJ defaults to indexing everything?
Hello Hans,
It would be great if you could provide idea.log ("Help | Show Log in…") after facing the issue to check recorded events. There might by symlinks or incorrect dependency/JDK configuration, so IDE starts indexing from the disk root.
See https://youtrack.jetbrains.com/issue/IJPL-386/Reduce-the-number-of-files-directories-operations-involved-in-VFS-refresh and the linked issues.
It may help if you add
ide.ui.new.file.chooser=true
in Help | Edit Custom Properties, close the IDE, delete the System directory: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory and start the IDE again.