You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ DOCKER_HOST=/invalid.sock docker versionClient: Version: 27.5.1 API version: 1.47 Go version: go1.22.11 Git commit: 9f9e405 Built: Wed Jan 22 13:39:08 2025 OS/Arch: linux/arm64 Context: defaultCannot connect to the Docker daemon at tcp://localhost:2375/invalid.sock. Is the docker daemon running?
This error message is quite confusing, as the original invalid DOCKER_HOST value does not contain tcp://localhost:2375.
Probably it should return an error like invalid $DOCKER_HOST value "/invalid.sock": must start with "unix://" or "tcp://"
The text was updated successfully, but these errors were encountered:
Thx! Yeah, I think there's some dubious (and inconsistent) handling for these in some areas.
I suspect I may have introduced this when I replaced some code with url.Parse (adding a scheme if missing), but it's possible it was elsewhere as I found multiple places where logic for this was implemented, but ever-so-slightly different.
Oh, and if we're gonna add that to the error message, ssh:// should probably also be there.
I suspect part of this may be due to logic where hostname (without scheme) would be considered tcp://hostname, and we may be using tcp as default if not set, which in this case, gets seen as <host missing>/invalid.sock -> <default host and scheme>/invalid.sock.
But perhaps in this case, we should consider checking if the value starts with something that indicates a path (/, ./), as in that case the user very likely meant "path to a socket".
Description
This error message is quite confusing, as the original invalid
DOCKER_HOST
value does not containtcp://localhost:2375
.Probably it should return an error like
invalid $DOCKER_HOST value "/invalid.sock": must start with "unix://" or "tcp://"
The text was updated successfully, but these errors were encountered: