Unexpected environment preparation error: error connecting build-agent to ephemeral network

I am trying to test some new configuration and this is what happens:

; circleci local execute -c process.yml --job build-linux
Docker image digest: sha256:fccce6bc62daf447243b12b7ca2580d913484b5016cb7a66f920ca5d8b8e7c9a
====>> Spin up environment
Build-agent version  ()
Docker Engine Version: 19.03.11
Kernel Version: Linux f36f53d2fe9c 5.7.9-200.fc32.x86_64 #1 SMP Fri Jul 17 16:23:37 UTC 2020 x86_64 Linux
Error:
Unexpected environment preparation error: error connecting build-agent to ephemeral network: error connecting build-agent container to ephemeral network: Error response from daemon: No such container: docker-f36f53d2fe9c9d797fc89180cdd55cf65f85e5dd4693d11f3ba0d1f6f4d846db.scope

Step failed
Task failed
Error: Unhandled prepare executor error: error connecting build-agent to ephemeral network: error connecting build-agent container to ephemeral network: Error response from daemon: No such container: docker-f36f53d2fe9c9d797fc89180cdd55cf65f85e5dd4693d11f3ba0d1f6f4d846db.scope

And the process.yml looks like:

version: 2
jobs:
  build-linux:
    docker:
    - image: cimg/base:2020.01
    steps:
    - checkout
    - run:
        command: |
          GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" \
            git clone git@github.com:worldr/PRIVATE.git
workflows:
  build:
    jobs:
    - build-linux
  version: 2

OS is Fedora 32, Docker version 19.03.11, build 42e35e6.

Any idea what I am doing wrong?

Hi @yanngolanski

While this is not exactly a solution to your problem, it might help you focus on where to debug.

I just tested your exact configuration (with a private repository of my own) but didn’t get the error you’re seeing.
OS is macOS 10.15.6, Docker version is 19.03.8, and CircleCI CLI version is 0.1.5879+416032d

Thank you!

The problem was that I did not have a user SSH key defined and you cannot have multiple keys in the same GitHub repository. All sorted now that I have the user SSH key defined.

2 Likes

I am having the same issue and error as above. But I am not sure what steps you took to solve it for you. Where do I need to add a user SSH key? To github? I have one configured already in my github user settings and I am still getting the same error. Thanks!

Apologies, just saw this!

You need to add a SSH key to your account that CircleCI will use. So, CircleCI has the private key, your GitHub account the public key.

Hope that helps.