Fail to build images with docker compose

Currently, using docker compose to build an image fails with this error:

listing workers for Build: failed to list workers: Unavailable: connection error: desc = "transport: Error while dialing unable to upgrade to h2c, received 404"

This bug has been minimally recreated here: GitHub - cjfinnell/circleci-compose-build-bug: Recreating a CircleCI bug: failure to build via docker compose when using a docker executor

Building the image beforehand with docker build and referencing the built image in docker-compose is a functioning workaround, but requires tedious refactoring of CI pipelines that currently use docker compose.

This bug appeared sometime after April 4th 2022 (last confirmed run without this issue).

Edit: This bug is limited to the current default docker version 17.09.0-ce

2 Likes

This also appears to be dependent on what image you’re using for the job that is trying to use remote Docker. We had a job that was running with cimg/go:1.17.8, and it consistently worked fine with this old remote Docker version, but when we updated to cimg/go:1.17.9 it failed just as you described (and, as you said, updating the setup_remote_docker version to a newer one than the default fixed it). The cimg/go:1.17.9 release bumped the Docker version (that is, the one in the container for that job) to 20.10.14 and even though I wouldn’t normally expect a patch version to have a significant compatibility difference, maybe it stopped being compatible with the remote 17.09.0-ce version at that point.

I’ve just hit the same wall after migrating base image from debian to alpine, which forced me to change “docker-compose” to “docker compose”.

Originally built using CircieCI Docker Remote 19.03.13, changing to 20.10.14 yielded the Not available error, and because the project itself runs on 20.10.12 internally, I’ve finally succeeded with:

      - setup_remote_docker:
          docker_layer_caching: true # should not be important
          version: 20.10.12

The problem is gone, however scary different the log output is now. I just need to get used to it.