Why do I have to invalidate my cache fairly often?
PhpStorm 2017.2.4
Build #PS-172.4155.41, built on September 15, 2017
JRE: 1.8.0_152-release-915-b11 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
It was probably about 3 months ago I had an issue where my "Navigate to File" function was not showing any results. I found a forum topic that said to invalidate my cache and restart. Voila, it worked. Although, ever since then I've been having to do this fairly regularly. Sometimes as much as 3 times a week.
Is there a reason the cache becomes corrupt and I need to invalidate it frequently? How/Can I stop this from being a weekly routine?
Please sign in to leave a comment.
Hi there,
TBH -- no idea. But it might be related to one of the plugins that you are using (custom one, not bundled by default). At very least I remember seeing something like this in one of the the Issue Tracker tickets.
Therefore:
1) Check your idea.log for possible hints/exceptions (you may empty so it has only most recent info) -- "Help | Show Log in XXX"
2) Try with all custom (not bundled by default) plugins disabled (at very least for a day or so). If you cannot disable ALL of them .. then try leaving only 1-2 that you desperately need -- at very least it should narrow the scope (if the issue is in plugin, of course)
Hello,
Do you work with files located remotely over mapped share or some other way by any chance?
What's funny is that I wrote this comment out of frustration, and then haven't had the problem since. I'm hopeful the problem was OS related and has been magically fixed with some update there.
@Vladimir, the files are local
@Andriy, thank you. I like log files and had no idea these existed. next time it happens I'll be looking here first.
I have the same problem... I have to clear the cache very often. After reading these posts, i have figured out, that the File Search does not work after restarting PhpStorm.
Maybe it is related to the indexing process during the shutdown, because this is the only error i get in the log file:
How can i prevent restarting PhpStrom by 'Invalidate caches'?
Thanks in advance.
@Falko Matthies
Please provide whole log (as a text file to download -- do not post actual content here).
So far it could be:
I have uploaded the file to ftp://ftp.intellij.net/.uploads/ The name is 115000667144-idea.log
@Falko Matthies
Thanks.
Lets hope JetBrains support team will notice it soon. If not -- ping here again.
P.S. I do not work for JetBrains so cannot help you on this as I simply cannot see uploaded into that location files.
@Andriy Bazanov
Thanks for your fast reply. I have uploaded the content to https://pastebin.com/wfhQg3Lz.
Todays start produced also two errors:
Please disable ALL custom (not bundled by default) plugins, Invalidate caches (File | Invalidate Caches) and restart IDE -- see how it will behave this time.
You do have .ignore plugin installed. The previous 2.3.0 version was the main reason for such behaviour. The latest 2.3.2 (which you have) should have it fixed (and by reports from other users -- it works OK for them now).
How often did you you need to do invalidating caches till now? Lets see how it will behave will all plugins disabled.
If it will work OK for few hours -- you may re-enable some plugins (I guess "PHP Annotations" and "Symfony plugin" are the most important for you). Enable the most critical first and see how it will behave again. If all good -- enable the rest -- maybe the issue will disappear completely this time.
P.S. 2017.3 was released yesterday. Try upgrading -- it does better in this particular regard (no such issues reported so far AFAIK).
@Andriy Bazanov
I have disabled all the custom plugins step by step. As you said, after disabling the ignore plugin, the indexing worked fine and i did not need to invalidate the cache anymore. The curious thing, after enabling only the ignore plugin the ide keeps working correctly. I have reenabled the plugins (also step by step) and everything works fine.
Later i have updated PhpStorm to 2017.3 (and also some plugins were updated) and everything works still correctly. There are some (new) errors in the log file, some regards to the symfony plugin, some to other plugins but i dont have the problem to invalidate the cache anymore. I have observed the behavior and the logs about one week and it looks good.
Thank you!
Looks like this is still happening in more recent versions. Turning off the .ignore plugin seems to have solved the problem for me too.
This is happening crazy often lately for me and my collegues. We basically lost tons of time because "find references" would find only a part of them and we would later discover there are more. Will check the .ignore plugin angle for starters.
Nejc, I would suggest contacting us directly: there might various reason for this, starting from a project location and ending with 3rd party plugins.
For the record, I had to turn off both the .ignore plugin and the AWS CloudFormation plugin. Once I got rid of both of those, everything went back to working fine.
I'm on 2018.2.5 and this happens to me almost every time when I add new project into gradle build and refresh gradle. Or when I install artifact into local maven repo, so in that case IntelliJ has to switch reference to such lib from remote repo into local repo. Switching itself works fine, but some other classes are not compiling.....
I did not find any hints/exceptions in log.
Maciej, please submit your logs within a support ticket, the IntelliJ guys will take a look:
https://intellij-support.jetbrains.com/hc/en-us
Should I create new ticket, or attach to this one?
Please use the Submit a Request button, it'll create a personal ticket and not a forum thread.
This link/request below is related to this question. Please let the Idea folks know this is important. There's really no excuse for this kind of problem to drag on. It feels like we loose hours and days of build failure troubleshooting because of it. Thanks.
https://youtrack.jetbrains.com/issue/IDEA-203100
this happens to me every few project switches and as I work on several small related microservices, I need to switch projects a lot. I lose about 30-45 minutes a day waiting for index rebuilds after invalidating...
I only have official flutter, protobuf and markdown plugins installed on top of android studio.
It's annoying enough that I'm forced by google to use this software and now it's also so unreliable...
I'm now on 2021.2.3 Intellij/Webstorm/PyCharm and do not have to invalidate cache almost at all. At least for me the situation has improved.
Thanks for the update!
so could we please get info in which version the fixes to this problem were introduced? it would be very useful in case of Android Studio to know if it is sufficient to switch to beta (based on 2021.1.1) or if it's necessary to go for canary (2021.2.1) or if neither of these will help (in case fixes were introduced in 2021.2.3).
Thanks!
This thread is back from 2017. In mid-2021 another related issue was reported: https://youtrack.jetbrains.com/issue/IDEA-275337. Majority of recent complaints were caused by it.
The problem was fixed recently & the fix should be included in IntelliJ IDEA-based IDEs version 2021.2.3.
Unfortunately I can't say what Android Studio version has this fix included & if it suffers from this problem at all. But I would still suggest to install the most recent beta build of it & check if the problem happens there.
for anyone coming here from Android Studio stable release (based on idea 2020.3.1 as of 2021/11) :
for me in 95% of cases this problem seem to affect only classes from my own project and I've noticed that instead of "invalidate caches / restart" which takes 1-5 minutes, issuing from a terminal in a project's root folder
solves the issue 95% of times. This method takes only about 10-15 seconds, including opening terminal and typing :)