dapr / dapr/cli

Unhelpful error when initializing Dapr using a non-moby Docker context

Open
#459 4 comments 0 reactions 0 assignees View on GitHub
kind/bug triaged/resolved
Dominant language
Go
Stars
353
Forks
221
Avg merge
3d 8h
Merged PRs (30d)
2

Description

## Expected Behavior

When attempting to initialize Dapr using a non-moby Docker context, the user should get an error like "Dapr isn't supported in the current Docker context".

## Actual Behavior

Dapr returns the following error:

```
⌛ Making the jump to hyperspace...
❌ unable to confirm whether dapr_zipkin is running or exists. error
unknown flag: --filter
```

The reason is that certain types of Docker contexts (e.g. `ACI`) support only a subset of the traditional Docker CLI arguments. In this case, `ACI` contexts do not support the `--filter` argument on the `docker ps` command ([used by Dapr to determine whether its components are already running](https://github.com/dapr/cli/blob/48f9e645204cf6f82f992cf8de5bc8f4431f5894/pkg/standalone/standalone.go#L335)).

> Note: ACI contexts are currently in beta, so perhaps it might *eventually* support `--filter` and make this issue moot. Alternatively, Docker may improve the error message in this case to better describe the limitations of the current context (as it does when, say, executing `docker images` in an ACI context.) Still, when the Docker commands are hidden from the user (as is the case here with Dapr) it may still be useful to recognize and trap certain kinds of errors in order to provide a better, more actionable, error.

> One could argue this is just an "enhancement", in that I'm really looking for a better error message. However, I labeled it a "bug" as the `dapr init` command exposes an implementation detail in this error case that's confusing to users who may not understand how Docker is being used under the covers.

## Steps to Reproduce the Problem

1. Install the latest Edge version (e.g. 2.3.6.1) of Docker.
1. Create and switch to an ACI Docker context (see [guide](https://docs.docker.com/engine/context/aci-integration/)).
1. Run `dapr init`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.