opening a project with docker-compose.yml containing an xdebug-container starts containers automatically

PRECONDITIONS:

let's say I've got project a (wordpress docker stack) up and running correctly, with phpstom open and showing files in tree.

now I open via phpstorm another project (magento) via "Recent projects → ‘project2’

EXPECTED RESULT:

new project opens in phpstorm without starting any project's container

ACTUAL RESULT:

I'm stunned in seeying containers brought up automatically without me doing nothing as soon as phpstorm shows “checking php installation” after merely opening a phpstorm project.

Correct me if I'm wrong but that hasn't been the case for me in the last.. 10 years?

it seems something it wrong with 2024.3

details:

PhpStorm 2024.3
Build #PS-243.21565.202, built on November 13, 2024
Licensed to xxxxxxxxxx
You have a perpetual fallback license for this version.
Subscription is active until November 23, 2025.
Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 5.15.0-125-generic
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 8192M
Cores: 8
Registry:
 debugger.watches.in.variables=false
 run.processes.with.pty=TRUE
 ide.experimental.ui=true
 i18n.locale=
Non-Bundled Plugins:
 AWSCloudFormation (243.21565.122)
 com.intellij.ml.llm (243.21565.212)
 com.intellij.lang.jsgraphql (243.21565.122)
 ru.adelf.idea.dotenv (2024.3)
 de.espend.idea.php.annotation (11.1.1)
 fr.adrienbrault.idea.symfony2plugin (2024.1.276)
Current Desktop: ubuntu:GNOME
 

any idea what's going wrong here?

I tested many times and I see the xdebug-fpm container and mysql container coming up and running when opening the project in phpstorm, without even touching the terminal. 

I reckon this is directly connected to the phpstorm popup that says “checking php installation” and probably has something to do with xdebug being set up in Settings→php and Settings→php→debug. It seems that phpstorm cehck that configuration and brings up the container in order to check whatever it wants to check. the maria db database gets brought up because xdebug container depends on it.

is there any way to instruct phpstorm not to bring up automatically containers when just opening a project? this is dreadful because phpstorm fails due to the fact the project is brought up in an incorrect way (just a couple of containers that can not run indipendently based on the docker-compose.yml stack) and I'm forced to kill the IDE via terminal because  “checking php installation” will still be hanging after half an hour and can not be closed even clicking “cancel”.

thanks 

issue video: https://jumpshare.com/s/CEaAv4IIroMF73asgqAI

0

adding some more tests results:

worth noting that if I bring up (via docker-compose up) the magento project and open it (with no other projects opened with phpstorm) the “Checking PHP installation” pops up and hangs forever. I double checked that this will restart the xdebug and mysql containers. 

Also confirmed phpstorm is checking the xdebug container that was just brought up by the “Checking PHP installation” procedure: if I manually kill that container the phpstorm's “Checking PHP installation” procedure stops immediately.

why does the procedure hangs then? because the container was brought up in an unhealthy manner (no networks for example) and this do not allow the “Checking PHP installation”  to access the container.

also worth noting that in Settings→php→'Cli interpreter' if I open the xdebug docker setup I can confirm I checked “Connect to existing container ('docker compose exec')” and not the "Always start a new container ('docker compose run')”: hence the “Checking PHP installation” definitely does things it is not supposed to: here in the attachment can be seen without any doubt how "Checking PHP Installation..." clearly says it brought up the fpm_xdebug container. see the comment in the popup:

 docker-compose.yml up -d fpm_xdebug 

0

Hi there,

What do you have at “Settings/Preferences | PHP | Composer” ? At a very quick glance, it could be caused by the  “Check for available package updates” option.

If that option is enabled, will disabling and restarting the IDE do any better (after shutting down all those containers as well, of course)?

 

0

thanks Andriy. 

In reality the problem is that phpstorm brings up Docker containers when opening the project: just opening the project file-tree in the IDE causes the “Check PHP Installation” popup to appear and brings up the xdebug container. 

As you see in the last attachment this has nothing to do with composer.

the “Checking PHP installation” popup is clearly saying 

 docker-compose.yml up -d fpm_xdebug 

and this means “I'm in the process of firing up the fpm_xdebug docker container in a detached way” and this is confirmed when firing “docker ps” via terminal. But bringing up docker containers independently (only xdebug container and its dependencies) can not be done that way because there is much more going on in the project's docker-compose.yml (networks, volumes etc).

I've checked that the problem is caused by what is set in Settings→php→'Cli interpreter': It is checking the xdebug container because for some reason phpstorm at startup is instructed to do so. The main problem is: if in Settings→php→'Cli interpreter' I've cehcked the radio button “use existing container” there is NO reason whatsoever because at startup phpstorm should fire up the container if it is not already up.

key takeaway: phpstorm should NEVER bring up containers if not instructed to do so

0

请先登录再写评论。