php-perfect / ddev-intellij-plugin

DDEV Tool Integration for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/18813-ddev-integration
BSD 3-Clause "New" or "Revised" License
109 stars 15 forks source link

DDEV integration entered unknown state by timeout #83

Open graham73may opened 2 years ago

graham73may commented 2 years ago

Is there an existing issue for this?

Are you sure that this bug is related to this DDEV Integration Plugin?

Enter your error report ID (If available)

No response

Describe the bug

This notification triggers a lot.

Example from just doing general debug work on a project, loading a drupal site in the browser etc.

image

I can't work out what's causing it, I'm not interacting with any ddev commands or the plugin. My main suspicion was ddev xdebug on/off but I can run that pretty harmlessly.

Thought maybe Drupal was quite heavy... so tried a plain php mini site I have. Same behaviour: image

Steps to reproduce

  1. Enable the plugin
  2. Use the website in the browser, the notification just passively goes off every so often.

Additional context

No response

alexbogias commented 1 year ago

@nico-loeber Send you an email yesterday if you were available to work on it with a screen share. Maybe my mail is in you SPAM or something :(

nico-loeber commented 1 year ago

Thanks for your email @alexbogias and the information in it! I got it yesterday and it was not in spam but sadly I didn't had any time for a screenshare.

It looks to me like this is a WSL issue in your case. I had this kind of error in the past as well, sometimes I tried to restart phpstorm and got different other errors as well, for example that my git version is out of date or even that there is no git installed. This was caused by the git --version command that timed out / failed in the WSL.

You can try to restart WSL by running wsl --shutdown in a powershell. You might need to restart docker desktop, as it will get in trouble when its linux backend is gone. ;)

Please try this the next time and give feedback.

rositis commented 1 year ago

This error occurred with me this morning when waking my computer. It had been in sleep mode overnight, but the error did not trigger until many hours later, around 6:00am this morning.

Screenshot 2023-08-09 at 11 31 39 AM

Clicking on the 'Sync DDEV State' has no visual effect or recovery and the message remains.

rfay commented 1 year ago

I have found this as well. I can ignore the error, but it's not clear what happens when you "Sync DDEV state".

IMO this mostly happens when you open a DDEV project and DDEV is not running.

nico-loeber commented 1 year ago

I have found this as well. I can ignore the error, but it's not clear what happens when you "Sync DDEV state".

This message informs you, that ddev describe failed to execute for some reason. It should happen together with an error you can report, that gives you more detail why it failed.

If ddev describe fails, ddev features like the start / restart / poweroff buttons will be disabled, since the plugin does not know the current state of ddev. By clicking "Sync DDEV State" the state of the plugin gets reset and the ddev describe is executed again. If everything works fine the status, shown on the lower right corner, will switch from "Unkown" to "Running".

vpermits commented 1 year ago

Happens when I do a ddev snapshot restore. PHPStorm 2023.2

langlers commented 1 year ago

I just switched from laravel valet to ddev and am getting this error constantly. Running Colima with qemu on an M2 mac.

Is there a way to keep the ddev plugin enabled in phpstorm but stop the popup notifications when this happens? You can clearly tell when it occurs by the ddev status indicator.

nico-loeber commented 1 year ago

Is there a way to keep the ddev plugin enabled in phpstorm but stop the popup notifications when this happens? You can clearly tell when it occurs by the ddev status indicator.

This shouldn't happen at all, that's why I added the notification so I get feedback on this. Sadly it seems quite inpredictable and hard to debug, at least on my hardware so this is an issue that exists for quite a long time, even there were alreadys some improvements on this. I can maybe add something like an "Accept and Don't show again" option. What do you think about it @langlers?

nico-loeber commented 1 year ago

Happens when I do a ddev snapshot restore. PHPStorm 2023.2

@vpermits, thanks for your feedback! I will check if this is reproducible for me.

langlers commented 1 year ago

Is there a way to keep the ddev plugin enabled in phpstorm but stop the popup notifications when this happens?

I can maybe add something like an "Accept and Don't show again" option. What do you think about it @langlers?

@nico-loeber I think an option to stop the notifications would be useful for anyone who keeps getting the error.

Following up, I've stopped getting the errors on my M2. I'm not sure why, but here's everything that changed that could possibly be related to the issue:

I hope that helps.

rfay commented 1 year ago

I'm pretty surprised you could ever have done 2GB with Colima... And DNS is consistently a problem with Colima.

@nico-loeber Orbstack is trending really strongly as an alternative to Colima. Not open-source, but really well maintained and super fast. You'll see it showing up in your world here.

langlers commented 1 year ago

@rfay Thanks for the suggestion! Switching to orbstack took less than 10 minutes, and ALL of the issues I was having while using colima are gone--including this one.

mandrasch commented 1 year ago

Seeing this too on frequently on

Colima was installed with recommended settings from DDEV docs (colima start --cpu 4 --memory 6 --disk 100 --vm-type=qemu --mount-type=sshfs --dns=1.1.1.1, only switched network driver to slirp).

If I can assist in debugging this somehow, happy to provide logs, etc. :)

(I'll consider trying orbstack as well in future)

mandrasch commented 1 year ago

I also switched to orbstack via https://docs.orbstack.dev/install#colima, works so far. 👍

But PhpStorm is still looking for colima for eslint. Could not find the setting for this (yet) 🤔

image

rfay commented 1 year ago

You may want to open an issue with Jetbrains in their PhpStorm queue to ask for Orbstack, if it hasn't already been requested.

mandrasch commented 1 year ago

Good news: I asked the support, but it turned out I just needed to hit "reset" here

image

After resetting, eslint it worked fine. 🥳

alexbogias commented 11 months ago

This error still exists in latest wsl / ddev / phpstorm and ddev phpstorm plugin :(

richarddewit commented 9 months ago

The timeout of 8 seconds is too short IMO. When I run ddev --version it consistently runs for 15 seconds

rfay commented 9 months ago

@richarddewit I'd be very happy to take a look with you. ddev --version should never take 15 seconds. Could you please show the output of time ddev --version ? And also please do a ddev debug test and put the output in a gist on gist.github.com and give a link here? (a text file attached would be OK also).

Here's what I see, the first time did take a second, the second time 0.1 seconds.

$ time ddev --version
ddev version v1.22.6

real    0m1.331s
user    0m0.028s
sys 0m0.054s
rfay@rfay-tag1-m1:~/workspace/ddev$ time ddev --version
ddev version v1.22.6

real    0m0.122s
user    0m0.020s
sys 0m0.040s
richarddewit commented 9 months ago

@rfay - I'm on MacOS btw (M2 Pro, Sonoma 14.1.1 (23B81))

$ time ddev --version
ddev version v1.22.6
ddev --version  0.07s user 0.09s system 1% cpu 15.494 total

ddev-debug-test.txt

rfay commented 9 months ago

@richarddewit I have no idea how you can get that, but I imagine it's because you have that misconfigured Fritzbox router. Would you mind reconfiguring it so that *.ddev.site works and maybe that will be the issue? See https://ddev.readthedocs.io/en/latest/users/usage/troubleshooting/#dns-rebinding-prohibited-mostly-on-fritzbox-routers

richarddewit commented 9 months ago

@rfay - ok apparently it only takes this long if I haven't run ddev start yet. Afterwards it's nearly instant.

rfay commented 9 months ago

With internet disabled (should be similar to your router problem) and ddev poweroff I see

$ time ddev --version
ddev version v1.22.6

real    0m0.208s
user    0m0.035s
sys 0m0.076s

I do think you'd be much happier if you do the simple reconfiguration of your Fritzbox router so DDEV doesn't have to add entries to your /etc/hosts file all the time :)

svrhovac commented 4 months ago

Using versions:

In the IDE there is popup info with the following text:

The DDEV Integration Plugin has lost track of the DDEV status. This most likely occurs together with another related error message. Please report this issue if it occurs repeatedly.

Info pannel reports this error: java.lang.IllegalStateException: There is no ProgressIndicator or Job in this thread, the current job is not cancellable. at com.intellij.openapi.progress.CoroutinesKt$runBlockingCancellable$1.invoke(coroutines.kt:128) at com.intellij.openapi.progress.CoroutinesKt$runBlockingCancellable$1.invoke(coroutines.kt:126) at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:83) at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:126) at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:121) at com.intellij.execution.wsl.WslIjentUtil.runProcessBlocking(WslIjentUtil.kt:63) at com.intellij.execution.wsl.WSLDistribution.lambda$patchCommandLine$2(WSLDistribution.java:239) at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:491) at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:464) at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:357) at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:86) at com.intellij.execution.process.OSProcessHandler.(OSProcessHandler.java:46) at com.intellij.execution.process.CapturingProcessHandler.(CapturingProcessHandler.java:20) at de.php_perfect.intellij.ddev.cmd.ProcessExecutorImpl.executeCommandLine(ProcessExecutorImpl.java:16) at de.php_perfect.intellij.ddev.cmd.DockerImpl.isRunning(DockerImpl.java:11) at de.php_perfect.intellij.ddev.state.DdevStateManagerImpl.initialize(DdevStateManagerImpl.java:42) at de.php_perfect.intellij.ddev.state.DdevStateManagerImpl.initialize(DdevStateManagerImpl.java:33) at de.php_perfect.intellij.ddev.InitPluginActivity.lambda$execute$0(InitPluginActivity.java:19) at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840)