PHStorm freezes on Linux with WSL, I don't know which system to use anymore with Windows and WSL.

Hello,

I am very desperate, I don't know if I have to change my PC or what the hell to do.

I have installed PHPStorm in WSL2 with GWSL, and the only thing I have to do to open PHPStorm is to run the phpstorm.sh script inside my Ubuntu 18 WSL terminal.

But I really don't know what to do anymore, I can't work, and I'm very angry because I'm wasting my time waiting for PHPStorm to respond, and I need your help.

Here's what the PHPStorm terminal shows and I attach the file

cat /home/mysuser/.cache/JetBrains/PhpStorm2020.3/log/threadDumps-freeze-20210321-152529-PS-203.7717.64-CachingConstructorInjectionComponentAdapter.doGetComponentInstance-7sec/threadDump-20210321-152529.txt

Upload id: 2021_03_21_9j2yuLAAtLF8yogw (file: threadDump-20210321-152529.txt)

 

I also show some screenshots to see that despite PHPStorm freezing I still have enough memory.

 

 

27 comments
Comment actions Permalink

I run PhpStorm natively on Windows and access my files though the \\wsl$ share. There're certainly glitches (some tools get confused with paths and I get an occasional slowdown now and then) but performance is being acceptable so far.

1
Comment actions Permalink

I can't reproduce that on Windows 20H2, Ubuntu 20.04, and GWSL, seems to work fine for me.
A single thread dump is not really helpful, could you please collect the whole logs bundle (Help | Collect Logs and Diagnostic Data) and upload it in the same way>

0
Comment actions Permalink

When I do that I get this alert http://prntscr.com/10st3bm, and it opens the tmp directory, I don't know what I really have to upload http://prntscr.com/10st5fg

0
Comment actions Permalink

I also have a question, which may have better performance to mount WSL like http://prntscr.com/10st86v and access PHPStorm as if it was another normal directory (I'm sure I'll run into user permission problems, though.) or as I have it =>  installing PHPStorm directly on WSL with GWSL.

 
0
Comment actions Permalink

When I do that I get this alert http://prntscr.com/10st3bm, and it opens the tmp directory, I don't know what I really have to upload http://prntscr.com/10st5fg

There's supposed to be a file called phpstorm-logs*.zip. If it's not there, please archive and share the logs directory.

I also have a question, which may have better performance to mount WSL like http://prntscr.com/10st86v and access PHPStorm as if it was another normal directory (I'm sure I'll run into user permission problems, though.) or as I have it => installing PHPStorm directly on WSL with GWSL.

Performance-wise, the first method is supposed to be better, just make sure you don't use Windows paths (such as \\wsl$\mnt\*) from within WSL.

1
Comment actions Permalink

I also have a question, which may have better performance to mount WSL like http://prntscr.com/10st86v and access PHPStorm as if it was another normal directory (I'm sure I'll run into user permission problems, though.) or as I have it =>  installing PHPStorm directly on WSL with GWSL.

Eugene knows better than me about performance. Just a remark: PhpStorms detects it's a WSL setup from the path prefix so you'd need to access files as \\wsl$. If you map it to a drive letter it won't handle it properly.

0
Comment actions Permalink

Sorry for the delay. I don't understand. Do I have to assign it to a drive(Z:)? or do I have to access it through \\wsl$.? Because through \\wsl$.PHPStorm doesn't detect anything.

About the projects I have them in the /home/$USER/ directory and I access it that way, not the /mnt way. 

0
Comment actions Permalink

Do I have to assign it to a drive(Z:)? or do I have to access it through \\wsl$.? Because through \\wsl$.PHPStorm doesn't detect anything.

If you run PhpStorm natively under Windows you should be able to edit your files with either path, but if you use the UNC path (\\wsl$\...) PhpStorm will detect the files are hosted inside WSL2 and it'll offer some extra goodies. If you open them through a mapped letter, PhpStorm will handle it as any other Windows folder.

I don't know why it isn't working for you but the screenshot doesn't look like mine. Is that PHPStorm in WSL2 with GWSL?

0
Comment actions Permalink

No, that capture is installed in Windows to test what you told me. But I have it installed also inside WSL as I put in the capture of the first post, like any other installation of PHPStorm inside linux. But I run it inside the terminal because GWSL does not support shortcuts with ZSH, as I have the WSL terminal configured by default, so I run it as phpstorm.sh, and the window phpstorm is opens. That is why I was wondering if the best thing was inside Windows by mounting Ubuntu as if it were another hard disk, or as I currently have it, which is installed inside WSL as another Linux program. Equally installing within WSL I don't use \ \wsl$\ either, I use /home/$USER/myproject/*.php

0
Comment actions Permalink

In WSL when i open PHPStorm:

0
Comment actions Permalink

Do I have to assign it to a drive(Z:)?

Definitely not, this way, all WSL-related improvements we've made are not going to be used.

Because through \wsl$.PHPStorm doesn't detect anything

Please check how it goes in 2021.1 Beta, it might be this one: https://youtrack.jetbrains.com/issue/IDEA-252213
https://www.jetbrains.com/phpstorm/nextversion/

0
Comment actions Permalink

I still don't understand anything. I see that I will have to continue using my method of using PHPStorm with GWSL, because I'm not getting any clearer, on the contrary I'm getting confused. The only thing that is clear to me is that I did not use the disk mount of my Ubuntu

Then you sent me to an issue that says it is solved, but it is not solved, I can not open any path with \\wsl$ when the installation is on Windows, also I have been sent to nextversion at no time speaks WSL and the resolution of the problem in question.

PHPStorm on Windows is currently supposed to recognise WSL2 disks \\wsl$? What is the manual on how to do it?

 
0
Comment actions Permalink

Please can you clarify this for me.

0
Comment actions Permalink

PHPStorm on Windows is currently supposed to recognise WSL2 disks \wsl$?

Correct, please check the screenshot, it's version 2020.3.

What is the manual on how to do it?

There's no guide as it's supposed to work right away.

Then you sent me to an issue that says it is solved, but it is not solved, I can not open any path with \wsl$ when the installation is on Windows

I've sent you the issue because it might be the cause for \\wsl$ not appearing in File | Open for you.

also I have been sent to nextversion at no time speaks WSL and the resolution of the problem in question.

It wasn't supposed to, I've sent this link so that you could download and try 2021.1 Beta.
The Available in field of the issue has 2021.1 EAP 1 in it, which means that all subsequent 2021.1 builds also have this fix.

1
Comment actions Permalink

Ok, I'll give it a try. I'll be back in a while. Thank you very much.

0
Comment actions Permalink

Hello,

I have already tried it. Exactly with that version PHStorm does recognise the directory, and it seems to consume less memory than opening it directly on WSL with GWSL, but I've been testing it and I've found a big problem that I describe now.

I have been trying to edit a file, in this case an index.php, I have modified it, I have restarted Window and when I have reopened it, it appears empty, thank goodness that PHPSTORM has history and I have been able to recover it, lol (In history it appears as an external change.)

I have also tried to modify the file, close PHPStorm and reopen and nothing happens, but if it happens when I restart Windows, it is very strange. So for now I won't be able to use it, a pity.

When is this version supposed to be released to the official one?

0
Comment actions Permalink

Sorry, I am using version 2021.1 Beta, in case it helps.

0
Comment actions Permalink

I have been trying to edit a file, in this case an index.php, I have modified it, I have restarted Window and when I have reopened it, it appears empty, thank goodness that PHPSTORM has history and I have been able to recover it, lol (In history it appears as an external change.)

You basically killed PhpStorm with this action, so this result is not something unusual.
Frankly, I don't understand how this is a big problem, the resolution seems to be pretty simple - please avoid force-killing PhpStorm, as it can damage your files.

When is this version supposed to be released to the official one?

Hopefully, next week.

0
Comment actions Permalink

That I am not killing PHPStorm, that I have not described that I am closing PHPStorm, does not mean that I am not doing it. Of course, I close PHPStorm before restart windows. I don't know why this happens. But I don't think it's very nice that I spend a whole day working on a file, and then the next day it appears empty.

0
Comment actions Permalink

I have been trying to edit a file, in this case an index.php, I have modified it, I have restarted Window and when I have reopened it

I perceived this like you just restart Windows, not closing the WSL-based PhpStorm instance.
If it's not the case, we of course need to take a look at it. Please upload the logs in the way described above in this thread after you experience the issue again. Thank you!

0
Comment actions Permalink

I think it's clear already and also not particularly relevant to this problem, but since I did the research myself a few weeks ago... ;-) WSL2 stores its files in a virtual machine image file (and this only applies to version 2, version 1 stored its raw files right into your Windows partitions). That volume is exposed to Windows itself by emulating a network share. PhpStorm can edit WSL2 files from such share in any path that Windows itself recognises. That includes:

  • Raw UNC path: \\wsl$\Ubuntu-20.04\home\john\project\index.php
  • Drive letter the shared is mapped to: Z:\home\john\project\index.php
  • Symlinks or any other NTFS feature that points to the share: C:\Work\index.php

However, PhpStorm will not identify the project as being hosted within WSL2 unless the path starts with \\wsl$\

 

1
Comment actions Permalink

I have downloaded PhpStorm 2021.1 RC Build #PS-211.6693.78, built on April 1, 2021
and the same thing happens to me when I use PHPStorm on Windows using WSL2 Paths and Docker, I make a change in the index.php, close PHPSTorm and restart Windows, when I open the project again the index.php appears empty.

Upload id: 2021_04_02_T3jMrGmY4xoTupPu
0
Comment actions Permalink

Nothing in the logs, unfortunately. I can't reproduce that locally either.
Does it happen each time? If you close PhpStorm, but don't restart Windows yet, does the file on disk has those changes you've just made?

0
Comment actions Permalink

I have the same problem with the latest version of WSL 2, the latest version of phpstorm, the latest version of docker.

Phpstorm freeze, it no longer reads the files on the disk, the Webpack watcher no longer builds. Generally, Phpstorm takes a long time to synchronize with the linux disk.

Path directly on wsl :

File sync failed :

No color preview :

npm never finish building :

To solve it the way i have is to force stop phpstorm and restart windows 10 pro.

 

1
Comment actions Permalink

We need to check IDE logs here. If possible please contact us directly via Help | Contact Support or share your logs via https://uploads.jetbrains.com/ & let me know the upload ID.

0
Comment actions Permalink

I have the same problem, when I connect to WSL via the \\wsl$ path, Phpstorm freezes and comes back after some or a long time.

0
Comment actions Permalink

Do you mean there are freezes when you're trying to open a project inside WSL? That's a known bug: https://youtrack.jetbrains.com/issue/IDEA-273398. It's fixed & the fix will be included in the upcoming IDE update, it will be available tonight or tomorrow.

0

Please sign in to leave a comment.