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

Plugin doesn't detect WSL-based docker-ce #206

Closed rfay closed 1 year ago

rfay commented 1 year 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

PhpStorm 2023.1.4, DDEV v1.22.0-beta4

On DDEV WSL2, with docker-ce installed inside WSL2 (supported and discovered by PhpStorm) the plugin doesn't recognize that Docker is running:

image

Steps to reproduce

Set up DDEV WSL2 with the recommended setup (docker-ce in WSL2) https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/

With PhpStorm running on the Windows side, open a project in WSL2 (like \wsl$\Ubuntu\home\rfay\workspace\d10)

The plugin will report that docker is not running.

Additional context

PhpStorm still remains weak on Windows/WSL2. It doesn't know how to use docker-compose inside WSL2, for example,

nico-loeber commented 1 year ago

Hey @rfay, If docker-ce is installed inside the wsl partition the project is cloned to, there shouldn't be any problem. Please note, that the Docker settings of phpstorm are ignored, as the plugin will create its own docker configuration.

To check if ddev is available and therfore docker is available, the plugin will try to execute docker info inside the root directory of the project. It will automatically detect whether this is a WSL file system path and will then use a WSL shell instead of a windows one.

    public boolean isRunning(String workDirectory) {
        try {
            return ProcessExecutor.getInstance().executeCommandLine(
                    new GeneralCommandLine("docker", "info")
                            .withWorkDirectory(workDirectory),
                    5_000,
                    false
            ).getExitCode() == 0;
        } catch (ExecutionException e) {
            return false;
        }
    }

Could you please check if executing docker info in the project root returns a zero exit code in your setup?

rfay commented 1 year ago

I'm unable to recreate this today, so closing. docker info is quite successful, but I imagine it was before. It's possible that the docker client was in an unstable state when I filed this. Docker Desktop had inserted its version of everything...

nico-loeber commented 1 year ago

Okay, feel free to reopen this if there is aynthing we can add for compatibility.

rfay commented 1 year ago

Have it today,

image


 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.15.90.1-microsoft-standard-WSL2
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 7.575GiB
 Name: rfay-xps13
 ID: e3dae758-8a13-4178-935b-532d2516cf65
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: randyfay
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
rfay@rfay-xps13:~/workspace/d10$ echo $?
0
rfay commented 1 year ago

I think I figured out what was going on, and it seems to be a Windows/WSL2 problem. Neither the file explorer nor PhpStorm was recognizing \wsl$. I forced it in Explorer by clicking on "Linux", and it re-explored and got everything fixed. Then PhpStorm also saw it.