CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
404 stars 233 forks source link

` local execute build` command fails when sidecar is present and using the latest docker version #970

Open nanophate opened 11 months ago

nanophate commented 11 months ago

Meta:

CircleCI CLI Version: 0.1.27660+35d39ea (release)

Operating System: macOS 13.4.1 (c) (22F770820d)

CircleCI CLI Diagnostic:

circleci diagnostic                                                                                                                     INT ✘

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/vivio/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.
Hello, Naoya Matayoshi.

Current behavior:

No links but it is possible to replicate the issue by creating a following config and running circleci local execute build with latest docker desktop on mac. Server Version: 24.0.2

version: 2.1

jobs:
  build:
    docker:
      - image: cimg/ruby:3.2
      - image: cimg/redis:15.3
    steps:
      - run: echo "heelo"

Error display after command

Starting container cimg/postgres:15.3
Creating Docker containers in parallel ..Error:   error starting container cimg/postgres:15.3: Error response from daemon: invalid UTS mode: containere48ed9db8ce062238a67ce919ed3f438e2b4a6efaeab1e7bd6794193be8b3bf0

Error: 
Unexpected environment preparation error: Error response from daemon: invalid UTS mode: containere48ed9db8ce062238a67ce919ed3f438e2b4a6efaeab1e7bd6794193be8b3bf0

Step failed
Task failed
Error: Unhandled prepare executor error: Error response from daemon: invalid UTS mode: containere48ed9db8ce062238a67ce919ed3f438e2b4a6efaeab1e7bd6794193be8b3bf0

Expected behavior:

On docker version Server Version: 20.10.23 it did not show any error and was working expected.

Starting container cimg/postgres:15.3
3.2: Pulling from cimg/ruby
Digest: sha256:fa15234a551a1777d9e63d036bf1305679f7a2c0d5882810598831b0550d81aa
Status: Image is up to date for cimg/ruby:3.2
Creating Docker containers in parallel ....................................................................................
cimg/postgres:15.3:
  using image cimg/postgres@sha256:788e6d47c0413873309ad2c78a9dc7bf84d33743d26b1f617cfe28816df8a2ba
  pull stats: download 339.9MiB in 56.636s (6.001MiB/s), extract 339.8MiB in 22.896s (14.84MiB/s)
  time to create container: 765ms
Time to upload agent and config: 3.285449024s
Time to start containers: 849.631467ms
====>> Container cimg/postgres:15.3
====>> Preparing environment variables
Using build environment variables:
  BASH_ENV=/tmp/.bash_env-localbuild-1689921565
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=
  CIRCLE_BUILD_NUM=
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_REPOSITORY_URL=
  CIRCLE_SHA1=
  CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1689921565
  CIRCLE_WORKING_DIRECTORY=~/project

The redacted variables listed above will be masked in run step output.====>> echo "heelo"
  #!/bin/bash -eo pipefail
echo "heelo"
heelo
Success!
Step canceled

When did this begin / Was this previously working?:

After upgrading to docker 24 the issue started to happen. docker 20 did not have this issue.

Additional Information: