-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: better error message for 'docker create network' and other similar incorrect patterns #1986
Comments
Makes sense, though error message maybe could be |
I like that, since it makes explicit that what the user typed is the container creation function, when they meant to create a network (or something else). |
bartolone
added a commit
to bartolone/cli
that referenced
this issue
Jul 7, 2019
…network instead of docker network create (or config, container, plugin, secret, service, or volume). Addresses issue docker#1986 Signed-off-by: Jake Bartolone <jakebartolone@gmail.com>
bartolone
added a commit
to bartolone/cli
that referenced
this issue
Jul 7, 2019
…y cpuguy83 in the discussion of issue docker#1986 Signed-off-by: Jake Bartolone <jakebartolone@gmail.com>
bartolone
added a commit
to bartolone/cli
that referenced
this issue
Jul 7, 2019
Signed-off-by: Jake Bartolone <jakebartolone@gmail.com> Added additional error message context when user types docker create network instead of docker network create (or config, container, plugin, secret, service, or volume). Addresses issue docker#1986 Signed-off-by: Jake Bartolone <jakebartolone@gmail.com> Added additional context to the original error message as suggested by cpuguy83 in the discussion of issue docker#1986 Signed-off-by: Jake Bartolone <jakebartolone@gmail.com>
bartolone
added a commit
to bartolone/cli
that referenced
this issue
Jul 7, 2019
Added additional error message context when user types docker create network instead of docker network create (or config, container, plugin, secret, service, or volume). Addresses issue docker#1986 Added additional context to the original error message as suggested by cpuguy83 in the discussion of issue docker#1986 fixed namedReference to string comparison fixing another typo fixing line length to pass linter test another update to pass the linter Signed-off-by: Jake Bartolone <jakebartolone@gmail.com>
bartolone
added a commit
to bartolone/cli
that referenced
this issue
Jul 9, 2019
…tead of docker network create (or other similar mistakes) When a user is attempting to create a network and mistakenly types docker create network instead of the correct docker network create, this adds additional error message context to point the user to the correct command. This applies to config, container, plugin, secret, service, and volume in addition to network. Also updated the generic error message for docker create to begin with "Error while creating container" to make clear that the create command defaults to container create. Also fixed a comment typo in create.go and updated the e2e test golden file containing expected error messages for jenkins CI testing to now look for the updated error message. Resolves issue docker#1986 Signed-off-by: Jake Bartolone <jakebartolone@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When trying the (incorrect) command
docker create network ...
the user receives a potentially unhelpful error message:Unable to find image 'network:latest' locally
(this also applies to config, container, plugin, secret, service, and volume in addition to network). This error message is unintuitive if the user is attempting to create a network and does not redirect them to the correct syntax.This incorrect pattern seems to be relatively common (see the following examples):
*jupyterhub/jupyterhub#2632
*nginx-proxy/nginx-proxy#502 (comment)
*https://github.com/fluencelabs/fluence/blob/master/bootstrap/private_ethereum.md
I propose a new error message to redirect users to the correct pattern as it is much more likely their intent to create a network than to create a container named 'network'. This would likely also necessitate precluding users from naming their containers any one of config, container, network, plugin, secret, service, or volume, but use of those names should probably be discouraged anyway.
I would be happy to take a stab at a PR, but I am not familiar enough with the codebase to be sure of all of the files that would need updating. If someone is willing to help me identify those, I will go ahead and take a shot at it. Also happy to defer if anyone else wants to tackle this, but wanted to get feedback first on if this idea would be supported.
Steps to reproduce the issue:
docker create network
or substitute any of config, container, plugin, secret, service, and volume in place of networkDescribe the results you received:
Unable to find image 'network:latest' locally
Error response from daemon: pull access denied for network, repository does not exist or may require 'docker login'
Describe the results you expected:
Error: cannot create a container named 'network'
If you were trying to create a network, see 'docker network create --help'
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: