-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Very misleading error messaging from typo in yaml file. #2816
Comments
That's really strange, our config validation should have noticed this and provided a good error message. What version of compose are you running ( The output of |
Ah, I see the problem from the docker log. I assumed it treated |
@endophage we might be able to work around this from compose, but I think this is actually a bug in docker engine. An invalid input should be a 400 status code, not a 500. |
@dnephin yeah, I believe yaml requires a space between the dash and the following content to treat it as a list. I'm running 1.4.0, I guess I missed the last update or two. Updated to 1.6.0 RC2 and the error is now:
You're right, this should be a 400, but even a 500 indicates you contacted the server (daemon) so an error message indicating compose couldn't connect seems like something that should be changed on the compose side. |
I think |
That makes sense. Should this be closed and the same issue filed over on the docker-py repo? Or will there be some integration work here too? |
We'll often keep the compose issue open to track updating the version of |
@endophage I took another look into these errors in an attempt to fix the behaviour. I once again believe this is an engine bug. I tried this with docker-py: client.build('.', '-test')
ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer')) It's not even a 500 error, it a TCP connection error, so I think the error we're responding with is correct. I also tried the
There's not much we can do here until docker engine responds with a valid HTTP response code. I believe even with a 500 code we would echo the error message and exit properly. I don't think it's correct to duplicate the tag validation in the client. |
Looks like this is working properly now: $ cat docker-compose.yml
version: '2'
services:
-service:
build:
context: .
$ docker-compose up
Building -service
ERROR: Error parsing reference: "repro2816_-service" is not a valid repository/tag |
So I had an errant
-
in my compose yaml file, and it manifested itself duringdocker-compose build
as the following error:The yml file was bad in the below format (the service name was prefixed with the
-
):The error docker is returning (dug it out of journalctl) is:
My error in the yaml file is obvious now I've seen it but the error message is very unintuitive and I assume this isn't the only case in which docker returns a reasonable (if technical) error message and compose returns something more obscure.
FYI, when trying to build a similarly badly named thing on docker itself, it returns the expected error:
The text was updated successfully, but these errors were encountered: