GoogleCloudPlatform / cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
Other
420 stars 111 forks source link

Docker was found in the path, but does not appear to be running #718

Open geoff-maddock opened 1 year ago

geoff-maddock commented 1 year ago

Type: Bug

Context

Extension version: 1.21.0 VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T16:59:02.252Z) OS version: Windows_NT x64 10.0.19044 Modes: Sandboxed: No Remote OS version: Linux x64 4.4.0-19041-Microsoft Remote OS version: Linux x64 4.4.0-19041-Microsoft Remote OS version: Linux x64 4.4.0-19041-Microsoft

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 2904)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.88GB (9.14GB free)| |Process Argv|--crash-reporter-id 1198c5ce-6457-42b5-bb84-e674193d7c19| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 4.4.0-19041-Microsoft| |CPUs|Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 2901)| |Memory (System)|31.88GB (9.14GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 4.4.0-19041-Microsoft| |CPUs|Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 2901)| |Memory (System)|31.88GB (9.09GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 4.4.0-19041-Microsoft| |CPUs|Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 2901)| |Memory (System)|31.88GB (9.15GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vscaat:30438848 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 pyindex848:30577860 nodejswelcome1cf:30587006 282f8724:30602487 f6dab269:30613381 ```

I've not used cloud code successfully yet in this context. I'm running the step; Click </> Cloud Code in the status bar at the bottom of the window and then select "Debug on Kubernetes".

It tells me "Docker was found in the path, but does not appear to be running. Start Docker to continue."

From the terminal, if I get docker info:

gmaddock@EXP11280:/c/Users/geoff.maddock/PhpstormProjects/hopper$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-buildx" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-buildx: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-compose: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 8
  Running: 0
  Paused: 0
  Stopped: 8
 Images: 345
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.102.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 24.96GiB
 Name: docker-desktop
 ID: KTWH:EQX3:TQQV:674K:4Q3D:KBAV:R53P:Y2ZV:YCQP:DBRL:AMKE:OW2F
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  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
sushicw commented 1 year ago

Hi @geoff-maddock, just to confirm, are you able to use docker successfully outside of Cloud Code?

One thing to check is permissions: docker is generally running as root, but your vscode+CloudCode instance probably is not, so it won't see docker as started. You can fix this with https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user.

geoff-maddock commented 1 year ago

Hi @geoff-maddock, just to confirm, are you able to use docker successfully outside of Cloud Code?

Yes, for example I run:

gmaddock@EXP11280:/c/Users/geoff.maddock/PhpstormProjects/hopper$  docker run hello-world

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

One thing to check is permissions: docker is generally running as root, but your vscode+CloudCode instance probably is not, so it won't see docker as started. You can fix this with https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user.

I looked at this - there already was a docker group, and I made sure I was added. Restarted. But still getting the same issue with cloud code.

I'm using Ubuntu in WSL2, and my docker instance is Docker Desktop.

sushicw commented 1 year ago

It looks like you're running vscode on windows rather than from within your Ubuntu install, is that correct?

I'm wondering if it's possible that your setup is confusing the platform-specific logic in Cloud Code, which may be looking for Docker to be started in Windows, not in Ubuntu.

Can you share more details about how you have vscode set up with regards to Windows and your Ubuntu instance on WSL2?

geoff-maddock commented 1 year ago

I'm a little hazey on where VS Code runs exactly, because I originally installed it via a windows install, but I think it is running in WSL Ubuntu. The reason I think so is because the project that I'm referring to has [WSL: Ubuntu] next to it, and in the lower left status bar:

wsl-status-bar

The code I'm running typically is running in my k8s cluster and I build and deploy it via skaffold (via commandline in WSL:Ubuntu), which uses docker and the local docker daemon

sushicw commented 1 year ago

Got it, that looks like it's set up for remote development using this, so it's sort of both at once. 😁 We'll have to see if we can reproduce your error. Thanks!

j-windsor commented 1 year ago

Hi @geoff-maddock. Sorry for the late response. We will look at this soon. For now, a possible workaround is to start docker manually on WSL2.

SKrupa commented 1 year ago

I've not been able to reproduce this exact issue, but when I remove the docker-buildx, docker-compose, docker-scan I do see some failures. Could you try to to "docker plugin install" these 3 plugins and confirm they are present in "/usr/local/lib/docker/cli-plugins/"?