PhpStorm freezes when trying to acces the PHP -> Servers settings
When I try to access the PHP → Servers settings, the entire IDE freezes and I'm forced to kill the process and restart. Unfortunately, since this is the last settings page I accessed, the IDE now freezes whenever I open the settings dialog.
I've uploaded my threaddump files here in the hopes that they will help:
Upload id: 2024_04_22_tdjS8b15LHmMdwUKWr7HX1
Please sign in to leave a comment.
Hey,
Thank you for sharing the freeze thread dumps.
Would it be possible to collect & share a full logs pack?
(Help > Collect Logs)
Hi here's my logs:
Upload id: 2024_04_23_6YpLJi7fKonFpZr7KtETdG
Thank you for sharing the full logs pack.
Basically, there is a similar issue on YouTrack:
https://youtrack.jetbrains.com/issue/WI-77238/PhpStorm-stuck-when-trying-to-create-a-new-Server
Both your case and the one mentioned above also have signs of the following issue:
https://youtrack.jetbrains.com/issue/WI-76242/UI-freezes-in-com.jetbrains.php.composer.lib.ComposerLibrariesNodePatcher.
So it might be related to the Composer subsystem or, to be specific, a structure/number of added packages.
Could you please tell a bit more about your project?
Do you have multiple composer.json files in it? Can you share a project's `.idea` folder as well?
Interesting…
I'm not using the AWS plugin. So the first issue you linked isn't really relevant.
However, the project is a drupal project with multiple contrib drupal modules which typically have composer.json files in them. So it's possible the second issue is related.
Here is my .idea folder (gzipped): Upload id: 2024_04_23_22e9ANTWmX9GbQRdwNeww8
Thank you for sharing the `.idea` folder!
Turns out it has nothing to do with the AWS plugin, it was just a theory.
Apparently, it is an aforementioned Composer issue causing this new problem. Personally, I have seen it on Magento and Drupal projects with lots of dependencies and child “composer.json” files.
We will try to reproduce it on our side and deliver a fix as soon as possible. Thanks again!
Just sharing that…
Mine has been frozen a couple of times on randomly different Magento 2 projects, upon clicking to PHP > Servers, regardless of the weight.
As a workaround, I first removed .idea folder so the IDE might start all over again and hopefully it worked.
Recently, I simply removed the path to composer.json and it's also resolved.
Looking forward for a fix soon.
Thanks.
the same happens for me with few Magento 2 websites
removing .idea directory helps
I have the same problem when upgrading to 2024.2 for all my magento installations. Basically freezes on the Php→Servers window.
Removing project's .idea helps but of course I lose all my settings for the project (xdebug, exlude and source folders ecc). Not really a viable solution but can be used as a last resort.
it seems something has changed on the way 2024.2 reads the xml files in .idea that contains the “Servers” list.
As a better workaround rename the .idea/workspace.xml file and it will work just fine. After a few tests it turned out it is the workspace.xml component composerConfigs:
there are no more that 70 lines in the file ComposerConfigs component.
this seems to confirm Vasiliy Yur theory about the issue being related to child composer files, but perhaps it's more complicated than that. I thought I could easily reproduce with a vanilla magento 2 installation. But the thing is this: let's say I have 10 different magento 2 projects: when you experience the issue with project “1" you can close project 1 and go to project “2”, “3” ecc and they all experience the issue as log as you have something already set in Php→Servers. But when you fix the .idea in the project "1" folder…. the other projects get fixed as well, no matter if they have their own .idea folder. This is absolutely weird for me and I can not find any explanation for that. Perhaps it has something to do with a global reindex being carried out after upgrade? this will lock many functions but if it is the case, the notice reindex in progress does not appear: it could simply be “under the hood” as a consequence of the 2024.2 upgrade.
**********
Furthermore, if submitting a report for an error it gives “Success” and then a successive popup with “Error” pops up and it is not possible to close the “Report error” popup window: it continues to popup in a loop. The only solution is killing phpstorm via terminal.
Running 2024.2 on Ubuntu 20.04.6 LTS
Hey,
Sorry, I have just noticed your reply.
From what I have noticed, “PHP > Servers” (and the whole tab in general) may freeze on an include paths enumeration. It might happen when the list of paths is abnormally huge. In one case, I have noticed more that 130k records most of those were simply duplicates (600+ cloned entries of each path). And of course, these freezes are reproducible for me if I manually create similar conditions in `php.xml` file by cloning <include_path> section contents several times.
The question remains why this list if filled with duplicates and why it mostly happen in Magento/Drupal projects, though.
Do you mind me asking to share a copy of an `.idea` folder next time you notice freezes in “PHP > Servers” before recreating the whole directory? That would help to prove my theory regarding the overgrowing `php.xml` and `workspace.xml` configuration files.
thanks Vasiliy Yur
sure no problem. I guess I can reproduce it opening a “old” project. I'll send you the .idea folder asap
by the way, where do you see duplicates? I mean, the “600+ cloned entries of each path”: in .idea/workspace.xml and .idea/workspace.xml?
I don't see any duplication in there. I just checked a magento 2 project.
let me try to launch it with the new phpstorm version just to check if it causes the duplicates. I'll sent you the .idea folder before and after it that happens.
thanks a lot
so Vasiliy Yur this is what I checked.
basically is not reproducible anymore using PhpStorm 2024.2.3 Build #PS-242.23339.16, built on September 25, 2024
what I see is that directly or indirectly it has been fixed by one of the latest builds
Hi,
Thank you for your reply!
From what I saw already, both `php.xml` (which is more important) and `workspace.xml` are affected. Namely, this section:
In the most recent case last week, there was more than a thousand (!) identical records for each library summing up the `php.xml`/`workspace.xml` file growth to 40+ MB.
Surely, the `.idea` folder recreation helps to get rid of these records for a while but the main thing that we cannot yet understand and reproduce is how those records appear multiple times. Also, it is yet unknown if it happens instantly after some external action or duplicated records are being accumulated over the time.
By the way, there is already an internal fix that mitigates freezes on abnormally huge `<include_path>` section. Once it fully tested for any possible side effects, hopefully, it will be introduced in nearest next versions.
mmh.. I can confirm I see no duplicates in workspace.xml and php.xml. I checked a dozen of projects and apparently the issue is not reproducible.
I can confirm It happened to me right after the phpstorm ide upgrade, and resrtarting ide/pc didn't help.