Spaceship-prompt: `Cannot connect to the Docker daemon`

Created on 29 Sep 2020  路  3Comments  路  Source: denysdovhan/spaceship-prompt

Current behavior

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

Expected behavior

Do not show docker info if docker daemon is not running

Relevant Zsh configuration (.zshrc)

source $HOME/.zinit/bin/zinit.zsh

SPACESHIP_PROMPT_ORDER=(
  package
  node
  golang
  docker
  kubectl
  exec_time
  jobs
  line_sep
  dir
  git
  char
)

zinit light denysdovhan/spaceship-prompt

Environment

Spaceship version: 3.11.2
Zsh version: 5.8 (x86_64-apple-darwin19.3.0)
Zsh framework: oh-my-zsh
Zsh plugin manager: zinit
Terminal emulator: iTerm
Operating system: macOS

Screenshot

Provide a screenshot that shows your issue.

image

Most helpful comment

For those of you who are stumbling across this issue and don't really care much about the docker version can simply disable the docker section using this environment variable.

SPACESHIP_DOCKER_SHOW=false

All 3 comments

Same here, I see it happens when there's a docker-compose.yml or Dockerfile in the directory but I guess it appeared after a recent automatic update because I didn't get this before with this same directory.

There seems to be a change between Docker client 19.03.8 (edit: I've pinned it down to 19.03.12) and 19.03.13 where, if docker cannot connect to the host, the error message is printed to STDOUT rather than STDERR.

This is causing the "Cannot connect" message to end up in the docker_version variable here: https://github.com/denysdovhan/spaceship-prompt/blob/master/sections/docker.zsh#L61

I hope it's the right place (so many docker related repos 馃槢), but I've created an issue on docker/cli about the issue: https://github.com/docker/cli/issues/2777

For those of you who are stumbling across this issue and don't really care much about the docker version can simply disable the docker section using this environment variable.

SPACESHIP_DOCKER_SHOW=false
Was this page helpful?
0 / 5 - 0 ratings

Related issues

martincartledge picture martincartledge  路  4Comments

salmanulfarzy picture salmanulfarzy  路  3Comments

conradwt picture conradwt  路  3Comments

xhaythemx picture xhaythemx  路  3Comments

gabrielpedepera picture gabrielpedepera  路  3Comments