Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Hello

So recently I switched to a new PopOS 20.04 laptop.  I migrated all my Setting to PhpStorm 2020.3.  I have docker setup and it is running fine:

john@tandem:~$ groups
john adm sudo docker

john@tandem:~$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

 

So for some reason my PhpStorm will not connect to the docker daemon even though my local docker setup is working and the hello world example works just fine.  I see the following:

 

I have tried just about every suggestion out there to no avail.  It is not detecting docker or any of the containers.  Here is the weird part.  On a project in which I moved the .idea folder from my old laptop, it still shows the message but it also has the docker image and I can run my XDebug on this project only:

 

Very odd and I can't figure out what is happening.  Any insight would greatly be appreciated. 

1
26 comments

Probably, logs could tell more here (Help > Collect Logs).

Also, I have a little bit silly question but nonetheless, could you please check if you have the correct version of a Docker plugin installed? ("Plugins" section) 

0

Hello

Looks like I do have the docker plugin installed:

 

Here is a link to the logs files: https://www.dropbox.com/s/jxblj9l9w1q4eod/php-storm-logs.zip?dl=0

0

Hi!

Thanks for attaching the log files pack. Unfortunately, there are no related errors excluding the obvious:


2020-12-16 19:36:02,897 [ 0] ERROR - .intellij.docker.agent.ApiTask - com.intellij.docker.agent.DockerAgentImpl$1@40bb2581
com.intellij.docker.agent.ApiTaskException: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

In the meanwhile, I have found a similar fresh report for the IDEA 2020.3:

https://youtrack.jetbrains.com/issue/IDEA-258012

There are no details yet but the input data looks the same (yep, the error is too generic for a direct comparison but nevertheless), so it could be useful to subscribe for that ticket and follow its progress.

By the way, I was wondering if it is an option for you to install the PhpStorm 2020.2.4 in parallel (with JetBrains Toolbox for instance). Will it work there?

0

Hello

It does work in 2020.2.4 it seems.  I will purge my 2020.3 and just use 2020.2.4 for now.

0

Hey,

Thanks for checking it, I have added an internal comment with this information to the YouTrack ticket mentioned above, hope it helps.

0

Could you please 

- add into the custom debug log settings (Main Menu | Help | Diagnostic Tools | Debug Log Settings...) the following line: 

#com.intellij.docker

- reproduce an issue 

- also, please launch the terminal tool window from the IDE, and launch `ls -la /var/run/docker.sock` there

- and attach the fresh IDE logs and the terminal output to the https://youtrack.jetbrains.com/issue/IDEA-258012

Thanks 

0

Michael Golubev Should I put the # before that setting?

0

> Should I put the # before that setting?

Yes, please paste the line exactly as specified. 

 

0

I have the same issue. The docker.sock is there. I can run docker without sudo. I even gave it 777 permissions and the IDE still says it can't find it. There's obviously a bug somewhere. (The logs aren't clear, they just mention the connection failing)

0

Is there a chance to share the logs pack (Help > Collect Logs and Diagnostic Data) & screenshots of your config? You can share them privately using https://uploads.jetbrains.com/

0

Hey, as you mentioned PopOS: Did you install via the popShop? Because it uses flatpak, i had to run this command to give IntelliJ access to the docker.sock (you probably have to change Intellij to PhpStorm)

flatpak override --user --filesystem=/run/docker.sock com.jetbrains.IntelliJ-IDEA-Ultimate

https://github.com/flathub/com.jetbrains.IntelliJ-IDEA-Ultimate/issues/22

13

Pycharm 2021.3.3, Docker 20.10.13, plugin 213.7172.26

in my case helped adding user to docker group, log out/in, and then:

sudo chmod a+rwx /var/run/docker.sock
sudo chmod a+rwx /var/run/docker.pid
43

@emc, thanks, it helped.
(If the error is with "(Details: [13] Access denied)", then this will help).

3

emc Brilliant! It works, ty!

2

emc thanks man it did work 

I was having this from last 2 days

1

Just restart the pc. it worked for me after scratching my head for 2 hours

1

Tobias Sobczyk's solution worked for me with the Flatpak version installed

0

I had the same problem on my new machine.  After rebooting the Mac, a dialog box asked for permission for Docker Desktop to create a Symbolic Link on /var/run/docker.sock.  Once I gave permission the Docker Extension in GoLand IDE worked.

I must have missed this permissions dialog box when I installed Docker Desktop previously.

Mac OSX Ventura / GoLand 2022.3.2

2

I encountered this bug, nothing helped but I found a workaround by using tcp socket. Here is some helpful answer with instructions how to setup custom tcp socket for docker.service https://stackoverflow.com/a/71839306/21598466

Ubuntu 22.04 LTS

0

You need to enable docker socket:

working on Mac M1

26

I had to disable the "default Docker socket" feature -> apply & restart, then re-enable it (and Apply & restart again) to fix the issue. 

2

frank7dev thx, your hint solved it.

0

Thanks frank7dev

JetBrains can you please add a helper line in the plugin saying might need to go to Docker Desktop and switch that flag on the socket error

2

just to bump this

- Kudos to frank7dev

- Please JetBrains a more helpful message here would be a cheap way to save a lot of dev time imo

0

emc thank you. I was coming from docker forums and same problem was replicable with Docker Desktop when I was trying to change from desktop-linux to default builder. Immediately both RustRover and Docker Desktop were working with default builder.

0

Please sign in to leave a comment.